码迷,mamicode.com
首页 > 编程语言 > 详细

java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.MetadataProvider

时间:2015-05-21 01:16:31      阅读:328      评论:0      收藏:0      [点我收藏+]

标签:

Caused by: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.getDeclaredConstructor(Class.java:1985)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newConfiguration(LocalSessionFactoryBean.java:818)
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:549)
    at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
    ... 39 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.MetadataProvider
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    ... 49 more

 

错误原因:使用了hibernate-commons-annotations 3.3.0.ga

解答:http://forum.springsource.org/showthread.php?t=89693

You have to use hibernate-commons-annotations version 3.2.0.Final, because 3.3.0.ga is an invalid version as stated in the README.TXT in the maven repository folder:

"Version ‘3.3.0.ga‘ was a mistake during the release process, please disregard.
There is not such version 3.3.0.ga."

Version 3.2.0.Final includes the missing MetadataProvider

 

java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.MetadataProvider

标签:

原文地址:http://www.cnblogs.com/toSeeMyDream/p/4518581.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!