Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-3689

Naming fails to accept a custom client socket

    XMLWordPrintable

Details

    • Patch
    • Resolution: Obsolete
    • Major
    • None
    • JBossAS-4.0.3 SP1
    • Naming
    • 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 =

      {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 }

      Attachments

        Activity

          People

            Unassigned Unassigned
            starksm64 Scott Stark (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: