我想添加休眠到我的春天項目的數據庫持久性,我已經下載了休眠4.1.6最新的穩定版本,我使用的是Spring 3.1。當試圖添加休眠到春天項目時出錯
然而,當我嘗試運行項目中,我得到:
我已經添加到我的項目外罐到目前爲止是:
antlr-2.7.7.jar
dom4j-1.6.1.jar
hibernate-commons-annotations-4.0.1.Final.jar
hibernate-core-4.1.6.Final.jar
hibernte-jpa-2.0-api-1.0.1.Final.jar
javassist-3.15.0-GA.jar
jboss-logging-3.1.0.GA.jar
jboss-transaction-api_1.1_spec-1.0.0.Final.jar
hibernate-entitymanager-4.1.6.Final.jar
slf4j-api-1.6.1.jar
我的pom.xml包含以下依賴關係:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<scope>runtime</scope>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
感謝您的幫助,對我的問題所做的任何更改請讓m我知道。
丹尼爾
http://stackoverflow.com/questions/12261899/failed-to-load-applicationcontext-with-contextconfigurationclasses http://stackoverflow.com/questions/11863235/junit-testcase-passes-with-eclipse-but-fails- with-maven-build看起來像是重複的,它與jee依賴關係 –
另一個奇怪的東西,你說rence hibernate實體管理器(它引用了hibernate)並使用單獨的jar文件。你也有你的配置中的jee依賴和jpa 2實現jar文件我猜想它可能是不同衝突的來源 –