Classloader conflict, differing class definitions
-
11-12-2019 - |
Question
Using the Play 2.0.2 framework, I'm encountering a classloader conflict. Looks like there are two definitions of the same class in different classloaders. The console runs, but when i issue the 'run' command, play responds with:
java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "play.api.PlayException.cause()Lscala/Option;"
the class loader (instance of sbt/PlayCommands$$anonfun$61$$anonfun$63$$anon$2) of the current class, play/api/PlayException,
and the class loader (instance of java/net/URLClassLoader) for interface
play/api/PlayException$UsefulException have different Class objects for the
type scala/Option used in the signature
Anyone have a good place to start debugging this? Or some idea why this is occuring? Clearly the class is being loaded by different loaders, but I'm not familiar with the play loader configuration.
I have scala & sbt installed using port
sbt @0.11.2_0 (active)
scala2.9 @2.9.2_0 (active)
My PATH has play before the port binaries.
Using Java
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-10M3720)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)
Running Snow Leopard
Solution
Turns out the port sbt had created a ~/.sbt directory and that configuration is preferred. Removing / moving that directory to something else solves the problem.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow