NoClassDefFoundError:org / hibernate / annotations / common / reflection / MetadataProvider
我在我的pom.xml中定义了依赖项
org.hibernate hibernate-commons-annotations 3.3.0.ga
我在C中有上面的jar :/User/.m2/repository/org/hibernate/hibernate-commons-annotations/3.3.0.ga
我在hibernate.cfg.xml中配置了会话工厂和数据源,并尝试在我的main方法中构建配置:
Configuration configuration = new Configuration().configure(); StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()); SessionFactory sessionFactory = configuration.buildSessionFactory(builder.build()); Session session = sessionFactory.openSession();
我明白了:
Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
我已经尝试在我的Build Path和我的WEB-INF / lib中直接添加hibernate-commons-annotion jar,但是还没有运气
这是以相同的方式设置并在我构建的另一个应用程序上正常运行,这不需要导入的注释jar。 有任何想法吗?
显然3.3.0.ga是一个’错误’,不得不更新依赖使用3.2.0.Final
org.hibernate hibernate-commons-annotations 3.2.0.Final
资料来源 : https : //hibernate.atlassian.net/browse/ANN-711
- java.lang.NumberFormatException:用于JSP页面中的输入字符串
- 为什么Hibernate内联传递给JPA Criteria Query的整数参数列表?
- Hibernate hbm2ddl.auto默认值
- 没有xml的spring + hibernate映射类
- 如何使用Hibernate为Spring数据JPA的所有查找方法添加全局where子句?
- NoSuchMethodError:org.hibernate.SessionFactory.getCurrentSession()
- 创建名为’sessionFactory’的bean时出错无法实例化默认tuplizer
- Session.update和HibernateTemplate.merge之间的Hibernate更新之间的区别
- 没有合适的司机。 尝试使用Hibernate连接到Heroku上的postgresql数据库