其他分享
首页 > 其他分享> > org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML doc

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML doc

作者:互联网

学习SpringAop时发现运行时报错:

D:\java\jdk1.8.0_291\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:D:\idea\IntelliJ IDEA 2018.3.1\lib\idea_rt.jar=58375:D:\idea\IntelliJ IDEA 2018.3.1\bin" -Dfile.encoding=UTF-8 -classpath "D:\idea\IntelliJ IDEA 2018.3.1\lib\idea_rt.jar;D:\idea\IntelliJ IDEA 2018.3.1\plugins\junit\lib\junit-rt.jar;D:\idea\IntelliJ IDEA 2018.3.1\plugins\junit\lib\junit5-rt.jar;D:\java\jdk1.8.0_291\jre\lib\charsets.jar;D:\java\jdk1.8.0_291\jre\lib\deploy.jar;D:\java\jdk1.8.0_291\jre\lib\ext\access-bridge-64.jar;D:\java\jdk1.8.0_291\jre\lib\ext\cldrdata.jar;D:\java\jdk1.8.0_291\jre\lib\ext\dnsns.jar;D:\java\jdk1.8.0_291\jre\lib\ext\jaccess.jar;D:\java\jdk1.8.0_291\jre\lib\ext\jfxrt.jar;D:\java\jdk1.8.0_291\jre\lib\ext\localedata.jar;D:\java\jdk1.8.0_291\jre\lib\ext\nashorn.jar;D:\java\jdk1.8.0_291\jre\lib\ext\sunec.jar;D:\java\jdk1.8.0_291\jre\lib\ext\sunjce_provider.jar;D:\java\jdk1.8.0_291\jre\lib\ext\sunmscapi.jar;D:\java\jdk1.8.0_291\jre\lib\ext\sunpkcs11.jar;D:\java\jdk1.8.0_291\jre\lib\ext\zipfs.jar;D:\java\jdk1.8.0_291\jre\lib\javaws.jar;D:\java\jdk1.8.0_291\jre\lib\jce.jar;D:\java\jdk1.8.0_291\jre\lib\jfr.jar;D:\java\jdk1.8.0_291\jre\lib\jfxswt.jar;D:\java\jdk1.8.0_291\jre\lib\jsse.jar;D:\java\jdk1.8.0_291\jre\lib\management-agent.jar;D:\java\jdk1.8.0_291\jre\lib\plugin.jar;D:\java\jdk1.8.0_291\jre\lib\resources.jar;D:\java\jdk1.8.0_291\jre\lib\rt.jar;D:\workspaceidea\Spring5_demo1\out\production\Spring5_Aop;D:\workspaceidea\Spring5_Aop\lib\spring-core-5.2.6.RELEASE.jar;D:\workspaceidea\Spring5_Aop\lib\spring-expression-5.2.6.RELEASE.jar;D:\workspaceidea\Spring5_Aop\lib\spring-beans-5.2.6.RELEASE.jar;D:\workspaceidea\Spring5_Aop\lib\spring-context-5.2.6.RELEASE.jar;D:\workspaceidea\Spring5_Aop\lib\spring-aspects-5.2.6.RELEASE.jar;D:\workspaceidea\Spring5_Aop\lib\druid-1.1.9.jar;D:\workspaceidea\Spring5_Aop\lib\commons-logging-1.1.1.jar;D:\workspaceidea\Spring5_Aop\lib\com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar;D:\workspaceidea\Spring5_Aop\lib\com.springsource.org.aopalliance-1.0.0.jar;D:\workspaceidea\Spring5_Aop\lib\com.springsource.net.sf.cglib-2.2.0.jar;D:\workspaceidea\Spring5_demo1;D:\Maven\apache-maven-3.8.5\mvn_repositary\junit\junit\4.12\junit-4.12.jar;D:\Maven\apache-maven-3.8.5\mvn_repositary\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 AOPAnno.Test.TestAOP,testAopAnno

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [bean1.xml]; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/TargetSource

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:417)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:338)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
... 47 more


Process finished with exit code -1

 

解决方法:原因  没有导入相应的aop的jar包 导入完美解决

 

标签:XML,exception,Unexpected,java,lib,jre,jar,jdk1.8,291
来源: https://www.cnblogs.com/yjj-hds78/p/16035277.html