2 Replies Latest reply on Nov 23, 2004 7:16 AM by ryoung2504

    Access Stateless Session Bean from Servlet

    ryoung2504

      I've managed to get all the tutorial examples working and I really like what I see.
      As stateless session beans no longer have a home interface (local or remote) then what is the correct syntax for exposing them to a servlet?

      For EJB upto 2.1 looking up a bean using "java:comp/env/ejb/ContentServiceSlEjbLocal" with the following in web.xml worked:-

      <ejb-local-ref >
      <ejb-ref-name>ejb/ContentServiceSlEjbLocal</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <local-home>com.xxx.ejb.ContentServiceSlEjbLocalHome</local-home>
      com.xxx.ejb.ContentServiceSlEjbLocal
      <ejb-link>ContentServiceSlEjb</ejb-link>
      </ejb-local-ref>

      However I just can't seem to be able to get hold of an EJB3 stateless bean from a servlet; Dropping the <local-home> in the web xml causes jBoss to reject the deployment and leaving <ejb-local-ref> out completly gives a name not found exception (as with 2.1).