4 Replies Latest reply on Jan 9, 2008 7:07 PM by pmuir

    Seam POJO application as EAR

    hubaghdadi

      Hi.
      Is it possible to create a Seam application that employs POJOs (no EJB3 session beans and entities) and packaged as EAR?
      Thanks.

        • 1. Re: Seam POJO application as EAR
          nickarls

          Well, seam-gen supports the war layout and then you just have to prevent yourself from adding @Stateless etc annotations on your entities.

          • 2. Re: Seam POJO application as EAR
            hubaghdadi

            If I want to package my POJO application as EAR, I have to annotate JavaBeans with @Stateless or other annotations (for example) just like EJB beans?

            • 3. Re: Seam POJO application as EAR
              nickarls

               

              "hubaghdadi" wrote:
              If I want to package my POJO application as EAR, I have to annotate JavaBeans with @Stateless or other annotations (for example) just like EJB beans?


              Well, if you start with a seam-gen generated WAR you get the build scripts of a WAR. Adding annotations won't automagically turn them into EAR (different build). WAR -> EAR conversion can probably be done later by starting a new EAR based project and do some copy&pasting. An EAR is essentially one or more WAR:s, EJB JARs etc wrapped into a single archive.

              • 4. Re: Seam POJO application as EAR
                pmuir

                 

                "hubaghdadi" wrote:
                Hi.
                Is it possible to create a Seam application that employs POJOs (no EJB3 session beans and entities) and packaged as EAR?
                Thanks.


                Yes, of course, don't annotate as EJBs, use hbm.xml rather than JPA, don't register jboss-seam.jar as an ejb module, use hibernate transaction sync. But why?

                If I want to package my POJO application as EAR, I have to annotate JavaBeans with @Stateless or other annotations (for example) just like EJB beans?


                No, of course not.