A good memory is better than a pen.
A problem has been encountered today when the project prompts the following error at startup:
Org.springframework.beans.factory.BeanDefinitionStoreException:Unexpected exception parsing XML document from class Path resource [com/ckinghan/spring7_auto/beans.xml]; Nested exception is java.lang.noclassdeffounderror:org/springframework/aop/targetsource at Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions ( xmlbeandefinitionreader.java:414) at Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (Xmlbeandefinitionreader.java : 336) at Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions ( xmlbeandefinitionreader.java:304) at Org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions ( abstractbeandefinitionreader.java:181) at Org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions ( abstractbeandefinitionreader.java:217) at Org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitionS (abstractbeandefinitionreader.java:188) at Org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions ( abstractbeandefinitionreader.java:252) 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:129) at Org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory ( abstractapplicationcontext.java:614) at Org.springframework.context.support.AbstractApplicationContext.refresh ( abstractapplicationcontext.java:515) at org.springframework.context.support.classpathxmlapplicationcontext.< Init> (classpathxmlapplicationcontext.java:139) at Org.springframework.context.sUpport. Classpathxmlapplicationcontext.<init> (classpathxmlapplicationcontext.java:83) at Com.ckinghan.spring7_auto . Testauto.testauto (Testauto.java:12) at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method) at Sun.reflect.
Nativemethodaccessorimpl.invoke (Unknown source) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown source) At Java.lang.reflect.Method.invoke (Unknown Source) at Org.junit.runners.model.frameworkmethod$1.runreflectivecall ( FRAMEWORKMETHOD.JAVA:50) at Org.junit.internal.runners.model.ReflectiveCallable.run (Reflectivecallable.java:12) A T org.junit.runners.model.FrameworkMethod.invokeExplosively (frameworkmethod.java:47) at Org.junit.internal.runners.statements.InvokeMethod.evaluate (invokemethod.java:17) at Org.junit.runners.ParentRunner.runLeaf (parentrunner.java:325) at Org.junit.runners.BlockJUnit4ClassRunner.runChild (blockjunit4classrunner.java:78) at Org.junit.runners.BlockJUnit4ClassRunner.runChild (Blockjunit4classrunner.java:57) at Org.junit.runners.parentrunner$3.run (parentrunner.java:290) at Org.junit.runners.P Arentrunner$1.schedule (parentrunner.java:71) at Org.junit.runners.ParentRunner.runChildren (parentrunner.java:288 ) at org.junit.runners.parentrunner.access$000 (parentrunner.java:58) at Org.junit.runners.parentrunner$2.evaluate ( parentrunner.java:268) at Org.junit.runners.ParentRunner.run (parentrunner.java:363) at Org.eclipse.jdt.internal.ju Nit4.runner.JUnit4TestReference.run (junit4testreference.java:86) at Org.eclipse.jdt.internal.junit.runner.TestExecution.run (testexecution.java:38) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:459) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:675) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (remotetestrunner.java:382) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (remotetestrunner.java:192) caused By:java.lang.noclassdeffounderror:org/springframework/aop/targetsource at Org.springframework.context.annotation.AnnotationConfigUtils.registerAnnotationConfigProcessors ( annotationconfigutils.java:154) at Org.springframework.context.annotation.ComponentScanBeanDefinitionParser.registerComponents ( componentscanbeandefinitionparser.java:149) at Org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse ( componentscanbeandefinitionparser.java:88) at Org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse (namespacehandlersupport.java:74) 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:172) at Org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions ( defaultbeandefinitiondocumentreader.java:142) at Org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions ( defaultbeandefinitiondocumentreader.java:94) at Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions ( xmlbeandefinitionreader.java:508) at Org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions ( xmlbeandefinitionreader.java:392) ... Panax caused By:java.lang.ClassNotFoundException:org.springframework.aop.TargetSource at Java.net.URLClassLoader. Findclass (Unknown source) at Java.lang.ClassLoader.loadClass (Unknown source) at SUN.MISC.LAUNCHER$APPCLASSLOADER.L Oadclass (Unknown source) at Java.lang.ClassLoader.loadClass (Unknown source) ...
More
Reason: Spring-aop-4.3.10.release package is not imported (note here that the corresponding version jar package needs to be imported, otherwise it may be an error);