2 Replies Latest reply on Aug 18, 2010 8:45 AM by James Bragg

    Is it possible to Build a EJB3 "jar" project using Seam?

    James Bragg Newbie

      The architecture of the SuD (System under discussion), separating various components of the system based on there objective. We have are web projects deployed on one sets servers and our business layer projects deployed on another set of servers. We will be implementing the business layer projects as EJB3 and as a Web Service (@WebService). We are attempting to us seam but are finding that nearly every reference/example has the projects setup as an EAR file.  Is it not possible to implement Seam in a EJB3 as a JAR Project?


      I have built the JAR Project added
      - seam.properies (empty)
      - META-INF (folder)
         - components.xml
         - ejb-jar.xml (included enterprise-beans/interceptors/assembly-descriptor as described for seam)
         - standard-jaxws-endpoint-config.xml



      On Deployment receiving:



      DEPLOYMENTS MISSING DEPENDENCIES:
        Deployment "jboss.j2ee:ear=UserAuthServices.jar,jar=jboss-seam-2.2.1.CR1.jar,name=EjbSynchronizations,service=EJB3_endpoint" is missing the following dependencies:
          Dependency "jboss.j2ee:ear=UserAuthServices.jar,jar=jboss-seam-2.2.1.CR1.jar,name=EjbSynchronizations,service=EJB3" (should be in state "Configured", but is actually in state "** NOT FOUND Depends on 'jboss.j2ee:ear=UserAuthServices.jar,jar=jboss-seam-2.2.1.CR1.jar,name=EjbSynchronizations,service=EJB3' **")
        Deployment "jboss.j2ee:ear=UserAuthServices.jar,jar=jboss-seam-2.2.1.CR1.jar,name=TimerServiceDispatcher,service=EJB3_endpoint" is missing the following dependencies:
          Dependency "jboss.j2ee:ear=UserAuthServices.jar,jar=jboss-seam-2.2.1.CR1.jar,name=TimerServiceDispatcher,service=EJB3" (should be in state "Configured", but is actually in state "** NOT FOUND Depends on 'jboss.j2ee:ear=UserAuthServices.jar,jar=jboss-seam-2.2.1.CR1.jar,name=TimerServiceDispatcher,service=EJB3' **")

      DEPLOYMENTS IN ERROR:
        Deployment "jboss.j2ee:ear=UserAuthServices.jar,jar=jboss-seam-2.2.1.CR1.jar,name=EjbSynchronizations,service=EJB3" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.j2ee:ear=UserAuthServices.jar,jar=jboss-seam-2.2.1.CR1.jar,name=EjbSynchronizations,service=EJB3' **
        Deployment "jboss.j2ee:ear=UserAuthServices.jar,jar=jboss-seam-2.2.1.CR1.jar,name=TimerServiceDispatcher,service=EJB3" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.j2ee:ear=UserAuthServices.jar,jar=jboss-seam-2.2.1.CR1.jar,name=TimerServiceDispatcher,service=EJB3' **



      I am about to pull back the wsdl and generate the client; however, during testing I am receiving:
      ...
      10-08-17 11:06:22,730 ERROR [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] (http-127.0.0.1-8080-1) Exception during handler processing
      java.lang.NullPointerException
              at org.jboss.seam.servlet.ServletApplicationMap.get(ServletApplicationMap.java:54)
              at org.jboss.seam.contexts.BasicContext.get(BasicContext.java:49)
              at org.jboss.seam.Component.forName(Component.java:1947)
              at org.jboss.seam.Component.getInstance(Component.java:2005)
      ...


      Any help would be appreciated.


      James..


      PS: Running JBoss 5.x, Seam 2.2.1.CR1, Java 6.x

        • 1. Re: Is it possible to Build a EJB3 "jar" project using Seam?
          Leo van den berg Master

          Hi,


          I am working with a separate EJB3 jar, but only for testing purposes under jboss 5.1. The only difference is that Seam needs a EAR-name prefix in the EAR-packed application. I basically create a testserver and dump all dependencies in the server/default/lib directory ( with the exception of jboss-seam.jar, which resides in the deploy directory). Everything works, but at the end everything is packed in an EAR-file.


          Leo

          • 2. Re: Is it possible to Build a EJB3 "jar" project using Seam?
            James Bragg Newbie

            So at a bare minimum to support EJB3 and Seam, it sounds like I will have to create an EAR project to wrap the EJB jar project. I was really hoping to be able to deliver the project; as a simple jar without the over head of the EAR.


            Hopefully someone will be able to scale down this requirement to fall more inline with the EJB Spec.


            Thanks for responding, now I need to decide if I really need to implement Seam on my backend business layer, currently we are using Spring for injection and are not using persistence, at least in the current application.


            James..




            If Knowledge is power, then the Understanding of that Knowledge is the true essence of Wisdom. For a man my know something, but that does not mean he understands it.