gpt4 book ai didi

Wildfly 10 中的 Hibernate 4.3 支持

转载 作者:行者123 更新时间:2023-12-03 22:44:12 25 4
gpt4 key购买 nike

是 hibernate 4,在 wildfly 10 中支持,我发现支持 iternet 版本 5,但没有任何内容重新调整版本 4。

这是我在 Wildfly 10 上部署代码时遇到的异常。

invalid content was found starting with element 'create'. One of '{"http://www.hibernate.org/xsd/orm/hbm":drop}' is expected.



如何解决这个异常?

最佳答案

在 Wildfly 10 中,hibernate 版本升级到 5.x。因此,默认的持久性提供程序是 hibernate 5.x。

然而,wildfly 10 并没有完全放弃对 hibernate 4 的支持。有两种方法可以让它工作。

1) 每个部署打包

  • 将所有 hibernate 4.x jar 文件打包到您的部署存档中,并在您的 persistence.xml
  • 中将“jboss.as.jpa.providerModule”属性设置为“application”

    引用: https://docs.jboss.org/author/display/WFLY10/JPA+Reference+Guide#JPAReferenceGuide-PackagingtheHibernateJPApersistenceproviderwithyourapplication

    2) Wildfly 全局模块(适用于所有部署)
  • 将hibernate 4.3 jar 文件添加到wildfly hibernate 模块,并将“jboss.as.jpa.providerModule”属性添加到persistence.xml 中的“4.x”(根据hibernate 的module.xml 的特定版本)

  • 引用: https://docs.jboss.org/author/display/WFLY9/JPA+Reference+Guide#JPAReferenceGuide-SharingtheHibernate3.5orgreaterJPApersistenceproviderbetweenmultipleapplications

    仅供引用,wibernate 3.x 支持在 wildfly 10 中完全删除。

    关于Wildfly 10 中的 Hibernate 4.3 支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37590413/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com