Note that there are some explanatory texts on larger screens.

plurals
  1. POClassNotFoundException when running integration tests with SBT when a library tries to access a class from another one
    text
    copied!<p>We have a complex Scala project using many different libraries from the Scala / Java world. We use lift-json for generating Json output from our data source. Sometimes, we need to cache some part of it to memcached. We use spymemcached for this. In some cases, we cache sequences of lift-json JObject in Memcached directly, without using any other abstraction over it.</p> <p>This works great:</p> <ul> <li>In production</li> <li>When running integration tests from out IDE (IntelliJ)</li> <li>On our staging environment</li> </ul> <p>However, when running our integration tests using <code>sbt it:test</code>, We get the following exception from Spymemcached:</p> <pre><code>2013-03-07 13:26:04.393 WARN net.spy.memcached.transcoders.SerializingTranscoder: Caught CNFE decoding 4074 bytes of data java.lang.ClassNotFoundException: net.liftweb.json.JsonAST$JObject at java.net.URLClassLoader$1.run(URLClassLoader.java:366) 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:423) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:266) at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:622) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1593) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at scala.collection.immutable.$colon$colon.readObject(List.scala:404) at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1004) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1872) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1777) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at net.spy.memcached.transcoders.BaseSerializingTranscoder.deserialize(BaseSerializingTranscoder.java:100) at net.spy.memcached.transcoders.SerializingTranscoder.decode(SerializingTranscoder.java:66) at net.spy.memcached.transcoders.TranscodeService$1.call(TranscodeService.java:42) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at net.spy.memcached.transcoders.TranscodeService$Task.run(TranscodeService.java:89) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) </code></pre> <p>Our tests are still running, so this is a low-priority bug. But we want to have our tests run in a environment as close as possible to production (where this actually works). I would like spymemcached to know about the existence of lift-json every time.</p> <p>This looks like a classpath issue, but I have a hard-time finding exactly how to find this issue.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload