4 Replies Latest reply on Jun 16, 2004 12:31 AM by sheepdog

    Rank beginner trying to get anything working ...

    sheepdog

      I am working through the JBoss 3.0 Quick Start Guide simply attempting to compile and run the JBoss provided template application. After many adjustments it does compile without errors. However, when I run the client I get the error

      javax.naming.NameNotFoundException: ejb not bound
      on the line
      TestSessionHome lHome = (TestSessionHome) lContext.lookup( "ejb/test/TestSession" );
      The generated TestSession seems correct:
      public interface TestSessionHome
       extends javax.ejb.EJBHome
      {
       public static final String COMP_NAME="java:comp/env/ejb/test/TestSession";
       public static final String JNDI_NAME="ejb/test/TestSession";
      
       public test.interfaces.TestSession create()
       throws javax.ejb.CreateException,java.rmi.RemoteException;
      
      }
      and here is the jboss-web.xml file:
      <ejb-ref>
       <ejb-ref-name>ejb/webtest/TestSession</ejb-ref-name>
       <jndi-name>ejb/test/TestSession</jndi-name>
       </ejb-ref>
      
      If I do a
      NamingEnumeration ne = lContext.listBindings("");
      just after initializing the context and list out each item I don't see any "ejb" anywhere.

      I'm out of ideas and about to try Websphere instead. Anyone have any suggestions I might try first? Thanks.

        • 1. Re: Rank beginner trying to get anything working ...
          pumuckel

          Have you specified a jndi.properties filr for the client.

          java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
          java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
          java.naming.provider.url=localhost
          


          this file must be on the classpath when starting up the client

          • 2. Re: Rank beginner trying to get anything working ...
            sheepdog

             

            "pumuckel" wrote:
            this file must be on the classpath when starting up the client

            It was not in the classpath. Seems strange to put a "properties" file in the classpath. Anyway the standard JBoss template has this file in 2 places, /etc and /build/bin. I put the one in /build/bin into the classpath since that one specified the port 1099, and ran the client. The error was the same, no change. I'm certain it was in the classpath since the classpath is printed out by the client. Other ideas?

            • 3. Re: Rank beginner trying to get anything working ...
              perty

              I have bumped into the same problem, beginner as I am.

              However, I decided to follow the "listBindings" path. What surprised me was that the bean was not found under any "ejb" context. There was no ejb, at all.

              Instead the bean was found directly under its name.
              Thus:
              Object ref = context.lookup("java:/comp/env/ejb/Fibo");
              did not work, but
              Object ref = context.lookup("Fibo");
              did.

              :-)

              • 4. Re: Rank beginner trying to get anything working ...
                sheepdog

                 

                "perty" wrote:
                Object ref = context.lookup("Fibo"); did.
                Tried
                TestSessionHome lHome = (TestSessionHome) lContext.lookup( "ejb/test/TestSession" );
                and
                TestSessionHome lHome = (TestSessionHome) lContext.lookup( "java:ejb/test/TestSession" );
                and
                TestSessionHome lHome = (TestSessionHome) lContext.lookup( "TestSession" );
                without success. Same error each time, either saying ejb not found or TestSession not found.