4

Is hibernate 4, supported in wildfly 10 , i found over iternet version 5 is supported but nothing is there reagrding version 4.

here is the exception i got when deploying the code on wildfly 10.

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

How to solve this exception?

itzmebibin
  • 9,199
  • 8
  • 48
  • 62
yogas
  • 189
  • 1
  • 3
  • 17
  • Can you post the xml file please ? – Alexandre Cartapanis Jun 02 '16 at 11:28
  • This seems to be, first of all, related to a configuration problem in your Hibernate configuration XML - see here f.ex.: http://stackoverflow.com/questions/17173383/invalid-content-was-found-starting-with-element-country-one-of-country-is – cslotty Jun 07 '16 at 13:06

1 Answers1

5

In Wildfly 10, hibernate version is upgraded to 5.x. So, default persistence provider is hibernate 5.x.

However, wildfly 10 doesn't completely drop support for hibernate 4. There are two ways where you can make it work.

1) Per deployment packaging

  • Pack all the hibernate 4.x jar files in your deployment archive and set "jboss.as.jpa.providerModule" property to "application" in your persistence.xml

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

2) Wildfly global module (works across all deployment)

  • Adding hibernate 4.3 jar files to the wildfly hibernate module and "jboss.as.jpa.providerModule" property to "4.x" (specific version as per hibernate's module.xml) in your persistence.xml

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

FYI, hibernate 3.x support is completely removed in wildfly 10.

Sri
  • 4,613
  • 2
  • 39
  • 42
  • Sriram, what do you mean by "ernate 3.x support is completely removed in wildfly 10"? What if i package the hibernate 3 jars in my application, and exclude hibernate 5 in all my modules? – inor Nov 09 '16 at 11:25
  • Setting the value of `jboss.as.jpa.providerModule` < 4 will not be recognized by wildfly. So, you can't use it. – Sri Apr 19 '17 at 06:57