【发布时间】:2016-11-17 20:51:23
【问题描述】:
我遇到了休眠问题。问题:在 ServletContext 资源 [/WEB-INF/spring/appServlet/servlet-context.xml] 中定义名称为“emf”的 bean 创建错误:调用 init 方法失败;嵌套异常是 java.lang.NoSuchMethodError: org.hibernate.cfg.Environment.verifyProperties(Ljava/util/Map;)V
它是xml文件(servlet-context):http://pastebin.com/BRYvbVTg
而且,我只有一个来自 hibernate 的依赖项:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.2.4.Final</version>
</dependency>
在classpath下,尝试添加所有包,效果一样
完整的堆栈跟踪:http://pastebin.com/wJy7QfPW
【问题讨论】:
-
最好添加完整的堆栈跟踪。
-
看到这个答案stackoverflow.com/questions/11553202/…,看起来像是类路径上的一些旧版本的休眠
-
如何从 Maven (Linux) 中删除本地库?
标签: java spring hibernate servlets