简体   繁体   English

将Play Framework 1.2.5 Hibernate升级到v 4.2.4

[英]Play Framework 1.2.5 Hibernate upgrade to v 4.2.4

I am trying to upgrade the Hibernate v 3.6 (Packaged with Play Framework 1.2.5) to Hibernate 4.2.4. 我正在尝试将Hibernate v 3.6(与Play Framework 1.2.5打包)升级到Hibernate 4.2.4。

I have edited the dependencies.yml to fetch from maven jboss repo. 我已经编辑了dependencies.yml以从maven jboss回购中获取。 I have also ran play deps --sync and see the jars added to lib/. 我还运行了play deps --sync并看到将jar添加到lib /。

Now when I run the application, I get the following...stack trace. 现在,当我运行该应用程序时,将得到以下...堆栈跟踪。

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]

I guessed the error was because of multiple hibernate jars being referenced in the classpath. 我猜错是因为在类路径中引用了多个休眠jar。 This was true, so I manually edited the classpath to remove the old hibernate jars. 的确如此,因此我手动编辑了类路径以删除旧的休眠jar。 But that didn't help either. 但这也无济于事。

I guess hibernate 3.x and 4.x are not fully compatible so you have to modify some source code of the framework itself to use this version of hibernate. 我猜想hibernate 3.x和4.x不能完全兼容,因此您必须修改框架本身的某些源代码才能使用此版本的hibernate。

You can start from the 1.3.x github branch that is shipped with hibernate 4.1.3 : https://github.com/playframework/play1/tree/1.3.x 您可以从hibernate 4.1.3附带的1.3.x github分支开始: https : //github.com/playframework/play1/tree/1.3.x

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM