当我从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罐子(我的库中没有同学罐子):
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
我认为这个异常已经生成,因为我的一些罐子与野生苍蝇罐子有冲突,我不能阻止wildfly加载它的默认hibernate罐子。
答案 0 :(得分:0)
生成此异常是因为wildfly hibernate-validator库比我的应用程序hibernate-validator更新,所以我通过在我的应用程序中的jboss-deployment-structure.xml排除部分添加以下行来解决问题:
<exclusions>
<module name="org.hibernate.validator"/>
.
.
.
<exclusions>