Hibernate类型和JBoss兼容性问题

问题描述 投票:2回答:2

我想使用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。 。关于使事情正常运行缺少什么的任何想法?非常感谢

hibernate jpa types jboss jboss7.x
2个回答
2
投票

Wildfly提供了休眠状态,并且在耳朵中搜索了该类。我改变了耳朵的绒球,所以:

路径:“ maven-ear-plugin” .configuration.archive

<manifestEntries>
    <Dependencies>org.hibernate.commons-annotations</Dependencies>
</manifestEntries>

因此找到XProperty类。

H。


0
投票

也可以在WEB-INF/jboss-deployment-structure.xml文件中将其配置为:

<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="org.hibernate.commons-annotations"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure>
© www.soinside.com 2019 - 2024. All rights reserved.