spring3 常见异常解决
2016-02-12 01:44
501 查看
以下异常使用的是spring是3.1.1,是我自己学习中遇到的错误笔记,有可能不是都适用,仅做参考
异常1:java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
缺少包commons-logging的jar,本人下载了一个commons-logging-1.1.1.jar,引入,问题解决,下载地址点击打开链接
异常2:java.lang.NoClassDefFoundError: org/springframework/dao/support/PersistenceExceptionTranslator
缺少包,加入org.springframework.transaction-3.1.1.RELEASE.jar即可
异常3:Offending resource: class path resource
缺少包,加入org.springframework.aop-3.1.1.RELEASE.jar即可
异常4:java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
缺少包aopalliance-alpha1.jar
下载地址http://sourceforge.net/projects/aopalliance/files/ 下完引入
异常5:java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice
缺少包com.springsource.org.aopalliance-1.0.0.jar,下载地址点击打开链接下完引入
异常6: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'org.springframework.transaction.interceptor.TransactionInterceptor#0' must be of type [org.aopalliance.aop.Advice],
but was actually of type [org.springframework.transaction.interceptor.TransactionInterceptor]
原因是aopalliance-alpha1.jar和com.springsource.org.aopalliance-1.0.0.jar冲突了,删除前者(这里有点不是很明白,异常4的解决包怎么就可以删除了呢,是不是异常5的解决方法也适用于异常4,有待尝试)
异常7: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的包,下载地址http://sourceforge.net/projects/cglib/files/latest/download?source=files 下完引入
异常8:java.lang.NoClassDefFoundError: javax/mail/MessagingException
缺少activation.jar, mail.jar
异常1:java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
缺少包commons-logging的jar,本人下载了一个commons-logging-1.1.1.jar,引入,问题解决,下载地址点击打开链接
异常2:java.lang.NoClassDefFoundError: org/springframework/dao/support/PersistenceExceptionTranslator
缺少包,加入org.springframework.transaction-3.1.1.RELEASE.jar即可
异常3:Offending resource: class path resource
缺少包,加入org.springframework.aop-3.1.1.RELEASE.jar即可
异常4:java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
缺少包aopalliance-alpha1.jar
下载地址http://sourceforge.net/projects/aopalliance/files/ 下完引入
异常5:java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice
缺少包com.springsource.org.aopalliance-1.0.0.jar,下载地址点击打开链接下完引入
异常6: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'org.springframework.transaction.interceptor.TransactionInterceptor#0' must be of type [org.aopalliance.aop.Advice],
but was actually of type [org.springframework.transaction.interceptor.TransactionInterceptor]
原因是aopalliance-alpha1.jar和com.springsource.org.aopalliance-1.0.0.jar冲突了,删除前者(这里有点不是很明白,异常4的解决包怎么就可以删除了呢,是不是异常5的解决方法也适用于异常4,有待尝试)
异常7: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的包,下载地址http://sourceforge.net/projects/cglib/files/latest/download?source=files 下完引入
异常8:java.lang.NoClassDefFoundError: javax/mail/MessagingException
缺少activation.jar, mail.jar
相关文章推荐
- Spring Bean属性说明
- shfit+alt+s用于eclipse
- Java常用的数组排序
- jsp/servlet/struts/hibernate/spring内部实现机制
- java学习笔记之枚举类enum(转载)
- JUnit下测试SpringMVC的Controller
- 关于Spring MVC的参数绑定
- 如何处理大量并发用户访问网页,并且如何跟踪每个用户
- 从头认识Spring-2.1 自动装配(2)-byType(2)
- Struts2文件上传实例
- 从头认识Spring-2.1 自动装配(2)-byType(1)
- Struts2利用拦截器实现权限控制
- 从头认识Spring-2.1 自动装配(1)-byName
- java基础12多线程
- java中的构造方法
- java中的this
- java常见问题
- Java—设计模式(工厂模式)
- 栈的应用--四则运算表达式求值(java代码)
- JAVA比较两个日期相差的天数