[
https://issues.jboss.org/browse/AS7-4156?page=com.atlassian.jira.plugin.s...
]
Richard Achmatowicz edited comment on AS7-4156 at 4/12/12 8:18 PM:
-------------------------------------------------------------------
I now see what is happening here: in each AS instance, JacORB is trying to create a
ServerSocket with a bind address set to null. The call to create the socket is in
IIOPListener:
{noformat}
protected ServerSocket createServerSocket()
{
try
{
return socketFactoryManager.getServerSocketFactory()
.createServerSocket (address.getPort(),
20,
address.getConfiguredHost());
}
catch (IOException ex)
{
logger.warn("could not create server socket port: " + address.getPort()
+ " host: " + address.getConfiguredHost(), ex);
throw new org.omg.CORBA.INITIALIZE ("Could not create server socket (" +
address.getPort() + "): " + ex.toString());
}
}
{noformat}
Th IIOPAddress object instance has some code in it which sets the bind address to null if
it is a link-local address (in the method init_host):
{noformat}
if (!hasZoneId)
{
try
{
host = InetAddress.getByName(source_name);
}
catch (UnknownHostException ex)
{
if (logger != null && logger.isWarnEnabled())
{
logger.warn ("init_host, " + source_name + " unresolvable"
);
}
unresolvable = true;
try
{
host = InetAddress.getByName(null); //localhost
}
catch (UnknownHostException ex2)
{
}
}
}
else
{
if (logger != null && logger.isWarnEnabled())
{
logger.warn ("init_host, " + source_name +
" is local-link address");
}
unresolvable = true;
host = null; //will allow binds on all interfaces
}
{noformat}
We see the corresponding messages in the log:
{noformat}
19:46:03,070 WARN [jacorb.iiop.address] (MSC service thread 1-4) init_host,
fe80:0:0:0:f2de:f1ff:fe40:75b9%2 is local-link address
19:46:03,073 WARN [jacorb.iiop.address] (MSC service thread 1-4) init_host,
fe80:0:0:0:f2de:f1ff:fe40:75b9%2 is local-link address
19:46:03,085 WARN [jacorb.iiop.address] (MSC service thread 1-4) init_host,
fe80:0:0:0:f2de:f1ff:fe40:75b9%2 is local-link address
{noformat}
and so the bind in the first AS instance succeeds, but the second one fails, as it is
already being used.
was (Author: rachmato):
I now see what is happening here: in each AS instance, JacORB is trying to create a
ServerSocket with a bind address set to null:
{noformat}
protected ServerSocket createServerSocket()
{
try
{
return socketFactoryManager.getServerSocketFactory()
.createServerSocket (address.getPort(),
20,
address.getConfiguredHost());
}
catch (IOException ex)
{
logger.warn("could not create server socket port: " + address.getPort()
+ " host: " + address.getConfiguredHost(), ex);
throw new org.omg.CORBA.INITIALIZE ("Could not create server socket (" +
address.getPort() + "): " + ex.toString());
}
}
{noformat}
Th IIOPAddress object instance has some code in it which sets the bind address to null if
it is a link-local address (in the method init_host):
{noformat}
if (!hasZoneId)
{
try
{
host = InetAddress.getByName(source_name);
}
catch (UnknownHostException ex)
{
if (logger != null && logger.isWarnEnabled())
{
logger.warn ("init_host, " + source_name + " unresolvable"
);
}
unresolvable = true;
try
{
host = InetAddress.getByName(null); //localhost
}
catch (UnknownHostException ex2)
{
}
}
}
else
{
if (logger != null && logger.isWarnEnabled())
{
logger.warn ("init_host, " + source_name +
" is local-link address");
}
unresolvable = true;
host = null; //will allow binds on all interfaces
}
{noformat}
We see the corresponding messages in the log:
{noformat}
19:46:03,070 WARN [jacorb.iiop.address] (MSC service thread 1-4) init_host,
fe80:0:0:0:f2de:f1ff:fe40:75b9%2 is local-link address
19:46:03,073 WARN [jacorb.iiop.address] (MSC service thread 1-4) init_host,
fe80:0:0:0:f2de:f1ff:fe40:75b9%2 is local-link address
19:46:03,085 WARN [jacorb.iiop.address] (MSC service thread 1-4) init_host,
fe80:0:0:0:f2de:f1ff:fe40:75b9%2 is local-link address
{noformat}
and so the bind in the first AS instance succeeds, but the second one fails, as it is
already being used.
JacORB throws BindException: Address in use in a clustered
environment with IPv6 addresses
------------------------------------------------------------------------------------------
Key: AS7-4156
URL:
https://issues.jboss.org/browse/AS7-4156
Project: Application Server 7
Issue Type: Bug
Components: IIOP
Affects Versions: 7.1.1.Final
Reporter: Richard Achmatowicz
Assignee: Stefan Guilhen
Labels: eap6_need_triage
Fix For: 7.1.2.Final-redhat1
JacORB throws an BindException (address in use) when starting in a clustered environment
with IPv6 global addresses:
{noformat}
13:15:43,833 INFO [org.jboss.as.jacorb] (MSC service thread 1-8) JBAS016330: CORBA ORB
Service started
13:15:43,969 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4)
JBAS015012: Started FileSystemDeploymentService for directory
/tmp/as71/standalone/deployments
13:15:43,972 WARN [jacorb.iiop.address] (MSC service thread 1-8) init_host,
3ffe:ffff:100:f101:0:0:0:1%2 is local-link address
13:15:43,960 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread
1-6) live server is starting with configuration HornetQ Configuration
(clustered=true,backup=false,sharedStore=true,journalDirectory=/tmp/as71/standalone/data/messagingjournal,bindingsDirectory=/tmp/as71/standalone/data/messagingbindings,largeMessagesDirectory=/tmp/as71/standalone/data/messaginglargemessages,pagingDirectory=/tmp/as71/standalone/data/messagingpaging)
13:15:43,971 INFO [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening
on /3ffe:ffff:100:f101:0:0:0:1%2:9999
13:15:43,971 INFO [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening
on 3ffe:ffff:100:f101:0:0:0:1%2/3ffe:ffff:100:f101:0:0:0:1%2:4447
13:15:43,975 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread
1-6) Waiting to obtain live lock
13:15:43,978 WARN [jacorb.iiop.address] (MSC service thread 1-8) init_host,
3ffe:ffff:100:f101:0:0:0:1%2 is local-link address
13:15:43,979 WARN [jacorb.orb.iiop] (MSC service thread 1-8) could not create server
socket port: 3528 host: null: java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method) [rt.jar:1.6.0_26]
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383) [rt.jar:1.6.0_26]
at java.net.ServerSocket.bind(ServerSocket.java:328) [rt.jar:1.6.0_26]
at java.net.ServerSocket.<init>(ServerSocket.java:194) [rt.jar:1.6.0_26]
at
org.jacorb.orb.factory.DefaultServerSocketFactory.createServerSocket(DefaultServerSocketFactory.java:49)
[jacorb-2.3.1.jbossorg-1.jar:]
at org.jacorb.orb.iiop.IIOPListener$Acceptor.createServerSocket(IIOPListener.java:572)
[jacorb-2.3.1.jbossorg-1.jar:]
at org.jacorb.orb.iiop.IIOPListener$Acceptor.init(IIOPListener.java:417)
[jacorb-2.3.1.jbossorg-1.jar:]
at org.jacorb.orb.iiop.IIOPListener.configure(IIOPListener.java:163)
[jacorb-2.3.1.jbossorg-1.jar:]
at org.jacorb.orb.etf.FactoriesBase.newInstance(FactoriesBase.java:125)
[jacorb-2.3.1.jbossorg-1.jar:]
at org.jacorb.orb.etf.FactoriesBase.create_listener(FactoriesBase.java:74)
[jacorb-2.3.1.jbossorg-1.jar:]
at org.jacorb.orb.BasicAdapter.configure(BasicAdapter.java:102)
[jacorb-2.3.1.jbossorg-1.jar:]
at org.jacorb.orb.ORB.getRootPOA(ORB.java:1036) [jacorb-2.3.1.jbossorg-1.jar:]
at org.jacorb.orb.ORB.resolve_initial_references(ORB.java:1307)
[jacorb-2.3.1.jbossorg-1.jar:]
at org.jboss.as.jacorb.service.CorbaPOAService.start(CorbaPOAService.java:153)
[jboss-as-jacorb-7.1.1.Final-SNAPSHOT.jar:7.1.1.Final-SNAPSHOT]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[rt.jar:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[rt.jar:1.6.0_26]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
13:15:43,998 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed
to start service jboss.jacorb.poa-service.rootpoa: org.jboss.msc.service.StartException in
service jboss.jacorb.poa-service.rootpoa: org.omg.CORBA.INITIALIZE: Could not create
server socket (3528): java.net.BindException: Address already in use
at org.jboss.as.jacorb.service.CorbaPOAService.start(CorbaPOAService.java:155)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[rt.jar:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[rt.jar:1.6.0_26]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
Caused by: org.omg.CORBA.INITIALIZE: Could not create server socket (3528):
java.net.BindException: Address already in use
at org.jacorb.orb.iiop.IIOPListener$Acceptor.createServerSocket(IIOPListener.java:580)
at org.jacorb.orb.iiop.IIOPListener$Acceptor.init(IIOPListener.java:417)
at org.jacorb.orb.iiop.IIOPListener.configure(IIOPListener.java:163)
at org.jacorb.orb.etf.FactoriesBase.newInstance(FactoriesBase.java:125)
at org.jacorb.orb.etf.FactoriesBase.create_listener(FactoriesBase.java:74)
at org.jacorb.orb.BasicAdapter.configure(BasicAdapter.java:102)
at org.jacorb.orb.ORB.getRootPOA(ORB.java:1036)
at org.jacorb.orb.ORB.resolve_initial_references(ORB.java:1307)
at org.jboss.as.jacorb.service.CorbaPOAService.start(CorbaPOAService.java:153)
... 5 more
13:15:44,055 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread
1-8) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
{noformat}
This should not happen. I suspect that the IPv6 addresses are being mishandled somewhere.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira