1、第一个错误
Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Cannot create inner bean '(inner bean)#79fd5627' of type [org.springframework.aop.aspectj.AspectJExpressionPointcut] while setting bean property 'pointcut'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#79fd5627': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJExpressionPointcut]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException
翻译:
创建在类路径资源[applicationContext]中定义名为“dataSource”的bean时出错。bean实例化失败前的BeanPostProcessor;嵌套异常是org.springframework.beans.factory。创建名称为org.springframework.aop.support的bean时出错。DefaultBeanFactoryPointcutAdvisor#0':不能创建类型为[org.springframework.aop.aspectj的内部bean '(内部bean)#79fd5627'。当设置bean属性'pointcut'时;嵌套异常是org.springframework.beans.factory。BeanCreationException:创建带有名称的bean错误
解决这个错误很简单,是因为你有包没有导入,这里为了保险可以一次导入3个包
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.9</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjrt -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.8.9</version>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
如果解决了你基坑一很开心的继续敲代码了。
当时可能包导入pom文件暂时识别不到,请看下面一个错误
2、第二个错误Message Error creating bean with name 'org.springframework.aop.config.internalAutoProxyCreator': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory
翻译:
创建名为“org.springframework.aop.config.internalAutoProxyCreator”的bean时出现消息错误:bean初始化失败;嵌套异常是java.lang。NoClassDefFoundError:无法初始化类org.springframework.aop. aspectj.annot.reflectiveaspectjadvisorfactory
我看了很多文章搞了两三个小时,就是不明白为什么导包了还是会报错(现在也不知道)。当时我解决的方法是:
1、maven执行clean
2、重新再tomcat上部署项目,如果不会可以看看这个博主的文章非常的详细
https://blog.csdn.net/wt520it/article/details/88126654
然会就解决了!!!