0 Replies Latest reply on Sep 16, 2003 12:18 PM by Sanjay

    javax.naming.CommunicationException

    Sanjay Newbie

      Hello All,
      I am invoking Session Bean from a simple java client on the same machine. Its giving me following exception :

      javax.naming.CommunicationException. Root exception is java.io.InvalidClassException: org.jboss.invocation.remoting.RemotingAdapter; unable to create instance

      When I call the same ejb from servlet it works fine. Moreover the client is on the same machine.

      Could you please let me know whats the remedy for the same. Find below my client code:

      **********
      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL,"localhost:1099");
      env.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
      InitialContext ctx = new InitialContext(env);
      Object ref = ctx.lookup("MyBean/mybean");
      System.out.println("got the context");
      MyBeanHome myBeanHome = (MyBeanHome)PortableRemoteObject.narrow(ref, MyBeanHome.class);
      MyBean mybean = (MyBean)myBeanHome.create();

      **********


      Awaiting your response.

      Regds
      Sanjay