[jboss-jira] [JBoss JIRA] Created: (JBAS-3689) Naming fails to accept a custom client socket
Scott M Stark (JIRA)
jira-events at jboss.com
Fri Sep 22 16:11:01 EDT 2006
Naming fails to accept a custom client socket
---------------------------------------------
Key: JBAS-3689
URL: http://jira.jboss.com/jira/browse/JBAS-3689
Project: JBoss Application Server
Issue Type: Support Patch
Security Level: Public (Everyone can see)
Components: Naming
Affects Versions: JBossAS-4.0.3 SP1
Reporter: Scott M Stark
Assigned To: Scott M Stark
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 = {String.class};
Method m = csfClass.getMethod("setBindAddress", parameterTypes);
Object[] args = {addr.getHostAddress()};
m.invoke(serverSocketFactory, args); // +++ line 355, This should be clientSocketFactory
}
catch (NoSuchMethodException e)
{
log.warn("Socket factory does not support setBindAddress(String)");
// Go with default address
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list