Caching of SLSB Proxies and Problems while lookup
cherold Mar 29, 2004 7:39 AMHi
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)