更新时间:2023-02-22 19:18:14
You can control class loading in the jboss-deployment-structure.xml
. It should look something like this (please read the docs of your jboss version about the exact configuration parameters):
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<deployment>
<exclusions>
<module name="org.hibernate" slot="main" />
</exclusions>
<dependencies>
<module name="org.hibernate" slot="5.1.10.Final" />
</dependencies>
</deployment>
</jboss-deployment-structure>
You may also need to add the following property in the persistence.xml
:
<property name="jboss.as.jpa.providerModule" value="org.hibernate:5.1.10.Final"/>
Also, create a new module and copy the necessary jars for the Hibernate version you want to use; here are more details about class loading in AS7.