2 Replies Latest reply on Feb 10, 2002 7:17 PM by IPOz

    Why cannot i lookup the session bean?

    IPOz Newbie

      I am sure the session bean has been deployed successfully by using JNDIView:
      Global JNDI Namespace
      +- invokers (class: org.jnp.interfaces.NamingContext)
      | +- ejb (class: org.jnp.interfaces.NamingContext)
      | | +- Coffees (class: org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker)
      +- ejb (class: org.jnp.interfaces.NamingContext)
      | +- Coffees (proxy: $Proxy2 implements com.zsoft.coffee.interfaces.CoffeesHome)
      However it always reports "javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundException: org.jboss.ejb.plugins.jrmp13.interfaces.HomeProxy
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)" when executing lookup.
      The code snippet is as below:
      Properties h = new Properties();
      h.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory" );
      InitialContext ctx = new InitialContext(h);
      System.out.println("got context");

      CoffeesHome home =
      (CoffeesHome) ctx.lookup("ejb/Coffees"); <===raise error here

      Coffees sessionBean = home.create();
      System.out.println("got remote interface");
      Maybe i lose some jar files but what is that? i have added all jar in $(jboss.home)/client directory to the classpath.

      Any suggestion is appreciated!

        • 1. Re: Why cannot i lookup the session bean?
          Adrian Brock Master

          This class should be in jboss-client.jar

          Perhaps you can explain your classpath/classloader config?
          Which version are you using?


          • 2. Re: Why cannot i lookup the session bean?
            IPOz Newbie

            Thanks for your reply.I used a shell script as below to run the test client:



            java -Djava.security.policy=client.policy -Djava.security.manager -classpath ../build/classes:$CP junit.textui.TestRunner com.zsoft.coffee.test.CoffeesClient
            So the jboss-client is not in the classpath. When adding it,it works now :)

            Thank you very much!