Spring Hibernate JBoss的哪个版本
作者:互联网
寻找有关Spring,Hibernate和JBoss协同工作的版本的指导.我目前正在使用:
<dependencies>
<dependency org="javax.servlet" name="jstl" rev="1.1.2" conf="runtime->default"/>
<dependency org="org.springframework" name="spring" rev="2.5.6" conf="runtime->default"/>
<dependency org="org.springframework" name="spring-webmvc" rev="2.5.6" conf="runtime->default"/>
<dependency org="org.hibernate" name="hibernate-core" rev="3.5.6-Final" conf="runtime->default">
<exclude module="xml-apis"/>
</dependency>
<dependency org="org.hibernate" name="hibernate-annotations" rev="3.5.6-Final" conf="runtime->master"/>
<dependency org="commons-dbcp" name="commons-dbcp" rev="1.4" conf="runtime->default"/>
<dependency org="commons-lang" name="commons-lang" rev="2.5" conf="runtime->master"/>
<dependency org="org.slf4j" name="slf4j-jdk14" rev="1.6.1" conf="runtime->default"/>
<dependency org="org.slf4j" name="log4j-over-slf4j" rev="1.6.1" conf="runtime->default"/>
<dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.1" conf="runtime->default"/>
<dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.1" conf="runtime->default"/>
<dependency org="log4j" name="log4j" rev="1.2.16" conf="runtime->default"/>
<dependency org="taglibs" name="standard" rev="1.1.2" conf="runtime->default"/>
<!-- exclude commons logging since we are using log4j-over-slf4j -->
<exclude module="commons-logging" />
</dependencies>
我得到以下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in ServletContext resource [/WEB-INF/ecotrak-data.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
解决方法:
类o.h.a.c.r.MetadataProvider由hibernate-commons-annotations提供,我从Hibernate 3.5.6-Final传递过来的版本是3.2.0.Final.以防万一,这是一个宠物项目的过滤后的依赖树:
$mvn dependency:tree -Dincludes=org.hibernate::: [INFO] Scanning for projects... ... [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ domain --- [INFO] com.acme.samples.javaee6.domain:domain:jar:1.0-SNAPSHOT [INFO] +- org.hibernate:hibernate-validator:jar:4.0.2.GA:runtime [INFO] +- org.hibernate:hibernate-entitymanager:jar:3.5.6-Final:compile [INFO] | +- org.hibernate:hibernate-core:jar:3.5.6-Final:compile [INFO] | \- org.hibernate:hibernate-annotations:jar:3.5.6-Final:compile [INFO] | \- org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final:compile [INFO] +- org.hibernate:hibernate-jpamodelgen:jar:1.1.0.CR1:compile [INFO] \- org.hibernate:hibernate-ehcache:jar:3.5.6-Final:compile [INFO] ------------------------------------------------------------------------
标签:jboss,hibernate,ivy,spring 来源: https://codeday.me/bug/20191105/1997278.html