Java Introduction to Mastery-the Spring2.5 of the wrong article using aspect to implement AOP times error: Error at:: 0 can ' t find referenced pointcut XXX

Source: Internet
Author: User

First, the problem description and the reason.

An error occurred when implementing AOP using aspect annotations at:: 0 can ' t find referenced pointcut XXX. I thought the annotations were wrong, and the result was that the two jar packages with the Aspectjweaver.jar and Aspectjrt.jar in Spring2.5 did not match JDK1.7.

Org.springframework.beans.factory.BeanCreationException:Error creating Bean with the name ' U ' defined in file [d:\ accelerated Data \3. Spring\ Academy Horse Soldier _spring_00_ Project source code \src\spring_1500_aop_annotation\bin\com\bjsxt\dao\impl\userdaoimpl.class]: Initialization of Bean failed; Nested exception is java.lang.IllegalArgumentException:error at:: 0 can ' t find referenced pointcut Mymethodat ORG.SPRINGF Ramework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:480) at Org.springframework.beans.factory.support.abstractautowirecapablebeanfactory$1.run ( abstractautowirecapablebeanfactory.java:409) at java.security.AccessController.doPrivileged (Native Method) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:380) at org.springframework.beans.factory.support.abstractbeanfactory$1. GetObject (abstractbeanfactory.java:264) at Org.springframework.beans.factory.support.DefaultSingletonBeanRegisTry.getsingleton (defaultsingletonbeanregistry.java:222) at Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:261) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:185) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:164) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:429) at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:728) at Org.springframework.context.support.AbstractApplicationContext.refresh ( abstractapplicationcontext.java:380) at org.springframework.context.support.classpathxmlapplicationcontext.< Init> (classpathxmlapplicationcontext.java:139) at Org.springframework.context.support.classpathxmlapplicationcontext.<init> ( classpathxmlapplicationcontext.java:83) at com.bjsxt.seRvice. Userservicetest.testadd (userservicetest.java:14) at Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:57) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (method.java:606) at Org.junit.runners.model.frameworkmethod$1.runreflectivecall ( frameworkmethod.java:47) at Org.junit.internal.runners.model.ReflectiveCallable.run (reflectivecallable.java:12) At org.junit.runners.model.FrameworkMethod.invokeExplosively (frameworkmethod.java:44) at Org.junit.internal.runners.statements.InvokeMethod.evaluate (invokemethod.java:17) at Org.junit.runners.ParentRunner.runLeaf (parentrunner.java:271) at Org.junit.runners.BlockJUnit4ClassRunner.runChild (blockjunit4classrunner.java:70) at Org.junit.runners.BlockJUnit4ClassRunner.runChild (BLOCKJUNIT4CLASSRUNNER.JAVA:50) at Org.junit.runners.parentrunner$3.run (parentrunner.java:238) at Org.junit.runners.ParentRuNner$1.schedule (parentrunner.java:63) at Org.junit.runners.ParentRunner.runChildren (parentrunner.java:236) at org.junit.runners.parentrunner.access$000 (parentrunner.java:53) at Org.junit.runners.parentrunner$2.evaluate ( parentrunner.java:229) at Org.junit.runners.ParentRunner.run (parentrunner.java:309) at Org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (JUNIT4TESTREFERENCE.JAVA:50) at Org.eclipse.jdt.internal.junit.runner.TestExecution.run (testexecution.java:38) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:467) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:683) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (remotetestrunner.java:390) at Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (remotetestrunner.java:197) caused by: Java.lang.IllegalArgumentException:error at:: 0 can ' t find referenced pointcut Mymethodat Org.aspectj.weaver.tools.PointcutParser.parsePointcutExpressioN (pointcutparser.java:317) at Org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression ( aspectjexpressionpointcut.java:206) at Org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch (aspectjexpressionpointcut.java:193 ) at Org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter (aspectjexpressionpointcut.java:174 ) at Org.springframework.aop.support.AopUtils.canApply (aoputils.java:195) at Org.springframework.aop.support.AopUtils.canApply (aoputils.java:250) at Org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply (aoputils.java:284) at Org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply ( abstractadvisorautoproxycreator.java:113) at Org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors ( ABSTRACTADVISORAUTOPROXYCREATOR.JAVA:85) at Org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean ( AbstracTADVISORAUTOPROXYCREATOR.JAVA:66) at Org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary ( abstractautoproxycreator.java:362) at Org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization ( abstractautoproxycreator.java:325) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization (abstractautowirecapablebeanfactory.java:361) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1344) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:473) ... Panax Notoginseng More


second, the solution.

Upgrade the versions of the two jar packages of Aspectjweaver.jar and Aspectjrt.jar to run successfully with the two versions of the jar packages aspectjweaver-1.7.0 and aspectjrt-1.7.2.

<<jar Package Download >>

third, summary.
in our development we have to pay attention to whether the JDK matches the versions of the jar packages sometimes, although the JDK is upgraded but the jar we want to use is not adapted to a later JDK, we're going to downgrade the JDK or use another jar package that's already adapted to the latest JDK.

Java Introduction to Mastery-the Spring2.5 of the wrong article using aspect to implement AOP times error: Error at:: 0 can ' t find referenced pointcut XXX

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.