1 Reply Latest reply on Jan 29, 2006 12:31 PM by lafr

    Can't use <ejb-local-ref> that link to ejb in different ejb-

    beam36

      I use <ejb-local-ref> but it seem to work only with the same ejb-jar.xml file. When Ilink to the one at other file I will get javax.naming.NamingException: Could not dereference object [Root exception is java.lang.NullPointerException]. Does anyone know why?
      Is it because classpath? How to make .jar file can see others?

        • 1. Re: Can't use <ejb-local-ref> that link to ejb in different
          lafr

          No, I think it's a configuration problem, perhaps in conjunction with a not robust jboss progamming.
          To use a local reference to a session bean in another jar file but within the same ear we use this xdoclet tag:

          @ejb.ejb-external-ref view-type="local" ref-name="ejb/MessageSinkLocal"
           type="Session"
           home="biz.mbisoftware.fn.ejb.session.core.MessageSinkLocalHome"
           business="biz.mbisoftware.fn.ejb.session.core.MessageSinkLocal"
           jndi-name="@MBI_DBNAME@/MessageSinkLocal"
          

          This gives us in ejb-jar.xml:
          <ejb-local-ref >
           <ejb-ref-name>ejb/MessageSinkLocal</ejb-ref-name>
           <ejb-ref-type>Session</ejb-ref-type>
           <local-home>
           biz.mbisoftware.fn.ejb.session.core.MessageSinkLocalHome
           </local-home>
           <local>biz.mbisoftware.fn.ejb.session.core.MessageSinkLocal</local>
          </ejb-local-ref>
          

          And in jboss.xml we get:
          <ejb-local-ref>
           <ejb-ref-name>ejb/MessageSinkLocal</ejb-ref-name>
           <local-jndi-name>mbi2e-lafr-sb150-ipc/MessageSinkLocal</local-jndi-name>
          </ejb-local-ref>
          

          This works perfect.