【问题标题】:Hibernate 4.3 support in wildfly 10Wildfly 10 中的 Hibernate 4.3 支持
【发布时间】:2016-10-02 02:31:54
【问题描述】:

是 hibernate 4,wildfly 10 支持,我发现超过 iternet 版本 5 是支持的,但没有任何内容重新定义版本 4。

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

发现以元素“create”开头的无效内容。之一 '{"http://www.hibernate.org/xsd/orm/hbm":drop}' 是预期的。

如何解决这个异常?

【问题讨论】:

标签: hibernate wildfly


【解决方案1】:

在 Wildfly 10 中,休眠版本升级到 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 中完全删除。

【讨论】:

  • Sriram,您所说的“在 wildfly 10 中完全删除了对 ernate 3.x 的支持”是什么意思?如果我将 hibernate 3 jar 打包到我的应用程序中,并在我的所有模块中排除 hibernate 5 怎么办?
  • 设置jboss.as.jpa.providerModule的值
猜你喜欢
  • 2021-10-19
  • 2016-05-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-09-28
  • 2017-03-09
  • 2018-06-08
  • 1970-01-01
相关资源
最近更新 更多