日期:2014-05-19  浏览次数:20801 次

Spring3.1和Hibernate3.6整合问题
原本是打算整合Spring3.1、Hibernate3.6和Struts2.2的,但是把Spring3.1和Hibernate3.6整合到一起的时候就出问题了。
我添加的JAR包有:

antlr-2.7.6.jar

c3p0-0.9.1.jar

cglib-2.2.jar

commons-collections-3.1.jar

commons-io-2.0.1.jar

commons-lang3-3.0-beta.jar

commons-logging-1.1.1.jar

dom4j-1.6.1.jar

ehcache-1.5.0.jar

hibernate-jpa-2.0-api-1.0.0.Final.jar

hibernate3.jar

javassist-3.12.0.GA.jar

jta-1.1.jar

mysql-connector-java-5.1.14-bin.jar

org.springframework.aop-3.1.0.M1.jar

org.springframework.asm-3.1.0.M1.jar

org.springframework.aspects-3.1.0.M1.jar

org.springframework.beans-3.1.0.M1.jar

org.springframework.context-3.1.0.M1.jar

org.springframework.context.support-3.1.0.M1.jar

org.springframework.core-3.1.0.M1.jar

org.springframework.expression-3.1.0.M1.jar

org.springframework.jms-3.1.0.M1.jar

org.springframework.orm-3.1.0.M1.jar

org.springframework.oxm-3.1.0.M1.jar

org.springframework.spring-library-3.1.0.M1.libd

org.springframework.transaction-3.1.0.M1.jar

org.springframework.web-3.1.0.M1.jar

org.springframework.web.struts-3.1.0.M1.jar

slf4j-api-1.6.1.jar

slf4j-log4j12-1.6.1.jar



运行Main方法测试的时候出错信息是:

2011-4-9 15:13:19 org.springframework.context.support.AbstractApplicationContext prepareRefresh信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1608e05: startup date [Sat Apr 09 15:13:19 GMT+08:00 2011]; root of context hierarchy2011-4-9 15:13:19 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions信息: Loading XML bean definitions from class path resource [applicationContext.xml]Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptorat org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableAppli