mybatis与spring3.1整合ITeye - AG环亚娱乐集团

mybatis与spring3.1整合ITeye

2019-01-12 04:45:57 | 作者: 昌燎 | 标签: 整合,这个,里边 | 浏览: 919

Spring3.1和Hibernate3.6整合问题 原本是计划整合Spring3.1、Hibernate3.6和Struts2.2的,可是把Spring3.1和Hibernate3.6整合到一同的时分就出问题了。rn我增加的JAR包有:rnrnantlr-2.7.6.jarrnrnc3p0-0.9.1.jarrnrncglib-2.2.jarrnrncommons-collections-3.1.jarrnrncommons-io-2.0.1.jarrnrncommons-lang3-3.0-beta.jarrnrncommons-logging-1.1.1.jarrnrndom4j-1.6.1.jarrnrnehcache-1.5.0.jarrnrnhibernate-jpa-2.0-api-1.0.0.Final.jarrnrnhibernate3.jarrnrnjavassist-3.12.0.GA.jarrnrnjta-1.1.jarrnrnmysql-connector-java-5.1.14-bin.jarrnrnorg.springframework.aop-3.1.0.M1.jarrnrnorg.springframework.asm-3.1.0.M1.jarrnrnorg.springframework.aspects-3.1.0.M1.jarrnrnorg.springframework.beans-3.1.0.M1.jarrnrnorg.springframework.context-3.1.0.M1.jarrnrnorg.springframework.context.support-3.1.0.M1.jarrnrnorg.springframework.core-3.1.0.M1.jarrnrnorg.springframework.expression-3.1.0.M1.jarrnrnorg.springframework.jms-3.1.0.M1.jarrnrnorg.springframework.orm-3.1.0.M1.jarrnrnorg.springframework.oxm-3.1.0.M1.jarrnrnorg.springframework.spring-library-3.1.0.M1.libdrnrnorg.springframework.transaction-3.1.0.M1.jarrnrnorg.springframework.web-3.1.0.M1.jarrnrnorg.springframework.web.struts-3.1.0.M1.jarrnrnslf4j-api-1.6.1.jarrnrnslf4j-log4j12-1.6.1.jarrnrnrnrn运转Main办法测验的时分犯错信息是:rnrn2011-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(AbstractRefreshableApplicationContext.java:131)at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:509)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:427)at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)at JUnit.SSJMainTest.main(SSJMainTest.java:14)Caused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptorat java.lang.ClassLoader.defineClass1(Native Method)at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)at java.lang.ClassLoader.defineClass(ClassLoader.java:616)at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)at java.net.URLClassLoader.access$000(URLClassLoader.java:58)at java.net.URLClassLoader$1.run(URLClassLoader.java:197)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(URLClassLoader.java:190)at java.lang.ClassLoader.loadClass(ClassLoader.java:307)at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)at java.lang.ClassLoader.loadClass(ClassLoader.java:248)at org.springframework.transaction.config.TxAnnotationDrivenExecutor$AopAutoProxyConfigurer.configureAutoProxyCreator(TxAnnotationDrivenExecutor.java:113)at org.springframework.transaction.config.TxAnnotationDrivenExecutor.doExecute(TxAnnotationDrivenExecutor.java:11)at org.springframework.transaction.config.TxAnnotationDrivenExecutor.doExecute(TxAnnotationDrivenExecutor.java:1)at org.springframework.context.config.AbstractSpecificationExecutor.execute(AbstractSpecificationExecutor.java:43)at org.springframework.context.config.AbstractFeatureSpecification.execute(AbstractFeatureSpecification.java:75)at org.springframework.context.config.AbstractSpecificationBeanDefinitionParser.parse(AbstractSpecificationBeanDefinitionParser.java:44)at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1411)at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1401)at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:188)at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:144)at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:114)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)... 14 moreCaused by: java.lang.ClassNotFoundException: org.aopalliance.intercept.MethodInterceptorat java.net.URLClassLoader$1.run(URLClassLoader.java:202)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(URLClassLoader.java:190)at java.lang.ClassLoader.loadClass(ClassLoader.java:307)at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)at java.lang.ClassLoader.loadClass(ClassLoader.java:248)... 40 morernrn不知道这个org.springframework.aspects-3.1.0.M1.jar包是干什么用的,Spring2.5的时分装备AOP时要用到aspectj-1.6.11.M2.jar包,是不是Spring3.1还要用呢,不解。rn还有便是这句提示java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor,其实便是短少aopalliance-alpha1.jar包,可是从Spring官方网站下载下来的jar包里边底子没有这个jar包,后来即便我把这个jar包增加到项目里边也不可,又提示:rnException in thread main org.springframework.beans.factory.BeanCreationException: Error creating bean with name bookDaoImpl defined in file [E:\DevelopProject\MyEclipseProjects\mylibrary\WebRoot\WEB-INF\classes\cn\mylibrary\dao\impl\BookDaoImpl.class]: BeanPostProcessor before instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advicern我看了一下这个jar包里边底子没有Advice这个文件夹。rn又想了想假如Spring3.1真的支撑AOP的话为什么非要这个不可思议的jar包呢,已然用到又为什么不包含在自己的jar包里边呢,抑郁啊。

版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表AG环亚娱乐集团立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章