2 Replies Latest reply on Aug 5, 2003 1:19 AM by Peter Korsten

    How to configure ejb-local-ref in web.zml/jboss-web.xml?

    Peter Korsten Newbie

      Hi,

      I have a small problem, which is more cosmetic than anything else. On my JBoss 3.2.1/Tomcat 4.1.24 installation, I tried to configure an EJB reference to another JBoss server, and was ultimately successful. I'm including the excerpts of the files, in the hope that they may be useful for others.


      web.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app
       PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
       "http://java.sun.com/dtd/web-app_2_3.dtd">
      
      <web-app>
       ...
      
       <ejb-ref>
       <description>The reference to the directory service's Enterprise JavaBean</description>
       <ejb-ref-name>ejb/directory/DirectoryBean</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <home>vodafonemalta.directory.ejb.DirectoryHome</home>
       <remote>vodafonemalta.directory.ejb.Directory</remote>
       </ejb-ref>
      </web-app>
      


      jboss-web.xml:
      <?xml version="1.0"?>
      <!DOCTYPE jboss-web
       PUBLIC "-//JBoss//DTD Web Application 2.3//EN"
       "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
      
      <jboss-web>
       ...
      
       <ejb-ref>
       <ejb-ref-name>ejb/directory/DirectoryBean</ejb-ref-name>
       <jndi-name>jnp://192.168.4.51:1099/ejb/directory/DirectoryBean</jndi-name>
       </ejb-ref>
      </jboss-web>
      


      This works well. Now, I want to do the same with a local EJB reference, but despite my best attempts I keep getting NullPointerExceptions, or advice that I should add a valid <ejb-link> tag, etc. I can connect to the local EJB by specifying its JNDI name directly in the InitialContext.lookup() call, but that solution I find a bit unclean, so to say.

      So my question is, could anyone describe briefly how to do something similar to the above for local EJB references?

      Thanks!

      - Peter