0 Replies Latest reply on Aug 9, 2002 12:23 PM by Colin Thorburn

    JNDI Lookup problem - A new one!

    Colin Thorburn Newbie

      Hmm. I'm a bit concerned that either I don't understand this problem at all or something
      really nasty has happened.

      I'm simply trying to use my bean's home interface from a client JVM. Listing this BMP
      entity bean ceratinly works OK but looking it up seems to cause some sort of deserialization
      problem. Does anyone have any ideas?


      try{
      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL, "localhost:1099");
      Context ctx = new InitialContext(env);


      NamingEnumeration list = ctx.list("/");

      while (list.hasMore())
      {
      NameClassPair nc = (NameClassPair)list.next();
      System.out.println(nc);
      }

      SupplierHome home=(SupplierHome)PortableRemoteObject.narrow(ctx.lookup("/Supplier"),
      Class.forName("com.ejbbean.SupplierHome"));

      }catch(Exception e){
      e.printStackTrace();
      }



      Supplier: $Proxy8

      javax.naming.CommunicationException. Root exception is java.io.StreamCorruptedException: Type code
      out of range, is 125
      at java.io.ObjectInputStream.peekCode(Compiled Code)
      at java.io.ObjectInputStream.readObject(Compiled Code)
      at java.io.ObjectInputStream.readObject(Compiled Code)
      at java.io.ObjectInputStream.inputObject(Compiled Code)
      at java.io.ObjectInputStream.readObject(Compiled Code)
      at java.io.ObjectInputStream.readObject(Compiled Code)
      at java.rmi.MarshalledObject.get(Compiled Code)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:353)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at com.rmibean.ADb.(Adb.java:98)
      at com.rmibean.ADbImpl.(MatchEngineImpl.java:16)
      at com.rmibean.RemoteFactory.createAdb(RemoteFactory.java:19)
      at com.rmibean.RemoteDriver.main(RemoteDriver.java:14)