【问题标题】:Downgrading Hibernate in Wildfly 15 to 4.x将 Wildfly 15 中的 Hibernate 降级到 4.x
【发布时间】:2019-04-02 16:35:09
【问题描述】:

我想将一个应用程序部署到需要 Hibernate 4.x 的 Wildfly 15。根据文档,这是使用部署的 persistence.xml 中的以下属性完成的:

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

但在部署期间的日志中,我可以看到 Wildfly 仍在加载 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}

我还尝试向 jboss-deployment-structure.xml 文件添加依赖项,但也没有效果:

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

有什么想法吗?至少当我将模块依赖项的插槽更改为明显错误的地方时,部署在那里失败。所以在我的部署过程中,似乎 jboss-deployment-structure.xml 被识别出来了。

【问题讨论】:

    标签: hibernate jpa wildfly


    【解决方案1】:

    你必须排除默认的休眠模块

    <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>
    

    【讨论】:

      猜你喜欢
      • 2021-01-14
      • 2013-04-22
      • 2017-05-08
      • 2015-09-21
      • 2017-05-13
      • 1970-01-01
      • 2013-09-15
      • 2019-10-24
      • 1970-01-01
      相关资源
      最近更新 更多