roehrijn
roehrijn

Reputation: 1427

Downgrading Hibernate in Wildfly 15 to 4.x

I want to deploy an application to Wildfly 15 which needs Hibernate 4.x. According to the documentation this is done using the following property in the deployed persistence.xml:

<property name="jboss.as.jpa.providerModule" value="org.hibernate:4.3"/>

But in the logs during deployment I can see Wildfly still loading Hibernate 5.3:

2019-04-02 18:29:13,922 INFO  [] [org.hibernate.Version] (ServerService Thread Pool -- 75) HHH000412: Hibernate Core {5.3.7.Final}

I also tried to add a dependency to the jboss-deployment-structure.xml file but also with no effect:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
    <dependencies>
        <module name="org.hibernate" slot="4.3"/>
    </dependencies>
</deployment>

Any ideas? At least when I change the slot of the module dependency to something obviously wrong, the deployment fails there. So it seems that the jboss-deployment-structure.xml is recognized during my deployment.

Upvotes: 0

Views: 987

Answers (1)

Erhard Siegl
Erhard Siegl

Reputation: 577

You have to exclude the default hibernate module

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
  <deployment>
    <dependencies>
       <module name="org.hibernate" slot="4.3"/>
    </dependencies>
    <exclusions>
       <module name="org.hibernate"/>
    </exclusions>
  </deployment>

Upvotes: 1

Related Questions