1 Reply Latest reply on Apr 18, 2002 7:47 PM by Yasir Khokhar

    jsp + ejb local + apache  problem--please help

    Yasir Khokhar Newbie

      Please help.

      I've spent two days trying to get a JSP Page to access a local interface for an EJB. im using Jboss2.4.4. Catalina 4.x and apache 1.3

      I have an EAR file , the ear file has a .jar file with the EJB's and a WAR file with the servlets.

      the ejb-jar.xml file in the EJB's JAR has:

      .....
      <ejb-local-ref>
      <ejb-ref-name>PageServiceLocal</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <local-home>salsa.twist.entitys.page.PageServiceLocalHome</local-home>
      salsa.twist.entitys.page.PageServiceLocal
      <ejb-link>PageService</ejb-link>
      </ejb-local-ref>
      .....

      the web.xml file in the WAR package has:

      <ejb-local-ref>
      <ejb-ref-name>PageServiceLocal</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <local-home>salsa.twist.entitys.page.PageServiceLocalHome</local-home>
      salsa.twist.entitys.page.PageServiceLocal
      <ejb-link>PageService</ejb-link>
      </ejb-local-ref>

      (same as the ejb-jar)

      I've tried adding a <local-jndi-name> in the jboss.xml file as well as the jboss-web.xml file. and i am unable to lookup the entity.

      Jboss .xml looks like:



      <enterprise-beans>

      <ejb-name>PageService</ejb-name>
      <local-jndi-name>PageServiceLocal</local-jndi-name>

      </enterprise-beans>


      jboss-web.xml looks like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-web>
      <!-- A reference to an EJB in the same server with a custom JNDI binding -->
      <ejb-local-ref>
      <ejb-ref-name>PageServiceLocal</ejb-ref-name>
      <local-jndi-name>PageServiceLocal</local-jndi-name>
      </ejb-local-ref>
      </jboss-web>





      i've tried looking up with java:comp/env/PageServiceLocal , java:comp/PageServicLocal and ALL combinations of env/local , env/ejb/local with and without the java:comp preceeding it.

      After 48 hours of being unable to access all this and not finding anything useful in the forums, i tried to configure Jboss3......dont ask what happened then. Any help on this issue would be greatly appreciated. Actual code from source that works would be divine.

        • 1. Re:  jsp + ejb local + apache  problem--please help
          Yasir Khokhar Newbie

          Many thanks to Dimitri Colebatch for his help for solving this one.

          All i had to do was lookup the JNDIViewer accessible from http://localhost:8082/ and list the JNDI bindings , once the bindings showed up, it was a matter of looking thru them and finding tha the ejb is bound under local/PageService and NOT under PageServiceLocal. the problem is solved, but is strange that the ejb deployement descriptor above specifies a xxxLocal , is not being bound.

          (incase you dont get the JNDIViewer service, look up the docs under HOW_TO) and you'll find it there. If you are using jboss3+ you'll need to put the mbean code under and place it in the deploy directory with JNDIviewer-service.xml as its name. )