9 Replies Latest reply on Jul 13, 2015 12:05 PM by paolomenon

    jboss 4 to 7 migration question.

    ppgandhi11

      hi,

      we have application at jboss 4.0.1 sp1. The EJB we are using are of 2.x. We want to migrate to Jboss 7. Do we need to upgrade from EJB 2.x to 3.0? is that mandatory for jboss 7 to work?  Using ant over eclipse.

       

      Reason: When I include the below line in my .java file, the compile fails at jboss 4.0.1 sp1.

       

      import javax.ejb.Stateless;

       

      -- I searched on the net and someone suggested including the jboss-javaee.jar in the class path and compile, I tried that and the code compiles. However, jboss 4.0.1sp1 does not have jboss-javaee.jar file, jboss 5.x did have it so i had to grab that into classpath.

       

      basically, i am not using jboss4.0.1sp1 essentially if i am including .jar file from the jboss 5.x. That is why I am asking this question.

       

      Also, if we want to upgrade both Jboss and EJB, which should happen first? (or they must happen concurrently)?  Sorry, but i do not know the compatibility issues and requirements.

       

      Also, I have found that between Jboss 4.x and 7.x there had been a major architecture re-write. Can someone please tell me exactly at what version the major re-write happened? 

       

      My original plan was to go from 4.x to 5.x to 6.x to 7.x , but then someone explained that this is not a good strategy, so now i am planning to go from 4.x to 7.x directly and sort out the hurdles as they come.

       

      I am very new to java/ejb/jboss world. Thanks for any help friends...

        • 1. Re: jboss 4 to 7 migration question.
          wdfink

          Hi Prashant,

           

          this is very difficult to answer. It depends on your application which way is the best.

          Several interrim steps are expensive and you have to do some extra work.

           

          The optimal result is to have an actual application based on the EJB3.1 spec with no dependencies to an application server, but this is often a nice theory

           

          With JBoss 4.0 there is no EJB3 integration, so you are not able to migrate here.

          The major architecture change was AS7, there are lot of configuration changes and the server is mostly new code.

          But as AS7 is re-written the weight is more on EJB3 than on EJB2 here, so in fact there are some issues that will not work as before and might have issues.

           

          If it is possible for you migrate the application to EJB3.1 by re-writing it and use AS7 or better a newer one (EAP6.1 or WildFly AS8).

          From my experience it will have lower costs and the best result, but you will be blocked for new features in your application in the meantime.

          • 2. Re: jboss 4 to 7 migration question.
            ppgandhi11

            Okay Wolf, Thanks for your response.

             

            So, basically on a general perspective based on  your response, I believe the best course of action would be to re-write EJB first from 2.x to 3.0 (we are planning 3.0, not 3.1 - don't know why, but that is what i had been told) and after that migrating from JBOSS 4.0.1sp1 to JBOSS AS 7.0.

             

            Problem in this would be: EJB 3.0 needs .jar files that are not available at JBOSS 4.0.1 sp1. I believe jboss 4.0.1 sp1 does not support EJB 3.0; it only supports lower version of EJB (2.0 and 2.1). My entire code was written in 2005 and then nobody touched it until now, which makes me believe that my ejb code is 2.x - also i am seeing ejbcreate(), ejbpassivate(), ejbremv() etc. methods in my java code, which are not required in EJB 3.0.

             

            Is this going to be more of a convoluted effort where upgrading EJB will go hand in hand with JBOSS AS 7.0 upgrade?

             

            I had initial idea of moving from JBOSS 4 to 5 to 6 to 7, but when you replied that this would not be of much help, I changed the plan to move from 4.0.1 sp1 directly to JBOSS AS 7.0.

             

            Also, for web application, I see there are several zip files available for JBOSS 7.0. which one should i use? (Download section of the below link shows 2 options for JBOSS 7.0.0 zip files)

             

            https://docs.jboss.org/author/display/AS7/Getting+Started+Guide#GettingStartedGuide-GettingStartedwithJBossApplicationServer7

             

             

            Thanks again for your response. Much Appreciated.

            • 3. Re: jboss 4 to 7 migration question.
              wdfink

              The link https://docs.jboss.org/author/display/AS7 is out of date, the latest is https://docs.jboss.org/author/display/AS72.

              But you can use jboss.org and click projects or use this link.

               

              As I said there are no EJB3.x API's in AS4.0.

              If you try to migrate to EJB3.x you have to change the app server as well.

              I use the standard JavaEE APIs for programming as long as possible, in that case you have no dependencies to an AS or to specific AS-versions.

              There is no difference whether you implement EJB 3.0 or 3.1 (maybe 3.1 is more simple with CDI and ..)

              • 4. Re: jboss 4 to 7 migration question.
                ppgandhi11

                Thanks wolf again.

                 

                I have a meeting in next few hours, where I am going to ask what exact versions are we upgrading to. (ejb 3 or 3.1 and jboss 7.0 or 7.1.1 final).  I am going through the link you just sent me for jboss documentation.

                 

                yes, you are correct. ejb3.x are not supported by current version of jboss i am using (4.0.1sp1) so upgrading ejb first without upgrading AS is not possible. That is why i asked - if this is going to be a more of a convoluted process where upgrading both at the same time will go hand in hand - i am seeing JNDI used in my current .java code, and i believe ejb 3.x prefers injection as supposed to JNDI, so that will need to go through change as well.

                 

                thanks a lot again for your response. my first project in java world...

                 

                does jboss AS 7.x works with older version of ejb (2.x)? I think i will be better off once I start doing some actual work, but trying to get handle of what I am getting into first... I tried checking the system requirement for jboss 7.x and did not get much clue if it supports ejb 2.x. please let me know. thanks.

                • 5. Re: jboss 4 to 7 migration question.
                  dhananjayakittur

                  Hi Prashant ,

                   

                       Mine is the same case as I need to migrate from Jboss as-4 to Jboss as-7 and from ejb2.x to ejb3.1. Can you please suggest the steps and the tool which you used in the migration process(Actually I am new to jboss as).

                   

                  Thanks in advance

                  Dhananjay.

                  • 6. Re: jboss 4 to 7 migration question.
                    skorepam

                    Hi Prashant,

                     

                    The EJB 2.x is supported from AS 7.1.0 and higher. The AS version 7.0.x doesn't support it. See Will JBoss AS 7.0 support EJB2.1 Entity Beans? for more details.

                     

                    However I strongly suggest to start with the latest AS7 version as there still many improvements and bug fixes implemented.

                     

                    Regards.

                     

                    Martin

                    • 7. Re: jboss 4 to 7 migration question.
                      wdfink

                      Hi Prashant,

                      without knowledge what application you have I would say this huge step would take more resources and time if you do it in two steps.

                      From my experiance I would migrate to ejb3 and, if you use EJB2 entities before, to JPA for persistence and deploy that on the latest WildFly version (which is 8.1)

                       

                      With AS7 you have EJB2.1 support, but notice that this has changed from former versions and you have effort here as well.

                      EJB2 entities might have issues depend on what you have used before.

                      So my recommendation is to use WildFly 8.1 or 9 and migrate to EJB3.1 in one shot.

                      • 8. Re: jboss 4 to 7 migration question.
                        mcclane

                        Hi to all,

                        We are in a similar case.

                        Our application has more than one hundred 2.1 EJBs (entity, stateless, message-driven) and was developed (many years ago) to work on many applications servers (just changing the deployment descriptors).

                        Now it's still working with latest nad older versions on many of them... but now we don't know how to deploy it on JBOSS AS 7 without migrating the code (and loosing backwards compatibility).

                        We've started trying to migrate jboss.xml to jboss-ejb3.xml but we have a problem with the naming (can't define specific <jndi-name> for the EJBs); ¿Is there any way to solve this without changing the java code?.

                        Regards

                        • 9. Re: jboss 4 to 7 migration question.
                          paolomenon

                          Hi Prashant,

                           

                          I think you should diced by yourself have a look on red hat jboss migration documentation here, you will find a topic about EJB 2.x changes for jboss eap 6 (widfly 7.x)

                           

                          Migration Guide

                           

                          I also suggest you to run windup to give you a report that will help you with your migration, this tool is normally used to migrate from different java application server to JBoss, I don't see any problem in use it for that as well.

                           

                           

                          http://windup.jboss.org/

                           

                           

                          Hope that's help

                           

                          Thanks