Bug 900262 (JBPAPP6-240) - Unable to disable -Djava.net.preferIPv4=true in domain mode without editing domain.conf
Summary: Unable to disable -Djava.net.preferIPv4=true in domain mode without editing d...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: JBPAPP6-240
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Server
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: EAP 6.1.0
Assignee: Jitka Kozana
QA Contact:
URL: http://jira.jboss.org/jira/browse/JBP...
Whiteboard:
Depends On:
Blocks: JBPAPP6-1377
TreeView+ depends on / blocked
 
Reported: 2012-04-19 14:12 UTC by Jan Martiska
Modified: 2014-10-25 11:12 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-07-29 09:57:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker AS7-5409 0 Major Resolved CLONE - Unable to disable -Djava.net.preferIPv4=true in domain mode without editing domain.conf 2014-07-29 10:24:16 UTC
Red Hat Issue Tracker JBPAPP6-240 0 Critical Closed Unable to disable -Djava.net.preferIPv4=true in domain mode without editing domain.conf 2014-07-29 10:24:16 UTC

Description Jan Martiska 2012-04-19 14:12:31 UTC
Affects: Release Notes
Workaround Description: Workaround for this is to change the argument in domain.conf to -Djava.net.preferIPv4Stack=false (or remove it); after that, the process will know that it is supposed to use IPv6. 

Note also that the standard domain.xml includes the following:


    <system-properties>
        <!-- IPv4 is not required, but setting this helps avoid unintended use of IPv6 -->
        <property name="java.net.preferIPv4Stack" value="true"/>        
    </system-properties>

That property will need to be removed or commented out.
project_key: JBPAPP6

Try running EAP domain mode like this:
{noformat}
bin/domain.sh -Djava.net.preferIPv4Stack=false -bmanagement=::1
{noformat}
It will fail:
{noformat}
[Host Controller] 09:40:49,647 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.network.management: org.jboss.msc.service.StartException in service jboss.network.management: JBAS015810: failed to resolve interface management
[Host Controller] 	at org.jboss.as.server.services.net.NetworkInterfaceService.start(NetworkInterfaceService.java:97) [jboss-as-server-7.1.1.Final-redhat-1.jar:7.1.1.Final-redhat-1]
[Host Controller] 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
[Host Controller] 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
[Host Controller] 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]
[Host Controller] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]
[Host Controller] 	at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
{noformat}
Other interfaces work and can be bound to ipv6, just 'management' does not. (In standalone mode, this issue is not present.)

Blocks testing of Admin console,Native+HTTP interfaces in domain mode in IPv6, not marking as blocker because workaround exists.

Comment 1 Jan Martiska 2012-04-19 14:15:39 UTC
Workaround Description: Added: Workaround for this is to change the argument in domain.conf to -Djava.net.preferIPv4Stack=false (or remove it); after that, the process will know that it is supposed to use IPv6.
Workaround: Added: Workaround Exists


Comment 2 Brian Stansberry 2012-04-19 14:37:02 UTC
This is minor, since the workaround is to use domain.conf, which is the recommended approach for setting system properties that affect JVM behavior. Using the .conf file for that kind of thing has been the recommended behavior since EAP 4 and probably before that.

Note also that editing domain.conf is not required, if that's a pain for QE, since all it does is set some environment variables if they are not already set. So whatever script is launching EAP can set those environment variables before launching EAP.

Comment 3 Rajesh Rajasekaran 2012-05-01 15:45:42 UTC
Link: Added: This issue is a dependency of JBPAPP-7470


Comment 4 Anne-Louise Tangring 2012-05-23 18:50:51 UTC
This issue has been triaged and decided to not block/prevent/hold the EAP 6 release. To comply with Release Criteria stating that no issues with Critical or Blocker priority setting can be open for the release, this is changed to priority Major. 

Comment 5 Misty Stanley-Jones 2012-06-01 06:15:30 UTC
Release Notes Docs Status: Added: Documented as Known Issue
Release Notes Text: Added: If you use a command-line argument to bind to an IPv6 address at start-up, the server fails to start with the default configuration. The preferred workaround is to set the bind address in the configuration file, either <filename>domain.xml</filename> or <filename>standalone.xml</filename>. If you need to pass the IP address on the command line, add the <code>java.net.preferIPv4Stack=false</code> setting to your command. The following is an example of such a command.
Affects: Added: Release Notes


Comment 6 Brian Stansberry 2012-06-01 16:02:59 UTC
Misty, the release notes text doesn't reflect my understanding of the issue.

My understanding is:

Attempting to disable EAP's default java.net.prefer.IPv4Stack=true setting from the command line does not work when starting a host in a managed domain. An example of disabling this setting from the command line would be:

bin/domain.sh -Djava.net.preferIPv4Stack=false -bmanagement=::1

The workaround is to edit domain.conf (or domain.conf.bat on Windows systems) and remove the java.net.prefer.IPv4Stack=true setting found there, or change the value to 'false'.

