users@glassfish.java.net

Re: Moving from annotations to deployment descriptor - I'm desparate

From: <glassfish_at_javadesktop.org>
Date: Mon, 21 Apr 2008 20:10:47 PDT

After much trial and error, I found that the following appears to work.

ejb-jar.xml:
<javaee:ejb-jar>
        <javaee:enterprise-beans>
                <javaee:session>
                        <javaee:ejb-name>NoteDAOBean</javaee:ejb-name>
                        <javaee:business-local>edu.msu.cse891.notes.NoteDAO</javaee:business-local>
                        <javaee:ejb-class>edu.msu.cse891.notes.NoteDAOBean</javaee:ejb-class>
                        <javaee:session-type>Stateless</javaee:session-type>
                </javaee:session>
        </javaee:enterprise-beans>
</javaee:ejb-jar>

web.xml:
<web-app>
  <display-name>notes-web</display-name>
  <ejb-local-ref>
          <ejb-ref-name>NoteDAOBean</ejb-ref-name>
          <ejb-ref-type>Session</ejb-ref-type>
          <local>edu.msu.cse891.notes.NoteDAO</local>
  </ejb-local-ref>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

That's all it took. Note that in the annotation-based configuration I started with the SLSB was being accessed through a @Remote interface, whereas here I've made it local instead (as it should have been no doubt).

But various documents I came across led me to believe I'd need <ejb-link> when referencing a local session bean in an EJB module from a web module in the same EAR. What gives?

I've also seen examples that use <local-home/>. What does that mean? And why does deployment fail if I use <local> instead of <business-local> in ejb-jar.xml?

-Matt
[Message sent by forum member 'matt_mcgill' (matt_mcgill)]

http://forums.java.net/jive/thread.jspa?messageID=270505