Details
-
Patch
-
Resolution: Obsolete
-
Major
-
None
-
JBossAS-4.0.3 SP1
-
None
Description
Attempting to set a custom client socket on the NamingService
<mbean code="org.jboss.naming.NamingService"
name="jboss:service=Naming"
xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
<!-- The call by value mode. true if all lookups are unmarshalled using
the caller's TCL, false if in VM lookups return the value by reference.
-->
<attribute name="CallByValue">false</attribute>
<!-- The listening port for the bootstrap JNP service. Set this to -1
to run the NamingService without the JNP invoker listening port.
-->
<attribute name="Port">1099</attribute>
<attribute name="RmiPort">1098</attribute>
<!-- The bootstrap JNP server bind address. This also sets the default
RMI service bind address. Empty == all addresses
-->
<attribute name="BindAddress">${iface.A}</attribute>
<attribute name="RmiBindAddress">${iface.A}</attribute>
<!-- The thread pool service used to control the bootstrap lookups -->
<depends optional-attribute-name="LookupPool"
proxy-type="attribute">jboss.system:service=ThreadPool</depends>
<attribute name="ClientSocketFactory">case9179.TimeoutClientSocketFactory</attribute>
</mbean>
fails with:
2006-09-22 12:46:12,417 WARN [org.jboss.naming.NamingService] Failed to setBindAddress=/192.168.2.107 on socket factory
java.lang.NullPointerException: case9179.TimeoutClientSocketFactory.setBindAddress invoked on null object
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;J)Ljava.lang.Object;(Unknown Source)
at org.jnp.server.Main.initCustomSocketFactories(Main.java:355)
at org.jnp.server.Main.start(Main.java:255)
at org.jboss.naming.NamingService.startService(NamingService.java:221)
The problem is that there copy/paste error at line 355:
protected void initCustomSocketFactories()
{
// Use either the rmiBindAddress or bindAddress for the RMI service
InetAddress addr = rmiBindAddress;
if( addr == null )
addr = bindAddress;
if( clientSocketFactory != null )
{
// See if the client socket supports setBindAddress(String)
try
{
Class csfClass = clientSocketFactory.getClass();
Class[] parameterTypes =
;
Method m = csfClass.getMethod("setBindAddress", parameterTypes);
Object[] args =
;
m.invoke(serverSocketFactory, args); // +++ line 355, This should be clientSocketFactory
}
catch (NoSuchMethodException e)