Comment 7 Rajesh Rajasekaran 2012-06-08 20:58:28 UTC
Link: Removed: This issue is a dependency of JBPAPP-7470 


Comment 8 Rajesh Rajasekaran 2012-06-08 21:02:54 UTC
Link: Added: This issue is a dependency of JBPAPP-9320


Comment 9 Brian Stansberry 2012-08-01 05:15:40 UTC
A fix for this would involve having the script parse all the arguments to domain.sh (and .bat), detect any -D value, and append that value to $HOST_CONTROLLER_JAVA_OPTS, which would result in it being.

I don't intend to do this for EAP 6.0.1, as I believe the recommended behavior of editing domain.conf is what should be done.

Comment 10 Brian Stansberry 2012-08-01 05:41:18 UTC
I changed the title as the old title was misleading.

Comment 11 Brian Stansberry 2012-08-01 22:45:35 UTC
Changed my mind; I'll try and get this into 6.0.1.

Comment 12 Brian Stansberry 2012-08-21 19:24:54 UTC
Link: Added: This issue Cloned to JBPAPP-9726


Comment 13 Shelly McGowan 2012-09-11 17:43:49 UTC
This was resolved in ER1.

Comment 14 Anne-Louise Tangring 2012-11-05 02:22:11 UTC
Release Notes Docs Status: Removed: Documented as Known Issue 
Release Notes Text: Removed: If you use a command-line argument to bind to an IPv6 address at start-up, the server fails to start with the default configuration. The preferred workaround is to set the bind address in the configuration file, either <filename>domain.xml</filename> or <filename>standalone.xml</filename>. If you need to pass the IP address on the command line, add the <code>java.net.preferIPv4Stack=false</code> setting to your command. The following is an example of such a command. 
Docs QE Status: Removed: NEW 


Comment 15 Ondrej Lukas 2012-11-19 13:22:53 UTC
Issue still exists in EAP 6.0.1 ER3

Comment 16 Jitka Kozana 2012-11-19 13:51:17 UTC
The exception is now (6.0.1.ER3) not seen in [Host Controller], but in both servers, server-one and server-two, see below:
{code}
[Server:server-two] 08:37:34,330 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.network.management: org.jboss.msc.service.StartException in service jboss.network.management: JBAS015810: failed to resolve interface management
[Server:server-two] 	at org.jboss.as.server.services.net.NetworkInterfaceService.start(NetworkInterfaceService.java:97) [jboss-as-server-7.1.3.Final-redhat-3.jar:7.1.3.Final-redhat-3]
[Server:server-two] 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
[Server:server-two] 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-2.jar:1.0.2.GA-redhat-2]
[Server:server-two] 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]
[Server:server-two] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]
[Server:server-two] 	at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
[Server:server-two] 
{code}

And, workaround is not working. Even adding -Djava.net.preferIPv6Addresses=true is not helping.
Therefore, raising priority to critical.

Comment 17 Jitka Kozana 2012-11-19 13:52:02 UTC
Workaround: Removed: Workaround Exists 


Comment 18 Brian Stansberry 2012-11-19 15:17:44 UTC
The standard domain.xml includes the following:

    <system-properties>
        <!-- IPv4 is not required, but setting this helps avoid unintended use of IPv6 -->
        <property name="java.net.preferIPv4Stack" value="true"/>        
    </system-properties>

That property will need to be removed or commented out. 

I have added that information to the Workaround Description.

With that done and -Djava.net.preferIPv4Stack=true removed from domain.conf, starting a process with "./domain.sh -bmanagement=::1" works fine.

Comment 19 Brian Stansberry 2012-11-19 15:17:45 UTC
Workaround Description: Removed: Workaround for this is to change the argument in domain.conf to -Djava.net.preferIPv4Stack=false (or remove it); after that, the process will know that it is supposed to use IPv6. Added: Workaround for this is to change the argument in domain.conf to -Djava.net.preferIPv4Stack=false (or remove it); after that, the process will know that it is supposed to use IPv6. 

Note also that the standard domain.xml includes the following:


    <system-properties>
        <!-- IPv4 is not required, but setting this helps avoid unintended use of IPv6 -->
        <property name="java.net.preferIPv4Stack" value="true"/>        
    </system-properties>

That property will need to be removed or commented out.


Comment 20 Brian Stansberry 2012-11-19 15:22:27 UTC
I forgot the original point of this JIRA was wanting to not have to edit domain.conf. I just verified that with the <property name="java.net.preferIPv4Stack" value="true"/> removed from domain.xml but domain.conf unedited, this works:

./domain.sh -Djava.net.preferIPv4Stack=false -bmanagement=::1

Comment 21 Jitka Kozana 2012-11-20 06:41:28 UTC
Brian, thanks for the update. The workaround I used only advised to edit domain.conf, not domain.xml.

Comment 23 Dominik Pospisil 2014-07-29 09:57:25 UTC
Closing based on above Brian's comment and workaround verification.


Note You need to log in before you can comment on or make changes to this bug.