java.lang.IllegalStateException:Failed to load ApplicationContext

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.