4 Replies Latest reply on Mar 15, 2009 11:41 PM by Pete Muir

    EJB references in web.xml and ejb-jar.xml

    Rafal Hajdacki Newbie

      Due to Java EE 5 spec requirements usage of SEAM is very complicated on JavaEE 5 certified servers like JBoss 5, GlassFish etc. For each EJB/SEAM component that you want use in other EJB/SEAM component or WAR you need to add EJB reference in ejb-jar.xml or web.xml like described in SEAM documentation:


      Integrating Seam with your EJB container


      This is very tedious and cumbersome. I consider it to be MAJOR problem for developing applications in SEAM.
      How this problem looks like in WebBeans? Is it somehow solved in Java EE 6 / WebBeans?
      Does global JNDI feature in EJB 3.1 help solve this problem?


      Regards,
      Rafal

        • 1. Re: EJB references in web.xml and ejb-jar.xml
          Pete Muir Master

          Rafal Hajdacki wrote on Mar 09, 2009 11:18:


          Due to Java EE 5 spec requirements usage of SEAM is very complicated on JavaEE 5 certified servers like JBoss 5, GlassFish etc. For each EJB/SEAM component that you want use in other EJB/SEAM component or WAR you need to add EJB reference in ejb-jar.xml or web.xml like described in SEAM documentation:

          Integrating Seam with your EJB container



          Certainly not the case on JBoss 5 - no need to add anything to your web.xml!


          This is very tedious and cumbersome. I consider it to be MAJOR problem for developing applications in SEAM.
          How this problem looks like in WebBeans? Is it somehow solved in Java EE 6 / WebBeans?
          Does global JNDI feature in EJB 3.1 help solve this problem?


          Yes, WebBeams solves this using an SPI the underling container must implement to resolve EJBs. A possible implementation of this is global JNDI lookups. NB in JBoss we don't use global JNDI, nor do the Glassfish guys plan to.

          • 2. Re: EJB references in web.xml and ejb-jar.xml
            Pete Muir Master

            But really this is a vendor specific decision, the spec makes no call either way. We certainly won't need it on JBoss, (and I think not on Glassfish) - I would recommend that other vendors don't require it either.

            • 3. Re: EJB references in web.xml and ejb-jar.xml
              Rafal Hajdacki Newbie

              Certainly not the case on JBoss 5 - no need to add anything to your web.xml!


              In web.xml not. But in ejb-jar.xml (which is even more problematic case than web.xml) sure you need too. It is even mentioned in SEAM docs:



              Unlike with the web context, however, you cannot declare EJB references globally for all EJB components. Instead, you have to specify the JNDI resources for a given EJB component one-by-one (this applies to JBoss AS 5 in addition to non-JBoss application servers).


              Yes, WebBeams solves this using an SPI the underling container must implement to resolve EJBs. A possible implementation of this is global JNDI lookups. NB in JBoss we don't use global JNDI, nor do the Glassfish guys plan to.


              Ok, it is great that for WebBeans it will be solved on SPI level and in such a case no global JNDI lookups are needed. As I understand for SEAM 2.x based apps there will be no other way than declaring these references.

              • 4. Re: EJB references in web.xml and ejb-jar.xml
                Pete Muir Master

                Rafal Hajdacki wrote on Mar 15, 2009 21:14:



                Certainly not the case on JBoss 5 - no need to add anything to your web.xml!


                In web.xml not. But in ejb-jar.xml (which is even more problematic case than web.xml) sure you need too. It is even mentioned in SEAM docs:

                Unlike with the web context, however, you cannot declare EJB references globally for all EJB components. Instead, you have to specify the JNDI resources for a given EJB component one-by-one (this applies to JBoss AS 5 in addition to non-JBoss application servers).



                This is total crap (pardon my language) - I've fixed the Seam docs to not say this.




                Yes, WebBeams solves this using an SPI the underling container must implement to resolve EJBs. A possible implementation of this is global JNDI lookups. NB in JBoss we don't use global JNDI, nor do the Glassfish guys plan to.


                Ok, it is great that for WebBeans it will be solved on SPI level and in such a case no global JNDI lookups are needed. As I understand for SEAM 2.x based apps there will be no other way than declaring these references.


                As I said this does work on JBoss 5 or 4.2 with Seam 2 :-)