2 Replies Latest reply on Aug 1, 2008 4:53 PM by wolfc

    EJB3 inside a WAR

    lucdew

      Hi,

      i am new to EJB3 and i would like to know if JBoss AS 4.2.X supports packaging of an EJB3 inside a War file.

      I annotated an interface and its implementation with respectively @Remote and @Stateless annotations and packaged the classes in a jar file. The jar file is in turn packaged in the WEB-INF/lib directory of my WAR file.

      I deployed the war file but the session stateless EJB does not seem to be discoverd at deployment time. So is it possible to package an EJB3 in a war file ? Are there any requirements for this ? Do i have to declare them in the jboss-web.xml or create an ejb-jar.xml file ?

      Thanks for your help,
      Luc

        • 1. Re: EJB3 inside a WAR
          peterj

          EJBs cannot be packaged in WAR files. You need to either place the JAR with the EJBs into the deoply directory, or better yet, package the EJB JAR and the WAR into an EAR (after all, that is what EAR archives are for).

          • 2. Re: EJB3 inside a WAR
            wolfc

            This is not possible in AS 4.

            In AS 5 you can enable scanning of wars by setting the 'scanWars' property to true in ejb3.deployer/META-INF/ejb3-deployers-jboss-beans.xml (ejb3-deployers-beans.xml for CR1).