3 Replies Latest reply on Aug 26, 2006 8:01 PM by a.rubalcaba

    ejb not bound?

    ianfmc

      I'm new to Entity Beans, so I apologize if this is really simple.

      I'm having somet trouble getting a reference to my Entity Bean from my Session bean. When I look at the deployment log, I can see that the Entity bean (called Player) is bound to 'ejb/Player' but when I run, I get an exception: "ejb not bound."

      I used the "listBindings" method of the InitialContext to show the bindings in the "java:/comp/env" and sure enough there is no ejb.

      What is the best way to troubleshoot JNDI?

      Thank you in advance!

        • 1. Re: ejb not bound?
          a.rubalcaba

          Can you please post the code that you use to get the lookup on the object?

          • 2. Re: ejb not bound?
            ianfmc

            Hi: I had been using

            context.lookup("java:comp/env/ejb/Player");

            but changed it to

            context.lookup("ejb/Player");

            --> This worked...I guess remote objects can look at the java:comp subcontext?

            • 3. Re: ejb not bound?
              a.rubalcaba

              I know I had the similar problem and I ended up going with the following piece of code and it worked for me.

              Context ctx = new InitialContext();
              Object o = ctx.lookup("java:comp/env/HelloWorld");