2 Replies Latest reply on Mar 13, 2002 1:40 PM by Darryl Thompson

    JBOSS 3 - local interface - servlet - ejb not bound

    Miguel Newbie

      Hi jbosses,

      I'm trying out XDOCLET with JBOSS 3. It is like a dream how XDOCLET generates the whole "redundant" stuff.

      However, I experienced some turbulence running my servlet trying

      ...

      Context initial = new InitialContext();
      Object objref = iniitial.lookup("java:comp/env/ejb/RecordManagement");
      RecordManagementLocalHome recordManagementLocalHome = (RecordManagementLocalHome) objref;

      ...

      in my servlet's init method. I always get an "ejb not bound" naming exception.


      web.xml entries look like this

      ...

      <ejb-local-ref>
      <ejb-ref-name>ejb/RecordManagement</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <local-home>es.foo.control.RecordManagementLocalHome</local-home>
      es.foo.control.RecordManagementLocal
      <ejb-link>RecordManagement</ejb-link>
      </ejb-local-ref>

      ...

      jboss-web.xml is empty (as mentioned in tutorial "Internal EJB reference"
      http://www.jboss.org/online-manual/HTML/ch07s22.html)

      Could it be that the bundled jetty version does not support local interfaces ?

      The version of jboss3 I use is from cvs, 01/07/02.

      cheers,

      Mige

        • 1. Re: JBOSS 3 - local interface - servlet - ejb not bound
          David S. Arnold Newbie

          This is part of the EAR vs. WAR classloader nastiness, which you'll find many threads on. If you put your beans and webapps into an EAR, you'll be able to do JNDI lookups. If you deploy them separately, you ABSOLUTELY MUST fill in jboss-web.xml.

          Fortunately, this as simple as starting your Bean class off with some XDoclet instructions:
          /**
          * @jboss:ejb-ref-jndi ref-name="MyBean"
          * jndi-name="jnp://localhost/MyBean"
          */

          Your binding problems should go away after that.

          • 2. Re: JBOSS 3 - local interface - servlet - ejb not bound
            Darryl Thompson Newbie

            Hi Miguel,

            Is there a tutorial somewhere that shows how to create JBoss-web.xml file using xdoclet? I am using JBuilder 6 and a nifty plug-in from Inprise Code Central that generates my jboss.xml and jaws.xml files for me, it also allows us to create the config info via a UI that displays within JB6 just like for Weblogic. My organization "Allegiance Telecom Inc" has made the commitment to replace 16 Weblogic servers with JBoss 2.4.44/Tomcat4.0.1, we will even use it in production (removing another 8 cpu licenses) for all apps but one (which will be the last to go after we are sure of success). This has been a major coup for us and all the folks at JBoss, soon we will have another success story for Marc F.