7 Replies Latest reply on Jan 12, 2009 12:58 AM by Mark Bramnik

    Exception while trying to get Stub from JBoss-Cluster

    bo_hari Newbie

      Hello,

      we´re porting an application which worked on one single JBoss without any problems. Actually we configured a Cluster with 2 nodes via a multicast-address. When we do a ping to the multicast-ip theese both nodes answers fine (and only theese two nodes)

      Our JNDI-Lookup looks like this:

      Hashtable props = new Hashtable();
      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      props.put(Context.PROVIDER_URL, "jnp://localhost:1100,jnp://172.17.28.13:1100");
      


      The Client (a Swing Apllication called via Webstart) fails then with the following Exception:


      javax.naming.CommunicationException: Failed to retrieve stub from server localhost:1100 [Root exception is java.io.StreamCorruptedException: unexpected block data]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at de.schlund.bv.server.methadon.sess.bv.BVUtil.getHome(BVUtil.java:48)
      at de.schlund.bv.client.Client.<init>(Client.java:178)
      at de.schlund.bv.client.Client.main(Client.java:328)
      Caused by: java.io.StreamCorruptedException: unexpected block data
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1310)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1909)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1833)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1710)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1296)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1909)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1833)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1710)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1296)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:237)
      ... 7 more


      When i try a call via telnet ( telnet localhost 1100) then i can see that the server respondes with a serializied Object ( probably the needed stub from JBoss) This looks like this:


      telnet localhost 1100
      Trying 127.0.0.1...
      Connected to localhost.
      Escape character is '^]'.
      ?srjava.rmi.MarshalledObject|?>IhashlocBytest[BobjBytesq~xp?<?r[BT?xp>?thttp://madness:8083/q~q~q~q~q~q~q~uq~B?s}
      org.jnp.interfaces.Naming,org.jboss.ha.framework.interfaces.HARMIProxyxrjava.lang.reflect.Proxy???C?Lht%Ljava/lang/reflect/InvocationHandler;
      xpsr-org.jboss.ha.framework.interfaces.HARMIClient??LfamilyClusterInfot5Lorg/jboss/ha/framework/interfaces/FamilyClusterInfo;
      LkeytLjava/lang/String;LloadBalancePolicyt5Lorg/jboss/ha/framework/interfaces/LoadBalancePolicy;xpwDefaultPartition/HAJNDIsrjava.util.ArrayListx??
      Isizexpwsr2org.jboss.ha.framework.server.HARMIServerImpl_Stubxr?java.rmi.server.RemoteStub????xrjava.rmi.server.RemoteObject?
      a3xpw7
      UnicastRef2
      172.17.29.1?xsq~
      w7
      UnicastRef2
      172.17.28.13]?W?xxX1
      sr,org.jboss.ha.framework.interfaces.RoundRobinx.???xpxConnection closed by foreign host.


      The only thing we changed actually is that we entered a clustered=true into our beans and that we changed our server conf to the default "all" configuration where we added our multicast-address

      We don´t need any cluster-services for Tomcat so we left all the needed files in original

      Any help is appreciated

      Regards

      Achim