Java Spring AOP writes the MAVEN project, and at compile time the error message is as follows:
java.lang.IllegalStateException:Failed to load ApplicationContext
caused by:org.springframework.beans.factory.BeanCreationException:Error creating bean with Name ' CustomerService ' Defined in class path resource [Applicationcontext.xml]: Beanpostprocessor before instantiation of Bean failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Org.springframework.aop.support.defaultbeanfactorypointcutadvisor#0 ': Cannot resolve reference to beans ' mycut ' while Setting bean property ' pointcut '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' mycut ': Failed to Introspect beans class [Org.springframework.aop.aspectj.AspectJExpressionPointcut] for lookup method metadata: Could not find class, it depends on; Nested exception is java.lang.noclassdeffounderror:org/aspectj/weaver/reflect/reflectionworld$ Reflectionworldexception
At first I thought it was
@RunWith (Springjunit4classrunner.class)
@ContextConfiguration (locations= "Classpath:applicationContext.xml")
Path configuration issues,
Found a problem with the <mirrors> configuration in D:\Program files\apache-maven-3.2.3\conf\settings.xml file later:
<!--use a repository with the following statement--
<!--to use the network (official website Central warehouse), comment out, the default is not the statement, not add the line--
<mirror>
<id>my</id>
<mirrorOf>*</mirrorOf>
<name>human readable name for this mirror.</name>
<url> Warehouse Address </url>
</mirror>
Even if the same error is reported after the change, the reason:
Jar Package Once a download error occurs, the. lastupdated file is generated in the Repository folder.
The corresponding. lastupdated file must be found and deleted in the D:\Program files\apache-maven-3.2.3\repository to be downloaded from the central repository again, otherwise it will not be downloaded.
Batch delete. lastupdated file tip: Create a Cleanlastupdated.bat file double-click to run.
The contents of the file are as follows:
Set Repository_path=d:\program files\apache-maven-3.2.3\repository
REM is searching ...
for/f "delims="%%i in (' dir/b/S "%repository_path%\*lastupdated" ') Do (
DEL/S/q%%i
)
REM Search Complete
Pause
<!--beginners, for the first time to publish a blog, if there is not the wrong place also forgive me! -
java.lang.IllegalStateException:Failed to load ApplicationContext