2 Replies Latest reply on May 21, 2013 12:48 PM by ppgandhi11

    Upgrade Guide - JBoss 4 to 5


      Once again, I am involved in a project that is upgrading jboss 4 to 5.


      I definitely realize that JBoss 4, 5 and 6 are no longer maintained at all (no bug fixes unless you do them yourself on your own private branch). But none-the-less, business-wise it may possibly make sense to move to JBoss 5.


      I have started on an upgrade guide for upgrading JBoss 4 to 5 that I hope everyone can find useful.


      Below is what I have so far. Can anyone please add their input based on their previous experiences with going through this process?


      JBoss AS4 to AS5 Upgrade Guide


      This is an upgrade guide specifically for those who are going from JBoss Application Server version 4.x, and upgrading to JBoss Application Server 5.x. The latest and final GA release for the JBoss 5 version is jboss-5.1.0.GA., and this guide assumes this is the version you are upgrading to.

      JBoss AS4 to AS5 - Good Idea?


      The interesting part of this upgrade manual is that it's being written for a version that is already several releases past. We are all the way to AS7. This, of course, means we need a section dedicated to whether or not upgrading is even a good idea at all, or would it make more sense to go to the latest version.


      So if you are thinking about upgrading your JBoss AS4 to AS5, make sure you have asked yourself if this the best move to make.


      Start a meeting pulling in all the Java/JBoss architects that have been involved in the JBoss 4 "situation." In this meeting, create a list consisting of all the reasons your team wants to upgrade. What features in JBoss 5.1.0.Final are prompting you to move from AS4 to AS5?


      Here are things to keep in mind when determining if the port from AS4 to AS5 is a smart idea:


      1. JBoss 5 uses more RAM than JBoss 4. So if you are looking for more efficient RAM utilization, you aren't going to get it..
      2. EJB3 capabilities are better in JBoss 5 than JBoss 4. This is one of the main reasons people would consider upgrading to AS5.
      3. If you are moving to AS5, why aren't you going to AS6? AS6 is basically an improved AS5. Keep in mind that in the case of AS5 versus AS6, there really isn't that much more work getting something to work in one versus the other. Take a look as the AS6 release notes[4].
      4. You do NOT need to move to AS5 or later to use HornetQ or another alternate messaging system. You can get most of those working on AS4.

      [There are more reasons, community please add to this list!]


      Another important factor is whether you are upgrading to a


      community version or to an enterprise version.


      Community Edition


      JBoss AS4, AS5 and AS6 community editions are all no longer supported. So if you report a bug you find when


      moving from AS4 to AS5... the Jboss community will simply be like "Yeah I know it's broken, upgrade to the latest JBoss."


      At that point you would either have to find a work-around for the issue, or if that is not possible then you would have to create your own private branch and make a fix yourself. This is obviously not recommended mainly because such patches are not easily supported in the future. When you try to move to yet another later version of JBoss, those patches you applied might come to bite you.


      Enterprise Edition


      Start out by giving the Red Hat support policy a once-over and understand what to expect from the RedHat.


      In short:


      • AS4.3 has only Mantenance Support until Jan 2013 (4.2 is outdated)
      • AS5 Full support Nov 2012, Maintenance Nov 2016
      • AS6 Full support Jun 2016, Maintenance Jun 2019
      • Under a special subscription you might have 3 extra years 'Extended Life support'. (But remember Maintenance/Extended is only for limited bugfixing. You will not get new features, improvements, etc.)


      So if you use AS5 you STILL might run into an issue where you have the need to upgrade for features (i.e. EE6).


      JBoss 4.x to JBoss 5.x upgrade considerations


      So there you go! I warned you! Don't upgrade to JBoss 5.x unless you know it's for sure what you want to do!


      I’ve done four major Jboss4 to Jboss5 upgrades in my career. These upgrades have taught me that the migration process is pretty complicated, and that a “how-to” guide for how to upgrade won't be straight forward. This is because


      1. Jboss is historically not exactly well-documented (thus no official Jboss4 to 5 official migration documentation exists)
      2. Your migration process will be greatly simplified the simpler your web application is. The more JBoss4 features you are using… the more work it will be to move to a later version of JBoss. Many of the steps in a full blown migration guide would be skipped if such a guide existed because not many people utilize 100% of the features Jboss4 has to offer.


      So what will we use to create an upgrade guide? Answer: We’ll use the Jboss 5.1.0.GA release notes [0], the Jboss issue tracker [3], and all community forum posts we can Google up related to struggles others went through when they did their application upgrades.


      Get a list of the particular JBoss features you use

      The migration process usually starts with a simple research task:


      • For each web application being run on JBoss4, create a list of each JBoss feature being utilized


      This might seem kind of silly at first... but realize the goal is to answer this question:


      Pretend your applications are running on Tomcat5 alone, not on JBoss4. What extra features would you need to add to your application to get this to work on standalone Tomcat?

      Why do this? Because JBoss4 and JBoss5 are built on top of Tomcat as their web container, upgrading JBoss4 to JBoss5 will involve getting a list of each JBoss 4 features you are using that Tomcat did not provide you, and going through the JBoss5 equivalent feature. If any of these features have changed from JBoss 4 to 5, then obviously you will need to make changes to fix the issue. It might even be the case that a feature that used to exist in JBoss4 has been completely refactored out of JBoss 5.


      An example list of JBoss4 features my application might look like this:


      • JBoss security domains
        • SSO custom tailored to our company
        • Security roles imported from LDAP integration
      • EJB2
      • EJB3
      • JBoss Web Services from JBossWS
      • Jboss messaging functionality using JBossMQ
      • MDB’s
      • Clustering services


      Researching the Jboss 5 release notes


      Once you have a list of all the JBoss features that you are utilizing, you will need to research the release notes to gather all relevant changes that have occurred that might affect your web applications on Jboss 5.


      For example, let’s say one of the Jboss4 features I am using is EJB3. I will then open up the jboss 5.1.0.GA/readme.html file and then search for “ejb.”


      As a result of my search, I find the following modifications have been made that have a potential to affect my Jboss 4 EJBs:

      • If using proprietary JBoss/EJB3 annotations, those have moved (since Beta4) into the org.jboss.ejb3.annotation package, EJBTHREE-1099. Those are now included in a new artifact, jboss-ejb3-ext-api.jar
      • Interoperating with previous JBoss EJB3 implementations may present problems due to serialVersionUIDs issues, EJBTHREE-1118.
      • JBoss 5 is stricter when it comes to verifying/deploying JavaEE artifacts. EJB3 deployments that run in AS 4.2 may fail in AS5. We have tried to keep the validation messages as accurate as possible in order to help you modify your deployment descriptors/annotations to be in-line with the JavaEE 5 requirements.
      • File system layout for Jboss 5’s ejb deployer resources have been changed. Note deploy versus deployers:

      Jboss 4.2.3.GA: C:\Jboss\jboss-4.2.3.GA\server\all\deploy\ejb3.deployer

      Jboss 5.1.0.GA: C:\Jboss\jboss-5.1.0.GA\server\all\deployers\ejb3.deployer

      • EJB3 configuration is now controlled by deployers/ejb3.deployer/META-INF/ejb3-deployers-jboss-beans.xml. For more details check out this wiki page.
      • EJB was upgraded to 1.1.5.


      So I would then go through this list and make appropriate changes before even trying to deploy the Jboss5 system.


      Spring2 and JBoss5 VFS don't play well together

      Spring2 has one big problem with JBoss5 that it did not have in JBoss4: http://jira.springframework.org/browse/SPR-5120


      As a part of this effort, we decided to upgrade Spring2 to Spring3... however, it isn't necessarily needed. We have plenty of JBoss5 + Spring2 apps running in production, but you will be forced to specify each application context instead of using wildcards.




      [0] JBoss 5.1.0.GA Release Notes* - http://anonsvn.jboss.org/repos/jbossas/tags/JBoss_5_1_0_GA/build/docs/readme.html#Other

      [1] Migration Tips when upgrading from JBoss 4 to 5 - http://www.ibm.com/developerworks/java/library/x-tipjb5ejb3/index.html

      [2] Upgrading JBoss 4 to JBoss5 with Java5 to Java6 - http://jvalentino.blogspot.com/2011/12/upgrading-jboss-4-to-jboss-5-with-java.html

      [3] The Jboss issue tracker - https://issues.jboss.org/browse/JBAS

      [4] JBoss 6.1.0.Final release notes** - https://community.jboss.org/wiki/AS610FinalReleaseNotes


      *  This is also available in your Jboss5 installation at: jboss-5.1.0.GA/readme.html file. This shows all the changes made from version 4 to version 5.

      ** This is also available in your Jboss6 installation at: jboss-6.1.0.GA/readme.html file. This shows all the changes made from version 5 to version 6.

        • 1. Re: Upgrade Guide - JBoss 4 to 5

          Taking the liberty of documenting a discussion about this I had on irc.freenode.net with vnavarstete. You will undoubtably face this discussion while upgrading from any jboss version to a newer version that isn't the latest. This is because JBoss stops development on any older versions that are not the latest.


          (4:55:52 AM) vnavarsete: nicholasdipiazza: Great:) Perhaps also a section about "preferred way"...like, if you're currently using Jboss 4.x, do you really want to take the steps through 5 and 6, or go directly to 7? (which I would absolutely say YES to). Same goes for 5->6...go directly to 7

          (4:56:29 AM) vnavarsete: nicholasdipiazza: or my message: If you're currently using either JBoss 4, 5 or 6 and want to do an upgrade...go directly ot 7!

          (4:57:01 AM) nicholasdipiazza: vnavarsete: undoubtably i should add something about this, but this is a big insurance company, last time it was banks. in other words... moving one version is already pushing it lol

          (4:57:22 AM) vnavarsete: nicholasdipiazza: So I don't think it makes sense to make migration guides for 4->5, 4->6, 5->6...make [4,5,6]->7

          (4:58:43 AM) vnavarsete: nicholasdipiazza: I know..but since JBoss 4, 5 AND 6 aren't supported (READ: NO MORE BUG FIXES), it doesn't make sense to do "minor" upgrades, you MUST go directly to 7. I've done the "long path" myself from 4->5->6->7 and would never done it again..and would not recommend anyone to do it either.

          (4:59:06 AM) nicholasdipiazza: vnavarsete: and i'm one of them. =)

          (5:10:25 AM) nicholasdipiazza: vnavarsete: one time i actually convinced a pretty decent sized company to move 5 to JBoss 7. They then proceeded to move there, then hit a bundle of incompatibilities. Couldn't embed activemq, their Seam application stopped working for reasons unknown, and a bunch of other stuff. After f*ing with it for 2 days, They instead tried JBoss6 and they were up and running in half an hour.

          (5:10:54 AM) nicholasdipiazza: vnavarsete: sometimes moving to jboss7 isn't a good call. it really depends on if your software is going to work in jboss7, or if it will need an upgrade to later libraries

          (5:11:32 AM) nicholasdipiazza: vnavarsete: just playing devil's advocate.

          (5:15:31 AM) vnavarsete: nicholasdipiazza: yes, it's good to play the devil's advocate. I've experinced the opposite. Started the migrated path from 4.2.2.GA to AS5, found issues, went to AS6, found more issues, and now it was too late to go back (read: too many changes!), so we had to go to AS7

          (5:20:11 AM) vnavarsete: my issue when using AS6 was that I encountered a bug (or more actually!) with JNDI lookups and the new global JNDI..and created both forum posts and issues, but the message back was the AS6 isn't supported anymore...try with AS7. So my conclusion (was AND IS), is that if you ever think about upgrading your JBoss to something more current (read: 4,5,6) please don't forget that if you run into ANY problems you most likely won't get support.


          Moving to JBoss 7:


          Pros: Puts you on supported software, bug fixes don't have to be done by making your own private branch. Prevents a second or third migration process you will have to do anyway in the future. You can push your own branch with fixes you suggest if you like and the community will actually consider these for an actual release.

          Cons: Incurring Once reporting a bug has happened, doesn't mean anyone will fix it soon unless you fix it yourself. Libraries may be incompatible, might require you to move back to earlier jboss based on what you are using. (this is very common)

          • 2. Re: Upgrade Guide - JBoss 4 to 5

            Hi Nicholas, I recently started my jboss upgrade from 4.0.1sp1 to 5.1.0.GA. The java ear file code works for the 4.0.1sp1 but does not work in 5.1.0.GA in as is version. I am using Java 1.6.0_26. I get below error.

            Can you please help me with this? I am a newbie in Java/Jboss world. Is there any document etc. i can review for 4.0.1sp1 to 5.1.0.GA upgrade? (final goal is to upgrade Jboss to 7.x but I am taking a baby step at a time). I really appreciate your help on this.


            12:41:15,023 ERROR [AbstractKernelController] Error installing to Real: name=vfs

            zip:/C:/jboss-5.1.0.GA/server/default/deploy/dtu.ear/ state=PreReal mode=Manual


            org.jboss.deployers.spi.DeploymentException: Failed to locate invoker: stateful-


                    at org.jboss.ejb.deployers.EjbDeployer.deploy(EjbDeployer.java:383)

                    at org.jboss.ejb.deployers.EjbDeployer.deploy(EjbDeployer.java:74)

                    at org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer.de


                    at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.i


                    at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(


                    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(Deployer


                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(Deployer


                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi


                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi


                    at org.jboss.deployers.plugins.deployers.DeployersImpl.install(Deployers


                    at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra


                    at org.jboss.dependency.plugins.AbstractController.install(AbstractContr


                    at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra


                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr


                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr


                    at org.jboss.dependency.plugins.AbstractController.change(AbstractContro


                    at org.jboss.dependency.plugins.AbstractController.change(AbstractContro


                    at org.jboss.deployers.plugins.deployers.DeployersImpl.process(Deployers


                    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeploye


                    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter


                    at org.jboss.system.server.profileservice.repository.ProfileDeployAction


                    at org.jboss.system.server.profileservice.repository.AbstractProfileActi


                    at org.jboss.system.server.profileservice.repository.AbstractProfileServ


                    at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra


                    at org.jboss.dependency.plugins.AbstractController.install(AbstractContr


                    at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra


                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr


                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr


                    at org.jboss.dependency.plugins.AbstractController.change(AbstractContro


                    at org.jboss.dependency.plugins.AbstractController.change(AbstractContro


                    at org.jboss.system.server.profileservice.repository.AbstractProfileServ


                    at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(


                    at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:


                    at org.jboss.Main.boot(Main.java:221)

                    at org.jboss.Main$1.run(Main.java:556)

                    at java.lang.Thread.run(Thread.java:662)

            12:41:15,195 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of

            incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):




              Deployment "vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/dtu.ear/" is in er

            ror due to the following reason(s): org.jboss.deployers.spi.DeploymentException:

            Failed to locate invoker: stateful-rmi-invoker



            12:41:15,210 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-


            12:41:15,241 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-

            12:41:15,257 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=

            JBoss_5_1_0_GA date=200905221053)] Started in 53s:54ms