我想使用hibernate-types库通过JPA和Hibernate将JSON集合映射到Postgres JSONB数据库列,但是在部署应用程序时出现以下错误:
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)`
该类确实存在于JBoss提供的jar中,但看起来ModuleClassLoader无法找到它。 JBoss提供的Hibernate版本是5.1.10.Final-redhat-1,定义XProperty类的hibernate-commons-annotations的版本是5.0.1.Final-redhat-2。 。关于使事情正常运行缺少什么的任何想法?非常感谢
Wildfly提供了休眠状态,并且在耳朵中搜索了该类。我改变了耳朵的绒球,所以:
路径:“ maven-ear-plugin” .configuration.archive
<manifestEntries>
<Dependencies>org.hibernate.commons-annotations</Dependencies>
</manifestEntries>
因此找到XProperty类。
H。
也可以在WEB-INF/jboss-deployment-structure.xml
文件中将其配置为:
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.hibernate.commons-annotations"/>
</dependencies>
</deployment>
</jboss-deployment-structure>