4 Replies Latest reply on Sep 13, 2004 10:28 AM by Tilman Rossmy

    Caching of SLSB Proxies and Problems while lookup

    Wolf-Christian Herold Newbie

      Hi
      I'm using JBoss 3.2.3 with SLSB in a Cluster SLSB are Called rom a seperate Tomcat machin (we do not use internal Tomcat).
      For increasing performance, we cache Home and Remote Proxies in custom classes using RountRobin.
      When restarting JBoss, we get in many cases (not always) Problems looking up for JBoss from Tomcat. When getting anny Exception while calling out working-classes we do reload the Homeinterface and recreate the Bean (Romote Proxy). while this could be happen dureng reboot we will wait for some seconds and retry for a couple of times.
      In most cases I'll get NamingException (RemoteException: Service unavailable at org.jboss.ha.framework.interfaces.HARMIClient.invokeRemote(HARMIClient.java:158).
      In most cases I can get a Home after some retries (3-10).
      In some rare cases I did not.
      I found there msut be a dependeciy to jnp-client.jar or jnet.jar.
      I copied thes jars to Tomcat context and restarted the context.
      Then lookups succeed. (when jnp and jnet in shared I had to restart Tomcat)


      Before I had a second problem which was fixed (as far I could see):
      I did not set jboss.bin.address so all services were listening on 0.0.0.0.
      Then I got the first time after restart of Jboss the following error:
      error marshalling arguments; nested exception is:
      java.net.SocketException: Broken pipe

      After binding al services to specific IP this was gone.


      So how should I call SLSB from client?
      Should I cache Proxies or should I recreate the bean each call ?
      As far as I understood from docs, I should not recreate bean each call when using RoundRobin.

      So, why does the lookup failed in some cases although these objects were bound to JNDI?

      Any hints?

      regards Christian

      my config is:
      JBoss 3.2.3 on Linux 2.4 JDK 1.4.2


      MY_Partition
      ...
      <UDP mcast_addr="228.1.1.1" mcast_port="45511"
      ip_ttl="4" ip_mcast="true"
      ....

      MY_Partition
      ${jboss.bind.address}
      1102
      1100
      230.0.0.1
      1102
      ...

      1144
      ${jboss.bind.address}


      and on client:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      jnp.socketFactory=org.jnp.interfaces.TimedSocketFactory
      jnp.timeout=2000
      jnp.sotimeout=2000
      jnp.partitionName=MY_Partition
      jnp.discoveryPort=1102
      jnp.discoveryTimeout=4000
      jnp.discoveryGroup=230.0.0.1

      ERROR:
      javax.naming.CommunicationException [Root exception is java.rmi.RemoteException: Service unavailable.]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:647)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)

      Caused by: java.rmi.RemoteException: Service unavailable.
      at org.jboss.ha.framework.interfaces.HARMIClient.invokeRemote(HARMIClient.java:158)
      at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:196)
      at $Proxy33.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)





        • 1. additional Info to Caching of SLSB Proxies and Problems whil
          Wolf-Christian Herold Newbie

          Hi again

          still working on the same problem...

          I recognized that I still get errors when trying to lookup home after restart of jboss from extern tomcat. I 'm running two jboss, one is located on the same mashine as my tomcat server.
          It seems jboss-client-classes also tries to lookup on localhost even if the
          jnp.discoveryGroup does not fit (but the PartititionName).

          So when trying to lookup from remote tomcat I get this error. sometimes 8 times before the client classes succeed in getting home from JNDI.

          javax.naming.CommunicationException [Root exception is java.rmi.MarshalException: error marshalling arguments; nested exception is:
          java.net.SocketException: Broken pipe]
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:647)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
          at javax.naming.InitialContext.lookup(InitialContext.java:347)
          ..
          Caused by: java.rmi.MarshalException: error marshalling arguments; nested exception is:
          java.net.SocketException: Broken pipe
          at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129)
          at org.jboss.ha.framework.server.HARMIServerImpl_Stub.invoke(Unknown Source)
          at org.jboss.ha.framework.interfaces.HARMIClient.invokeRemote(HARMIClient.java:127)
          at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:196)
          at $Proxy49.lookup(Unknown Source)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
          ... 47 more
          Caused by: java.net.SocketException: Broken pipe
          at java.net.SocketOutputStream.socketWrite0(Native Method)
          at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
          at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
          at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
          at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105)
          at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1639)
          at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1548)
          at java.io.ObjectOutputStream.writeNonProxyDesc(ObjectOutputStream.java:1146)
          at java.io.ObjectOutputStream.writeClassDesc(ObjectOutputStream.java:1100)
          at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1241)
          at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
          at java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1355)
          at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:281)
          at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:265)
          at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:124)

          • 2. Re: Caching of SLSB Proxies and Problems while lookup
            Tilman Rossmy Newbie

            Any progress on this topic, since I have the same problem...

            • 3. Re: Caching of SLSB Proxies and Problems while lookup
              Wolf-Christian Herold Newbie

              Hi

              I'dont remember where, but I found some hint about a solution:
              It seems some weak reference are hold inside the JNDI classes and not freed when geting an Exception on stale objects.

              So call the System GC (System.gc()) and get rid of them.

              In my case it works fine, even if not yet so beatiful :-)

              best regards