Spring项目中用idea使用ProceedingJoinPoint类报错

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_37788081/article/details/82763876

idea使用ProceedingJoinPoint报错

Error:(18, 45) java: 无法访问org.aspectj.lang.ProceedingJoinPoint 找不到org.

信息: Using TestExecutionListeners: [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@3fb6a447, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@79b4d0f, org.springframework.test.context.support.DirtiesContextTestExecutionListener@6b2fad11, org.springframework.test.context.transaction.TransactionalTestExecutionListener@79698539, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@73f792cf]
九月 18, 2018 8:14:16 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [spring_aop/Spring-Config.xml]
九月 18, 2018 8:14:17 下午 org.springframework.context.support.GenericApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.GenericApplicationContext@4439f31e: startup date [Tue Sep 18 20:14:17 GMT+08:00 2018]; root of context hierarchy
九月 18, 2018 8:14:17 下午 org.springframework.context.support.GenericApplicationContext refresh
警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in class path resource [spring_aop/Spring-Config.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0': Cannot create inner bean '(inner bean)#7a52f2a2' of type [org.springframework.aop.aspectj.AspectJMethodBeforeAdvice] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#7a52f2a2': Failed to introspect bean class [org.springframework.aop.aspectj.AspectJMethodBeforeAdvice] for lookup method metadata: could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: org/aspectj/lang/JoinPoint
九月 18, 2018 8:14:17 下午 org.springframework.test.context.TestContextManager prepareTestInstance
严重: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@79b4d0f] to prepare test instance [spring_aop.Demo@527e5409]
java.lang.IllegalStateException: Failed to load ApplicationContext
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
	at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)

错误原因:使用idea创建的Spring项目自动导包中缺少一个jar包,或者导入到包版本不匹配,
解决方法:导入一个jar包即可,
点击进入下载地,我有注明具体是哪个包
点击链接


导入包之后问题解决:

猜你喜欢

转载自blog.csdn.net/qq_37788081/article/details/82763876