Play Framework 1.2.5 Hibernate upgrade to v 4.2.4

454 Views Asked by At

I am trying to upgrade the Hibernate v 3.6 (Packaged with Play Framework 1.2.5) to Hibernate 4.2.4.

I have edited the dependencies.yml to fetch from maven jboss repo. I have also ran play deps --sync and see the jars added to 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. This was true, so I manually edited the classpath to remove the old hibernate jars. But that didn't help either.

1

There are 1 best solutions below

0
On

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.

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