When using AspectJ to annotate aspects today, I encountered an error.
The cutpoint expression is unrecognizable-the detailed error message is as follows:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xingoo' defined in class path resource [bean.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut performance at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.spring.test.chap44.test.main(test.java:8) Caused by: java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut performance at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:315) at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:195) at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch(AspectJExpressionPointcut.java:181) at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter(AspectJExpressionPointcut.java:162) at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:200) at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:254) at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:286) at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117) at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87) at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1426) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) ... 11 more
I searched the Internet and found that the JDK does not match.
The JDK1.7 I used originally matches aspectjrt.1.6 and aspectjweaver.1.6, so an error will be reported.
If you want to use AspectJ to complete the annotation aspect, you need to pay attention to the following JDK and AspectJ matching:
JDK1.6 —— aspectJ1.6
JDK1.7 —— aspectJ1.7.3+
Read More:
- How to Solve Error: Cannot find the declaration of element ‘beans’.
- How to Solve Error: IncompleteElementException: Could not find result map…
- Tk.mapper Common mapper Error: Error creating bean with name ‘commonMapper‘ defined in file xxx
- How to Solve AOP error in Spring
- How to Solve Koa Error: Cannot find module ‘koa-router‘
- How to Solve Error: Cannot find module ‘webpack/lib/RequestShortener’
- How to Solve Error “Could not find com.android.tools.build:gradle:3.0.1”
- How to Solve Loadrunner Error: Failed to find .cfg file
- How to Solve QT Error: The build directory needs to be at the same level as the source directory.
- How to Solve Error: Type mismatch: cannot convert from Object to Car
- How to Solve “Status bar could not find cached time string image. Rendering in-process.” in Xcode
- How to Solve Spring MVC upload file error
- [Solved] flitter Name Route Error: Could not find a generator for route RouteSettings(“XXX”, null) in the _WidgetsAppState
- [Solved] Eslint error: /xxx/components/xxx import should occur after import of /xxx/utils/xxx
- How to Solve Gradle Error: Plugin with id ‘jetty’ not found.
- How to Solve Error creating bean with name ‘log’loginController’
- How to Solve elasticsearch-7.15.1 operation errors
- ApplicationContext.xml file header error Referenced file contains errors
- How to Solve Springboot Error: Failed to convert value of type
- How to Fix ERROR Couldn’t connect to Docker daemon at http+docker://localunixsocket