Am 15.05.2012 um 12:10 schrieb Heiko W.Rupp:
Just found this "gem" in the JDK bug database:
"The JDK requires all sockets be IPv4 or all sockets be IPv6. It doesn't support the scenario where some Sockets are IPv4 and others are IPv6" http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6914801
This means as long as the agent is talking IPv4 to anyone, e.g. because on startup we give the debugger attach flags, it will not be able to make any IPv6 connection afterwards. Attempts to do so will result in " java.net.SocketException: Protocol family unavailable "
Interestingly enough, this bug itself may have been solved, but we may be running into a different one:
the -Djava.net.preferIPv4Stack=true property now looks like the bad guy:
snert:/im/rhq/modules/enterprise/agent/target/rhq-agent hrupp$ java -version java version "1.6.0_31" Java(TM) SE Runtime Environment (build 1.6.0_31-b04-415-11M3635) Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01-415, mixed mode) snert:/im/rhq/modules/enterprise/agent/target/rhq-agent hrupp$ echo $RHQ_AGENT_JAVA_OPTS -Xmx320m -agentlib:jdwp=transport=dt_socket,address=8788,server=y,suspend=n snert:/im/rhq/modules/enterprise/agent/target/rhq-agent hrupp$ bin/standalone.sh Listening for transport dt_socket at address: 8788
Starting the plugin container. Loading plugins ...Loaded plugin: JBossAS7 ...Loaded plugin: JMX ...Loaded plugin: Platforms
Ready. [0]:0 > disc s Discovery took: 1021ms [Resource[id=-3, uuid=a7d94d2d-944d-4c12-881a-73bef576a3c7, type={JBossAS7}JBossAS7 Standalone Server, key=/devel/jboss-eap-6.0/standalone, name=EAP (::1:9990), parent=snert, version=EAP 6.0.0.Beta2]] [1]:0 > avail -3 EAP (::1:9990)( -3 ):UP [2]:0 > quit Terminating .. Shutting down ... snert:/im/rhq/modules/enterprise/agent/target/rhq-agent hrupp$ export RHQ_AGENT_JAVA_OPTS="$RHQ_AGENT_JAVA_OPTS -Djava.net.preferIPv4Stack=true" snert:/im/rhq/modules/enterprise/agent/target/rhq-agent hrupp$ echo $RHQ_AGENT_JAVA_OPTS -Xmx320m -agentlib:jdwp=transport=dt_socket,address=8788,server=y,suspend=n -Djava.net.preferIPv4Stack=true snert:/im/rhq/modules/enterprise/agent/target/rhq-agent hrupp$ bin/standalone.sh Listening for transport dt_socket at address: 8788
Starting the plugin container. Loading plugins dis...Loaded plugin: JBossAS7 ...Loaded plugin: JMX ...Loaded plugin: Platforms
Ready. [0]:0 > disc s Discovery took: 1172ms [Resource[id=-3, uuid=5a2f33c7-62a3-434a-95cc-c24aa319725f, type={JBossAS7}JBossAS7 Standalone Server, key=/devel/jboss-eap-6.0/standalone, name=EAP (::1:9990), parent=snert, version=EAP 6.0]] [1]:0 > avail -3 EAP (::1:9990)( -3 ):DOWN