Hibernate 使用相关包的介绍
一,有些包是必须引入的包,有如下的包:
1,hibernate3.jar
2,asm.jar
3,cglib-2.1.3.jar
4,commons-collections-3.2.jar
5,commons-logging-1.0.4.jar
6,dom4j-1.6.1.jar
7,jta.jar
8,antlr-2.7.6.jar
二,Hibernate不导入包的相关错误(或使用低版本的)
Hibernate 不导入包antlr-2.7.6.jar的错误:
Exception in thread "main" java.lang.NoClassDefFoundError: antlr/ANTLRException...省... 或 java.lang.NoSuchMethodError: antlr.collections.AST.getLine()I ....省...., 同时如果存在低版本的 antlr-xxx.jar包, 如 antlr-2.7.2.jar,也会出现怪怪的错误。
Hibernate 不导入包hibernate3.jar的错误:
Exception in thread "main" java.lang.Error: Unresolved compilation problems: ....省....,
Hibernate 不导入包asm.jar的错误:
Exception in thread "main" java.lang.NoClassDefFoundError: org/objectweb/asm/Type ....省....,
Hibernate 不导入包cglib-2.1.3.jar的错误:
Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter ....省....,
Hibernate 不导入包commons-collections-3.2.jar的错误:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap ....省....,
Hibernate 不导入包commons-logging-1.0.4.jar的错误:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory ....省....,
Hibernate 不导入包dom4j-1.6.1.jar的错误:
Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/DocumentException ....省....,
Hibernate 不导入包jta.jar的错误:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/Synchronization ....省....,
参考: http://blog.csdn.net/ZB28_99/article/details/6370112