我正在尝试将 Hibernate v 3.6(与 Play Framework 1.2.5 一起打包)升级到 Hibernate 4.2.4。
我已经编辑了 dependencies.yml 以从 maven jboss repo 中获取。我还运行了 play deps --sync 并查看了添加到 lib/.
现在,当我运行应用程序时,我得到以下...堆栈跟踪。
java.lang.IllegalAccessError: tried to access method org.hibernate.cfg.Configuration.<init>(Lorg/hibernate/cfg/SettingsFactory;)V from class org.hibernate.ejb.Ejb3Configuration
org.hibernate.ejb.Ejb3Configuration [Ejb3Configuration.java : 161]
play.db.jpa.JPAPlugin [JPAPlugin.java : 118]
play.plugins.PluginCollection [PluginCollection.java : 525]
play.Play [Play.java : 526]
play.Play [Play.java : 630]
play.Invoker$Invocation [Invoker.java : 198]
play.server.PlayHandler$NettyInvocation [PlayHandler.java : 189]
play.Invoker$Invocation [Invoker.java : 276]
play.server.PlayHandler$NettyInvocation [PlayHandler.java : 229]
java.util.concurrent.Executors$RunnableAdapter [Executors.java : 471]
java.util.concurrent.FutureTask$Sync [FutureTask.java : 334]
java.util.concurrent.FutureTask [FutureTask.java : 166]
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask [ScheduledThreadPoolExecutor.java : 178]
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask [ScheduledThreadPoolExecutor.java : 292]
java.util.concurrent.ThreadPoolExecutor [ThreadPoolExecutor.java : 1145]
java.util.concurrent.ThreadPoolExecutor$Worker [ThreadPoolExecutor.java : 615]
java.lang.Thread [Thread.java : 722]
我猜这个错误是因为在类路径中引用了多个休眠 jar。这是真的,所以我手动编辑了类路径以删除旧的休眠 jar。但这也无济于事。