I'd like to use the hibernate-types library to map JSON collections to Postgres JSONB database columns using JPA and Hibernate but when I deploy my application I receive the following error:
Caused by: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/XProperty
at com.vladmihalcea.hibernate.type.json.internal.JsonTypeDescriptor.setParameterValues(JsonTypeDescriptor.java:58)
at com.vladmihalcea.hibernate.type.json.JsonBinaryType.setParameterValues(JsonBinaryType.java:66)
at org.hibernate.type.TypeFactory.injectParameters(TypeFactory.java:142)`
The class is indeed present in the jar provided by JBoss but it looks like the ModuleClassLoader is not able to find it. The Hibernate version provided by JBoss is 5.1.10.Final-redhat-1 and the version of the hibernate-commons-annotations where the XProperty class is defined is 5.0.1.Final-redhat-2. Any idea about what is missing to make things work? Thanks a lot
Wildfly provide hibernate, and the class is searched in the ear. I changed ear's pom so:
path : "maven-ear-plugin".configuration.archive
<manifestEntries>
<Dependencies>org.hibernate.commons-annotations</Dependencies>
</manifestEntries>
So find the XProperty class.
H.
This can also be configured in WEB-INF/jboss-deployment-structure.xml
file as:
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.hibernate.commons-annotations"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With