From: drzewo <nu...@jb...> - 2005-05-12 09:48:22
|
"radhikamehta" wrote : hi! I have a standalone java program which tries to lookup a sessionbean deployed in jboss3.2.0 in a remote machine. | I am using cluster configuration. | My java code snippet is: | | Properties p = new Properties(); | p.put (Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory | "); | p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces"); | p.put(Context.PROVIDER_URL, "xxx.xxx.xxx.xxx:1100"); // HA-JNDI port. | Context ctx = new javax.naming.InitialContext(p); | Object ref = ctx.lookup("abc"); | | My problem is that it gives a communication exception during lookup. | The exception is:: | | | javax.naming.CommunicationException. Root exception is java.rmi.RemoteException | : Service unavailable. | at org.jboss.ha.framework.interfaces.HARMIClient.invokeRemote(HARMIClien | t.java:165) | at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java | :203) | at $Proxy0.lookup(Unknown Source) | at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492) | at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471) | at javax.naming.InitialContext.lookup(InitialContext.java:347) | | Darn, I am getting the very same behaviour. Either I am doing something wrong or the nasty bug hasn't been fixed for quite some time. This happens in jboss 4.0.2. Here is a short description of my config. As I am trying to configure HA JMS with farming I took the following steps: - I bound several IP adresses to one physical interface, namely 10.0.0.1 and 10.0.0.2 - copied the "all" config to "m1" and striped it a bit of unused services. It launches with no problems when invoked with a command "run -c m1 -Djboss.bind.address=10.0.0.1 -Djboss.partition.name=customCluster". JMS is deployed as a singleton. - copied the "m1" to "m2" and launched with a command "run -c m2 -Djboss.bind.address=10.0.0.2 -Djboss.partition.name=customCluster"; m2 joins the cluster - I have written, compiled, configured and packaged a simple MDB. I deployed a jar to the farm directory of m1. The bean gets deployed on both m1 and m2 and both bind to the defined queue. I had to slightly modify hajndi-jms-ds.xml, so that the queue used by the MDB was looked up in the HAJNDI I have set java.naming.provider.url=10.0.0.1:1100 and java.naming.provider.url=10.0.0.2:1100 for m1 and m2 respectively. - Now the client part. It is intended to send messages to the queue but fails during lookup of the queue and the connectionfactory (regardless of which comes first) with the following "javax.naming.CommunicationException. Root exception is java.rmi.RemoteException: Service unavailable" I cannot post the whole stack at the moment, but it looks very similar (the same method invocation path, line numbers might differ, as I use the latest jboss 4.0.2) Now the funny part. When I lunch a single server "m1" or "m2" without specifying jboss.bind.address, the ha-jndi seems to bind to 0.0.0.0:1100 instead of ${jboss.bind.address):1100, and when I changed the client's java.naming.provider.url to localhost:1100, it runs like a charm! I am doing something wrong, arent I? Any ideas, anybody? cheers, /dd View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3877446#3877446 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3877446 |