当我运行hibernate示例时,它显示了这样的消息

时间:2014-12-29 06:40:11

标签: hibernate derby

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    at org.hibernate.cfg.AnnotationConfiguration.<clinit>(AnnotationConfiguration.java:65)
    at com.Hibernate.Chapter1.TestEmployee.main(TestEmployee.java:10)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 2 more

1 个答案:

答案 0 :(得分:1)

您必须包含与罐子相关的公共区域。 我想你错过了以下的jar或相关的jar ..

<强> Apache的commons.jar