4 Replies Latest reply on Feb 23, 2012 2:53 AM by ehugonnet Branched to a new discussion.

    Migrating EJB 2.0 on JBoss AS 7.1CR1

    aupadhyaya2002

      Hi,

       

       

      At the moment I am porting EJB 2.0 to JBoss As 7.1 and  having the some issues during deployment. I have attached the below logs.

      java:global/tcc/tcc-ejb/StaticDataController!com.ebrd.tcc.ejb.staticdata.StaticDataControllerLocal
      java:app/tcc-ejb/StaticDataController!com.ebrd.tcc.ejb.staticdata.StaticDataControllerLocal
      java:module/StaticDataController!com.ebrd.tcc.ejb.staticdata.StaticDataControllerLocal
      java:global/tcc/tcc-ejb/StaticDataController!com.ebrd.tcc.ejb.staticdata.StaticDataControllerLocalHome
      java:app/tcc-ejb/StaticDataController!com.ebrd.tcc.ejb.staticdata.StaticDataControllerLocalHome
      java:module/StaticDataController!com.ebrd.tcc.ejb.staticdata.StaticDataControllerLocalHome
      java:global/tcc/tcc-ejb/StaticDataController!com.ebrd.tcc.ejb.staticdata.StaticDataControllerRemote
      java:app/tcc-ejb/StaticDataController!com.ebrd.tcc.ejb.staticdata.StaticDataControllerRemote
      java:module/StaticDataController!com.ebrd.tcc.ejb.staticdata.StaticDataControllerRemote
      java:global/tcc/tcc-ejb/StaticDataController!com.ebrd.tcc.ejb.staticdata.StaticDataControllerHome
      java:app/tcc-ejb/StaticDataController!com.ebrd.tcc.ejb.staticdata.StaticDataControllerHome
      java:module/StaticDataController!com.ebrd.tcc.ejb.staticdata.StaticDataControllerHome

      I have got below entries in jboss.xml

        <session>
         <ejb-name>StaticDataController</ejb-name>
         <jndi-name>com/ebrd/tcc/StaticDataController</jndi-name>
        </session>

      I would like to know whether we can use EJB 2 in JBoss 7.1CR1. I have read some of the similar issues, but not sure whether EJB 2 porting issue in JBoss 1.7 has been addressed.

      Thanks.

        • 1. Re: Migrating EJB 2.0 on JBoss AS 7.1CR1
          jaikiran

          antar Upadhyaya wrote:

           

          I have got below entries in jboss.xml

            <session>
             <ejb-name>StaticDataController</ejb-name>
             <jndi-name>com/ebrd/tcc/StaticDataController</jndi-name>
            </session>

          AS7 no longer supports jboss.xml. You'll need a jboss-ejb3.xml. Furthermore, the jboss-ejb3.xml does not support the jndi-name element to bind to custom JNDI names. Instead, you can use the following approach/trick in ejb-jar.xml to bind to custom JNDI names in the java:global JNDI namespace:

           

          <ejb-jar> <!-- Use the correct dtd/xsd here -->
              <enterprise-beans>
                  <session>
                      <ejb-name>SimpleBean</ejb-name>
                      <home>org.jboss.as.test.integration.ejb.injection.ejbref.HomeInterface</home>
                      <remote>org.jboss.as.test.integration.ejb.injection.ejbref.RemoteInterface</remote>
                      <local-home>org.jboss.as.test.integration.ejb.injection.ejbref.LocalHomeInterface</local-home>
                      <local>org.jboss.as.test.integration.ejb.injection.ejbref.LocalInterface</local>
                      <ejb-class>org.jboss.as.test.integration.ejb.injection.ejbref.SimpleBean</ejb-class>
                      <session-type>Stateless</session-type>
                      <ejb-ref>
                          <ejb-ref-name>java:global/MyCustomJNDIName</ejb-ref-name>
                          <ejb-ref-type>Session</ejb-ref-type>
                          <home>org.jboss.as.test.integration.ejb.injection.ejbref.HomeInterface</home>
                          <remote>org.jboss.as.test.integration.ejb.injection.ejbref.RemoteInterface</remote>
                      </ejb-ref>
          
                  </session>
          ...
          

           

          I haven't given it a try. See if it works for you.

           

           

          antar Upadhyaya wrote:

           

           

           

          I would like to know whether we can use EJB 2 in JBoss 7.1CR1.

          Yes

          • 2. Re: Migrating EJB 2.0 on JBoss AS 7.1CR1
            ehugonnet

            Do we have to migrate the code also ? Or is rewritting the EJB descriptors the 'only' work we have to do ?

            • 3. Re: Migrating EJB 2.0 on JBoss AS 7.1CR1
              jaikiran

              If your application was using spec specified APIs then you don't need any change. However, if your application had any server specific code then it will have to be reviewed in context of AS7.

              • 4. Re: Migrating EJB 2.0 on JBoss AS 7.1CR1
                ehugonnet

                That is fast answer !!

                The code is 'per the specs' as it was running in a least 2 different containers.

                So I need to migrate my jboss deployement descriptors.

                Cool