2 Replies Latest reply on Feb 12, 2012 12:50 PM by Henrik Huttunen

    How to upgrade Hibernate in Jboss 7.0.1?

    Henrik Huttunen Newbie

      I noticed Jboss 7.0.1 contains Hibernate in <jboss_home>/modules. The version for Hibernate is 4 beta 5. Is it possible to upgrade to a newer Hibernate just by changing the content of modules.xml and adding newer jars? Why does not adding Hibernate 4.1.Final dependency to pom.xml is not enough with jboss-maven-plugin?

       

      Is there any hard coded dependencies in 7.0.1 for Hibernate that would make it impossible to do this?

        • 1. Re: How to upgrade Hibernate in Jboss 7.0.1?
          Scott Marlow Master

          When you choose a particular version of Hibernate to use witih your application (via your pom.xml), the version that you specify, is only used to compile your application code (the Hibernate version information does not get passed into the application server).  Instead the application server tries to match up the persistence provider classname that you specified in the persistence.xml, with available known persistence provider modules.  There are persistence.xml properties for hinting that a specific module be used (you don't need to set them usually but its good to know about them). 

           

          You could try adding the newer Hibernate jars.  Have you looked at switching to AS 7.1?  We are using Hibernate 4.0.1 in AS 7.1 (which is pretty close to Hibernate 4.1). 

           

          Switching Hibernate to a newer version could be done by:

           

          1. Delete as7/modules/org/hibernate/main/*.index files.
          2. Replace current Hibernate 4.x jars in as7/modules/org/hibernate/main with new ones.
          3. Update as7/modules/org/hibernate/main/module.xml to use newer Hibernate jar names.

           

          Scott

          1 of 1 people found this helpful
          • 2. Re: How to upgrade Hibernate in Jboss 7.0.1?
            Henrik Huttunen Newbie

            Hi Scott, thanks for providing detailed info. I will investigate this further later.

             

            We cannot upgrade to 7.1 yet, as it seems to make some semantic changes so that the application does not work as is (related to having ejb beans with persistence contexts of differend kind (extended and non-extended)).