gpt4 book ai didi

java - Wildfly-8.1 Hibernate jars 与我自己的 jars 冲突

转载 作者:太空宇宙 更新时间:2023-11-04 14:32:12 27 4
gpt4 key购买 nike

当我从 jboss-6.3-eap 迁移到 wildfly-8-1 时,我看到以下错误:

Caused by: java.lang.ClassCastException: com.fasterxml.classmate.types.ResolvedRecursiveType cannot be cast to com.fasterxml.classmate.types.ResolvedObjectType
at com.fasterxml.classmate.TypeResolver._resolveSuperClass(TypeResolver.java:422)
at com.fasterxml.classmate.TypeResolver._constructType(TypeResolver.java:395)
at com.fasterxml.classmate.TypeResolver._fromClass(TypeResolver.java:351)
at com.fasterxml.classmate.TypeResolver._fromAny(TypeResolver.java:299)
at com.fasterxml.classmate.TypeResolver._fromParamType(TypeResolver.java:437)
at com.fasterxml.classmate.TypeResolver._fromAny(TypeResolver.java:305)
at com.fasterxml.classmate.TypeResolver._resolveSuperInterfaces(TypeResolver.java:409)
at com.fasterxml.classmate.TypeResolver._constructType(TypeResolver.java:395)
at com.fasterxml.classmate.TypeResolver._fromClass(TypeResolver.java:351)
at com.fasterxml.classmate.TypeResolver.resolve(TypeResolver.java:111)
at org.hibernate.validator.internal.util.ExecutableHelper.instanceMethodParametersResolveToSameTypes(ExecutableHelper.java:114)
at org.hibernate.validator.internal.util.ExecutableHelper.overrides(ExecutableHelper.java:98)
at org.hibernate.validator.internal.util.ExecutableHelper.overrides(ExecutableHelper.java:62)
at org.hibernate.validator.internal.metadata.aggregated.ExecutableMetaData$Builder.accepts(ExecutableMetaData.java:328)
at org.hibernate.validator.internal.metadata.aggregated.BeanMetaDataImpl$BuilderDelegate.add(BeanMetaDataImpl.java:586)
at org.hibernate.validator.internal.metadata.aggregated.BeanMetaDataImpl$BeanMetaDataBuilder.addMetaDataToBuilder(BeanMetaDataImpl.java:500)
at org.hibernate.validator.internal.metadata.aggregated.BeanMetaDataImpl$BeanMetaDataBuilder.add(BeanMetaDataImpl.java:494)
at org.hibernate.validator.internal.metadata.BeanMetaDataManager.createBeanMetaData(BeanMetaDataManager.java:180)
at org.hibernate.validator.internal.metadata.BeanMetaDataManager.getOrCreateBeanMetaData(BeanMetaDataManager.java:207)
at org.hibernate.validator.internal.metadata.BeanMetaDataManager.isConstrained(BeanMetaDataManager.java:151)
at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:171)

我的应用程序在 jboss-6.3-eap 中运行良好,并且所有 hibernate 配置都正常。我的 hibernate jar 是(我的库中没有同学 jar ):

hibernate-commons-annotations-3.2.0.Final.jar
hibernate-core-3.6.7.Final.jar
hibernate-ehcache-3.6.7.Final.jar
hibernate-jpa-2.0-pi-1.0.1.Final.jar
hibernate-validator-4.1.0.Final.jar

我认为这个异常的产生是因为我的一些jar与wildfly jar冲突,并且我无法阻止wildfly加载其默认的hibernate jar。

最佳答案

生成此异常是因为 wildfly hibernate-validator 库比我的应用程序 hibernate-validator 更新,因此我通过在应用程序的 jboss-deployment-struct.xml 排除部分中添加以下行来解决问题:

<exclusions>
<module name="org.hibernate.validator"/>
.
.
.
<exclusions>

关于java - Wildfly-8.1 Hibernate jars 与我自己的 jars 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26009103/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com