java常见的ClassNotFoundException

本文详细解析了在使用Hibernate与Spring框架时遇到的ClassNotFound问题,并提供了相应的解决方案,包括添加缺失的依赖库如aopalliance-1.0.jar和aspectjweaver.jar等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1 - java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
添加包common-logging.jar
2 - java.lang.ClassNotFoundException: javax.transaction.Synchronization
添加包jta.jar(hiberante)
3 - java.lang.ClassNotFoundException: org.dom4j.DocumentException
添加包dom4j-1.6.1.jar
4 - java.lang.ClassNotFoundException: org.apache.commons.collections.SequencedHashMap
添加包commons-collections.jar
5 - java.lang.ClassNotFoundException: net.sf.cglib.proxy.CallbackFilter
java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter
添加包cglib-2.1.3.jar
6 - java.lang.ClassNotFoundException: org.objectweb.asm.Type
添加包asm.jar
7 - java.lang.ClassNotFoundException: antlr.ANTLRException
添加包antlr.jar
8 - java.lang.ClassNotFoundException: net.sf.ehcache.CacheException
添加包ehcache-1.2.3.jar

9,Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V

将cglib.jar 由2.2版本 改为 2.1.
Hibernate与Spring结合时,出现下面的错误:

10,Caused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor

原因:缺少此包aopalliance-1.0.jar

11,Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.BCException

原因:缺少此包aspectjweaver.jar
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值