Start Play 2.2 app using sbt start works, but dist-ed version gives java.lang.IncompatibleClassChangeError

StackOverflow https://stackoverflow.com/questions/19117510

Pergunta

I have a Play 2.2 which is already running on a couple of systems. Today I deployed it to a fresh server running Ubuntu Server 13.04, with Java version 1.7.0_40b43.

Running the app using sbt start works flawlessly and everything is as I expected it to be... however, the sbt clean dist-ed version comes uip with the following exception:

Exception in thread "main" java.lang.IncompatibleClassChangeError: Implementing class
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:127)
    at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
    at play.db.jpa.JPAPlugin.onStart(JPAPlugin.java:35)
    at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
    at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
    at scala.collection.immutable.List.foreach(List.scala:318)
    at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:88)
    at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
    at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
    at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
    at play.api.Play$.start(Play.scala:87)
    at play.core.StaticApplication.<init>(ApplicationProvider.scala:52)
    at play.core.server.NettyServer$.createServer(NettyServer.scala:243)
    at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:279)
    at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:274)
    at scala.Option.map(Option.scala:145)
    at play.core.server.NettyServer$.main(NettyServer.scala:274)

I'm a bit in the dark on why the dist-ed version behaves different from the sbt start-ed version; and comes up with this error?

Foi útil?

Solução

I got it working eventually by adding "org.hibernate" % "hibernate" % "3.5.1-Final", as a dependency. Adding this triggered the dependency for 3.0.5 to be overriden, otherwise it ended up adding org.hibernate.hibernate-3.0.5.jar to the libs.

Still investigating why the other systems don't have issues with this.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top