Sep 17, 2007

RAD app server start with error "ORBX0390E: Cannot create listener thread"

ref: IBM technote

Problem
When running an application, the following exception is thrown. The exception indicates that a port conflict has occurred:

ORBRas E com.ibm.ws.orbimpl.transport.WSTransport createServerSocket 1494786 ORBX0390E: Cannot create listener thread. Exception=[org.omg.CORBA.INTERNAL: CAUGHT_EXCEPTION_WHILE_CONFIGURING_SSL_SERVER_SOCKET, Exception=org.omg.CORBA.INTERNAL: UNABLE_TO_CREATE_SSL_SERVER_SOCKET Exception=java.net.BindException: Address already in use vmcid: 0x49421000 minor code: 76 completed: No vmcid: 0x49421000 minor code: 77 completed: No ].

Cause
This error typically occurs when an ORB.init() is called from within an application running in an IBM® WebSphere® Application Server with hard coded ORB endpoints. While this is mostly seen when Global Security is enabled, the problem can also occur when the ORB Listener Address is hard coded to a specific port.

Solution
A J2EE application should use the ORB instance provided by the Application Server. If the application calls ORB.init() directly, it will attempt to open a socket which is already used by the Application Server's instance. To correct this issue, the application should be modified to not call ORB.init(), but rather use the ORB instance provided by the Application Server.

Refer to "Preferred API for obtaining an ORB instance" section from the following link(s) for further details:

V5.1

V6.0

V6.1

As a workaround you can change the port settings to be dynamic in the serverindex.xml for the server hosting the application. This should prevent the code from trying to init a port that is already in use.

Example:

In your serverindex.xml for the node in the question, you should have something similar to the following for the server where the application is deployed:


<specialEndpoints xmi:id="NamedEndPoint_1158785358893" endPointName="ORB_LISTENER_ADDRESS">

<endPoint xmi:id="EndPoint_1158785358894" host="hostname" port="9401"/>


</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1158785358894" endPointName="SAS_SSL_SERVERAUTH_LISTENER_ADDRESS">

<endPoint xmi:id="EndPoint_1158785358894" host="hostname" port="9404"/>


</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1158785358895" endPointName="CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS">

<endPoint xmi:id="EndPoint_1158785358895" host="hostname" port="9405"/>


</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1158785358896" endPointName="CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS">

<endPoint xmi:id="EndPoint_1158785358896" host="hostname" port="9406"/>


</specialEndpoints>


The ports are hard coded. From the console modify the port numbers for this Application Server replacing the above port numbers with 0's. The result would be this,


<specialEndpoints xmi:id="NamedEndPoint_1158785358893" endPointName="ORB_LISTENER_ADDRESS">

<endPoint xmi:id="EndPoint_1158785358894" host="hostname" port="0"/>


</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1158785358894" endPointName="SAS_SSL_SERVERAUTH_LISTENER_ADDRESS">

<endPoint xmi:id="EndPoint_1158785358894" host="hostname" port="0"/>


</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1158785358895" endPointName="CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS">

<endPoint xmi:id="EndPoint_1158785358895" host="hostname" port="0"/>


</specialEndpoints>

<specialEndpoints xmi:id="NamedEndPoint_1158785358896" endPointName="CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS">

<endPoint xmi:id="EndPoint_1158785358896" host="hostname" port="0"/>


</specialEndpoints>



Restart the server that was modified and retest the application.