5 Replies Latest reply on Jul 14, 2005 2:46 PM by adrian.brock

    ejb not bound

    manishpathak25

      Hello All,

      As the topic suggests, nothing new in the topic - already lots of post with this, and I have read many of them before posting this.

      I have an EJB deployed on JBoss 3.2.3 and at the end of deployment, I get the following:

      ****
      2004-06-14 18:56:03,211 INFO [org.jboss.ejb.EjbModule] Deploying HelloWorldServer
      2004-06-14 18:56:03,352 INFO [org.jboss.ejb.plugins.StatelessSessionInstancePool] Started jboss.j2ee:jndiName=HelloWorldServer,plugin=pool,service=EJB
      2004-06-14 18:56:03,352 INFO [org.jboss.ejb.StatelessSessionContainer] Started jboss.j2ee:jndiName=HelloWorldServer,service=EJB
      2004-06-14 18:56:03,352 INFO [org.jboss.ejb.EjbModule] Started jboss.j2ee:module=HelloServer.jar,service=EjbModule
      2004-06-14 18:56:03,352 INFO [org.jboss.ejb.EJBDeployer] Deployed: file:/C:/jboss-3.2.3/server/default/deploy/HelloServer.jar
      2004-06-14 18:56:03,399 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/jboss-3.2.3/server/default/deploy/HelloServer.jar
      ****

      My enterprise bean tag within ejb-jar.xml is:

      ****
      <enterprise-beans>
      <!-- Session Beans -->

      helloWorld Session bean example.
      <display-name>HelloWorldServerDisplayName</display-name>
      <ejb-name>HelloWorldServer</ejb-name> <!--Matches with Jboss.xml -->
      org.berttorfs.tutorialserver.HelloServerHome
      org.berttorfs.tutorialserver.HelloServer
      <ejb-class>org.berttorfs.tutorialserver.HelloServerBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      </enterprise-beans>
      ****

      And my jboss.xml is :

      ****
      <enterprise-beans>

      <ejb-name>HelloWorldServer</ejb-name><!--Matches ejb-jar.xml -->
      <jndi-name>ejb/HelloWorldServer</jndi-name>

      </enterprise-beans>
      ****

      I am calling this in my client as:

      ****

      Properties props = new Properties();
      props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      props.put("java.naming.provider.url", "localhost:1099");
      try
      {
      InitialContext ctx = new InitialContext(props);
      HelloServerHome theHelloHome = (HelloServerHome) ctx.lookup("ejb/HelloWorldServer");
      }
      catch (Exception e)
      {
      System.out.println ("all wrong not working");
      e.printStackTrace();
      }
      ****

      I get an error message if I execute the client as Java Application saying "ejb not bound".

      To check if EJB is registered, I open "http://localhost:8080/jmx-console/index.jsp" and click on "service=JNDIView". In this, I use 'List' and invoke this method. Here, I see entry for my bean as:

      ****
      Ejb Module: HelloServer.jar
      java:comp namespace of the HelloWorldServer bean:
      +- env (class: org.jnp.interfaces.NamingContext)

      ****

      Also, under "jboss.management.local", I see following entry:
      ****
      EJBModule=HelloServer.jar,J2EEApplication=null,J2EEServer=Local,j2eeType=StatelessSessionBean,name=HelloWorldServer
      ****

      All this gives me the impression that bean is deployed correctly. So, why am I still getting ejb not bound?

      Any suggestions would be appreciated.

      Regards,
      Manish


        • 1. Re: ejb not bound
          manishpathak25

          Turned out to be a bright beginning of the day! Searched this forum on 'HelloServer' and saw a post suggesting to try ctx.lookup("HelloWorldServer") in place of ctx.lookup("ejb/HelloWorldServer"). The program worked, but would someone be able to throw some light on why it worked without ejb?

          Regards,
          Manish

          • 2. Re: ejb not bound
            panning

            I have exactly the same problem. Do any topics on these forums end up with a resolution???

            • 3. Re: ejb not bound

              Yes, but not these reposts of FAQs or ME TOOs:
              http://wiki.jboss.org/wiki/Wiki.jsp?page=BadPosts

              • 4. Re: ejb not bound
                darranl

                1 - Use JNDI View in the JMX Console to see what is actually bound.

                2 - Start a new thread with your deployment descriptors and the error you are getting.

                3 - Yes a lot of questions asked end with a happy ending, however due the volume of duplicate questions and questions with insufficient information finding the answers isn't always easy.

                • 5. Re: ejb not bound

                   

                  "darranl" wrote:

                  3 - Yes a lot of questions asked end with a happy ending, however due the volume of duplicate questions and questions with insufficient information finding the answers isn't always easy.


                  And you can thank all the people that didn't use search before dumping their questions
                  in the forums that when you do use search you have to wade through all those unanswered repeat questions. :-(