java.lang.NoSuchMethodError: org.hibernate.cfg.Environment.verifyProperties

我在使用jpa2+spring4+hibernate4 的时候,报错java.lang.NoSuchMethodError: org.hibernate.cfg.Environment.verifyProperties

查了很多资料,是因为jar包问题,

我修改了

<dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>3.3.0.ga</version>
        </dependency>

改成

<dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>4.0.5.Final</version>
        </dependency>

或者直接删除,maven 根据hiberenate-core 4 自动引入

 

参考链接:

https://stackoverflow.com/questions/11553202/java-lang-nosuchmethoderror-org-hibernate-cfg-environment-verifyproperties

posted @ 2018-01-11 10:30  litblack  阅读(366)  评论(0编辑  收藏  举报