2 Replies Latest reply on Oct 24, 2003 3:23 PM by senthilcool

    StreamCorruptedException while doing a HAJNDI lookup

    senthilcool Newbie

      Hi,

      I am getting the following StreamCorruptedException while doing a HAJNDI (port 1100) lookup from the client. It works fine if I use the normal JNDI (port 1099).

      15:54:59,531 WARN [NamingContext] Failed to connect to localhost:1100
      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:209)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1181)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at com.radvault.provisioning.party.ProvisioningTests1.setUp(ProvisioningTests1.java:41)
      at com.radvault.provisioning.party.ProvisioningTests1.main(ProvisioningTests1.java:29)
      Caused by: java.io.StreamCorruptedException: unexpected block data
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1288)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
      at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:199)
      ... 6 more

      My lookup code is as follows :
      Properties props = new Properties();
      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      props.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
      props.put(Context.PROVIDER_URL, "localhost:1100");
      Context jndi = new InitialContext(props);
      Object obj = jndi.lookup("ejb_ProvisioningFacade");
      provisioningFacadeHome = (IProvisioningFacadeHome) PortableRemoteObject.narrow(obj, IProvisioningFacadeHome.class);

      Following is the server log :
      16:01:08,031 INFO [HANamingService] Starting
      16:01:08,109 INFO [HANamingService] Listening on 0.0.0.0/0.0.0.0:1100
      16:01:08,109 INFO [HANamingService$AutomaticDiscovery] Listening on /0.0.0.0:1102, group=230.0.0.4
      16:01:08,125 INFO [HANamingService] Started

      I have made sure that I am using the correct jar files at the client end.

      This happens in both 3.2.1 and 3.2.2 running the "all" configuration.

      Thanks for the help.

      cheers,
      senthil