Change hiberante version from 5.3 to 4.3 with wildfly19

677 views
Skip to first unread message

helmi chamsi

unread,
Feb 12, 2021, 12:28:35 PM2/12/21
to WildFly
Hi all,

I have an emergency question please ! 
is it possible to update the version of hibernate on wildfly 19 from 5.3 to 4.3 ?
I'm trying to upgrade my application server from wildfly8 to wildfly19

Ps: my application using jpa2.0 so that's why I'm trying to update my hibernate version on wildfly19 

Cordially, 

Scott Marlow

unread,
Feb 12, 2021, 12:44:57 PM2/12/21
to WildFly
No promises but you can try copying the Hibernate ORM 4.3 jars into wildfly-/modules/system/layers/base/org/hibernate/4.3 and update the wildfly-/modules/system/layers/base/org/hibernate/4.3/module.xml to reference each Hibernate jar that you could in.
You can reference the Hibernate ORM 5.3 module (wildfly-/modules/system/layers/base/org/hibernate/main as a reference but it would look something like:
    <resources>
        <resource-root path="hibernate-core-4.3.11.Final.jar"/>
        <resource-root path="hibernate-entitymanager-4.3.11.Final.jar"/>
        <resource-root path="hibernate-envers-4.3.11.Final.jar"/>
    </resources>

Also, don't expect the second level cache to work due to wildfly19 having a newer Infinispan implementation (which you cannot change).

helmi chamsi

unread,
Feb 12, 2021, 12:52:04 PM2/12/21
to WildFly
You mean under  wildfly-/modules/system/layers/base/org/hibernate/main !

in my case i used hibernate-core , hibernate-entity manager and hibernate-envers 

shall i change also JPA version to 2.0 ? 

thanks
 

Scott Marlow

unread,
Feb 12, 2021, 1:01:09 PM2/12/21
to WildFly
under modules/system/layers/base/org/hibernate, you should have a main folder and a 4.3 folder.  The 4.3 folder already contains a module.xml that you will update to reference the Hibernate ORM 4.3 jars that you copy in.  Note that the 4.3/module.xml is already referencing the separate "org.hibernate.jipijapa-hibernate4-3" module which still contains the integration code for working with Hibernate ORM 4.3.x.  Please let us know if this worked or not for you as very few people use the older Hibernate ORM versions in this way.

Do not change the JPA version to 2.0, that will cause the wildfly to not work correctly (probably wouldn't start).

Mike Douglass

unread,
Feb 12, 2021, 1:06:50 PM2/12/21
to WildFly
Have you tried deploying the hibernate jars along with your application? I deploy ears with the desired hibernate version in the lib/ folder and that seems to work fine

Scott Marlow

unread,
Feb 12, 2021, 1:21:40 PM2/12/21
to WildFly
On Friday, February 12, 2021 at 1:06:50 PM UTC-5 mikead...@gmail.com wrote:
Have you tried deploying the hibernate jars along with your application? I deploy ears with the desired hibernate version in the lib/ folder and that seems to work fine

+100, great to hear that also works!  Are you setting the persistence unit property "jboss.as.jpa.providerModule" to "application" as mentioned on https://docs.wildfly.org/22/Developer_Guide.html#persistence-unit-properties?

Michael Douglass

unread,
Feb 12, 2021, 2:04:51 PM2/12/21
to wil...@googlegroups.com


On 2/12/21 13:21, Scott Marlow wrote:


On Friday, February 12, 2021 at 1:06:50 PM UTC-5 mikead...@gmail.com wrote:
Have you tried deploying the hibernate jars along with your application? I deploy ears with the desired hibernate version in the lib/ folder and that seems to work fine

+100, great to hear that also works!  Are you setting the persistence unit property "jboss.as.jpa.providerModule" to "application" as mentioned on https://docs.wildfly.org/22/Developer_Guide.html#persistence-unit-properties?

Actually I missed the jpa connection. I'm not using the jpa support - only the datasources. For wildfly 17 I was using the zipped download. For 22 I'm using a galleon built version which doesn't include jpa extension.

However - I do see that I have hibernate-jpa-2.1-api-1.0.0.Final.jar in lib/ as well. So maybe you could get it to run by adding enough jars?




On Friday, February 12, 2021 at 1:01:09 PM UTC-5 sma...@redhat.com wrote:
under modules/system/layers/base/org/hibernate, you should have a main folder and a 4.3 folder.  The 4.3 folder already contains a module.xml that you will update to reference the Hibernate ORM 4.3 jars that you copy in.  Note that the 4.3/module.xml is already referencing the separate "org.hibernate.jipijapa-hibernate4-3" module which still contains the integration code for working with Hibernate ORM 4.3.x.  Please let us know if this worked or not for you as very few people use the older Hibernate ORM versions in this way.

Do not change the JPA version to 2.0, that will cause the wildfly to not work correctly (probably wouldn't start).


On Friday, February 12, 2021 at 12:52:04 PM UTC-5 helmic...@gmail.com wrote:
You mean under  wildfly-/modules/system/layers/base/org/hibernate/main !

in my case i used hibernate-core , hibernate-entity manager and hibernate-envers 

shall i change also JPA version to 2.0 ? 

thanks
 

Le vendredi 12 février 2021 à 18:44:57 UTC+1, sma...@redhat.com a écrit :
No promises but you can try copying the Hibernate ORM 4.3 jars into wildfly-/modules/system/layers/base/org/hibernate/4.3 and update the wildfly-/modules/system/layers/base/org/hibernate/4.3/module.xml to reference each Hibernate jar that you could in.
You can reference the Hibernate ORM 5.3 module (wildfly-/modules/system/layers/base/org/hibernate/main as a reference but it would look something like:
    <resources>
        <resource-root path="hibernate-core-4.3.11.Final.jar"/>
        <resource-root path="hibernate-entitymanager-4.3.11.Final.jar"/>
        <resource-root path="hibernate-envers-4.3.11.Final.jar"/>
    </resources>

Also, don't expect the second level cache to work due to wildfly19 having a newer Infinispan implementation (which you cannot change).

On Friday, February 12, 2021 at 12:28:35 PM UTC-5 helmic...@gmail.com wrote:
Hi all,

I have an emergency question please ! 
is it possible to update the version of hibernate on wildfly 19 from 5.3 to 4.3 ?
I'm trying to upgrade my application server from wildfly8 to wildfly19

Ps: my application using jpa2.0 so that's why I'm trying to update my hibernate version on wildfly19 

Cordially, 
--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/f9fc95ea-704f-4cdd-9c70-1c8b64f3b501n%40googlegroups.com.

Scott Marlow

unread,
Feb 12, 2021, 2:13:29 PM2/12/21
to WildFly
On Friday, February 12, 2021 at 2:04:51 PM UTC-5 mikead...@gmail.com wrote:


On 2/12/21 13:21, Scott Marlow wrote:


On Friday, February 12, 2021 at 1:06:50 PM UTC-5 mikead...@gmail.com wrote:
Have you tried deploying the hibernate jars along with your application? I deploy ears with the desired hibernate version in the lib/ folder and that seems to work fine

+100, great to hear that also works!  Are you setting the persistence unit property "jboss.as.jpa.providerModule" to "application" as mentioned on https://docs.wildfly.org/22/Developer_Guide.html#persistence-unit-properties?

Actually I missed the jpa connection. I'm not using the jpa support - only the datasources. For wildfly 17 I was using the zipped download. For 22 I'm using a galleon built version which doesn't include jpa extension.

However - I do see that I have hibernate-jpa-2.1-api-1.0.0.Final.jar in lib/ as well. So maybe you could get it to run by adding enough jars?

Ah, thanks for explaining that you meant for non-JPA use only. 

For jpa (container managed use), the "jboss.as.jpa.providerModule" set to "application" is a hint that the Hibernate ORM provider packaged with the application should be used, however you still need to identify the Jipijapa (integration) module to use as well, so not as convenient as what I described before about setting up the existing Hibernate ORM 4.3 module.
Reply all
Reply to author
Forward
0 new messages