Spring Aop开发过程中可能出现的异常(通过这些异常可以知道需要什么Jar包)

简介: 出现的问题解决: 问题1:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.util.ClassUtils.<clinit>(ClassUtils.java:67)   at org.sprin
出现的问题解决: 
问题1:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.util.ClassUtils.<clinit>(ClassUtils.java:67)   at org.springframework.core.io.DefaultResourceLoader.<init>(DefaultResourceLoader.java:52) at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:184) at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:80) at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:58)   at 
需要加上:commons-logging.jar log4j-1.2.11.jar 

问题2:Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [text.xml]; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException 
Caused by: java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException 
    at java.lang.Class.forName0(Native Method) 

需要加上:aspectjweaver.jar 

问题3:Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘logBean’ defined in class path resource [text.xml]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the classpath or specify proxy interfaces. 
Caused by: org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces. 
需要加上:cglib-nodep-2.2.jar 


问题4:xception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘logBean’ defined in class path resource [text.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError:org/objectweb/asm/Type 
Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/Type 
    at net.sf.cglib.core.TypeUtils.parseType(TypeUtils.java:180) 
需要加上:asm.jar 

问题5: Exception in thread "main" java.lang.IllegalArgumentException: warning no match for this type name: Performer [Xlint:invalidAbsoluteTypeName] 
        at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:315) 
        at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:197)
        at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch(AspectJExpressionPointcut.java:184)
        at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter(AspectJExpressionPointcut.java:165)
        at org.springframework.aop.framework.DefaultAdvisorChainFactory.getInterceptorsAndDynamicInterceptionAdvice(DefaultAdvisorChainFactory.java:60)
        at org.springframework.aop.framework.AdvisedSupport.getInterceptorsAndDynamicInterceptionAdvice(AdvisedSupport.java:465)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:190) 
        at $Proxy0.perform(Unknown Source) 
这种问题一般是由execution表达式写法上的错误导致无法找到匹配的类型 
目录
相关文章
|
3小时前
|
Java
springboot全局自定义异常
springboot全局自定义异常
|
3小时前
|
前端开发 安全 Java
使用Spring框架加速Java开发
使用Spring框架加速Java开发
53 0
|
3小时前
|
传感器 人工智能 前端开发
JAVA语言VUE2+Spring boot+MySQL开发的智慧校园系统源码(电子班牌可人脸识别)Saas 模式
智慧校园电子班牌,坐落于班级的门口,适合于各类型学校的场景应用,班级学校日常内容更新可由班级自行管理,也可由学校统一管理。让我们一起看看,电子班牌有哪些功能呢?
101 4
JAVA语言VUE2+Spring boot+MySQL开发的智慧校园系统源码(电子班牌可人脸识别)Saas 模式
|
3小时前
|
安全 Java Docker
|
3小时前
|
IDE Java 开发工具
Spring Boot DevTools:加速开发的热部署工具
【4月更文挑战第28天】在Spring Boot的开发过程中,快速反馈和效率至关重要。Spring Boot DevTools是一个为开发者设计的模块,支持热部署(hot swapping),能够实现应用的快速重启和自动重载,极大地提高了开发效率。本篇博客将介绍Spring Boot DevTools的核心概念,并通过具体的实战示例展示如何在开发过程中利用这一工具。
24 0
|
3小时前
|
开发框架 前端开发 安全
Java从入门到精通:2.2.2学习使用Spring框架进行Web应用开发
Java从入门到精通:2.2.2学习使用Spring框架进行Web应用开发
|
3小时前
|
监控 Java 测试技术
使用 Spring Boot 简化企业级应用开发
【4月更文挑战第19天】Spring Boot简化企业级应用开发,加速项目初始化与配置,轻松集成多种技术,降低依赖管理复杂性。它提高开发效率,具备灵活扩展性,便于监控管理,且高度可测试。强大的社区支持解决问题迅速,助力企业快速推出高质量应用,提升市场竞争力。开发者掌握Spring Boot能增强自身价值。
|
3小时前
|
前端开发 Java 应用服务中间件
选择 Spring Boot 进行微服务开发的 7 大理由
选择 Spring Boot 进行微服务开发的 7 大理由
22 1
|
3小时前
|
运维 自然语言处理 安全
Spring Boot 底层级探索系列 04 - Web 开发(3)
Spring Boot 底层级探索系列 04 - Web 开发(3)
27 0
|
3小时前
|
JSON Java fastjson
Spring Boot 底层级探索系列 04 - Web 开发(2)
Spring Boot 底层级探索系列 04 - Web 开发(2)
31 0