4 Replies Latest reply on Apr 19, 2006 4:56 PM by vitarara

    EJB2 and EJB3 in one ear

      Hello,

      I want to know if it is possible to have in one ear :
      1 EJB2 module
      1 EJB3 module
      ?

      I try to deploy an ear with 1 ejb2 module on my JBoss 4.0.4RC1 and it deploys EJB2 module with EJB3 deployer ...

      How can I say that it's an EJB2 module ?

      Thanks !

        • 1. Re: EJB2 and EJB3 in one ear
          bdecoste

          Yes, you can deploy an EJB2.x .jar and a EJB3.0 .jar in the same .ear. The EJB3 deployer is triggered by a list of conditions:

          The existence of a persistence.xml file
          The existence of a jboss.xml file with no ejb-jar.xml file
          The existence of annotated classes
          The existence of a 3.0 version ejb-jar.xml

          • 2. Re: EJB2 and EJB3 in one ear

            Thanks a lot ;)

            • 3. Re: EJB2 and EJB3 in one ear
              vitarara

               

              "bdecoste" wrote:
              Yes, you can deploy an EJB2.x .jar and a EJB3.0 .jar in the same .ear. The EJB3 deployer is triggered by a list of conditions:

              The existence of a persistence.xml file
              The existence of a jboss.xml file with no ejb-jar.xml file
              The existence of annotated classes
              The existence of a 3.0 version ejb-jar.xml


              Can the EJB2 and the EJB3 module be in the same ejb-jar file?

              Thanks,

              Mark

              • 4. Re: EJB2 and EJB3 in one ear
                vitarara

                 

                "vitarara" wrote:
                Can the EJB2 and the EJB3 module be in the same ejb-jar file?


                OK, I did some experimenting and made two ejb-jar files. One with EJB2 modules, and another with EJB3 ones. This deployed and worked properly.

                Obviously the separate jars worked, which would imply that having them in the same jar file isn't supposed to work, but having an authoritative answer would be nice if someone knows.

                Thanks,

                Mark