codahale/jerkson — Issue #35: CaseClassSigParser#loadClass fails for external jars (Maven vs IDE)
Author: astubbs
Created: 2011-10-20 10:19:40+00:00
State: open

My stuff works fine in IDE, but when running from Maven, my tests fail:

[main] ERROR c.s.j.s.container.ContainerResponse - The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.ClassNotFoundException: com.foo.bar.Bottle
at java.net.URLClassLoader$1.run(URLClassLoader.java:202) ~[na:1.6.0_26]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_26]
at java.net.URLClassLoader.findClass(URLClassLoader.java:190) ~[na:1.6.0_26]
at java.lang.ClassLoader.loadClass(ClassLoader.java:306) ~[na:1.6.0_26]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) ~[na:1.6.0_26]
at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ~[na:1.6.0_26]
at com.codahale.jerkson.util.CaseClassSigParser$.loadClass(CaseClassSigParser.scala:135) ~[jerkson_2.9.1-0.4.2.jar:na]
at com.codahale.jerkson.util.CaseClassSigParser$.findRootClass(CaseClassSigParser.scala:49) ~[jerkson_2.9.1-0.4.2.jar:na]
at com.codahale.jerkson.util.CaseClassSigParser$.parseScalaSig(CaseClassSigParser.scala:42) ~[jerkson_2.9.1-0.4.2.jar:na]
at com.codahale.jerkson.util.CaseClassSigParser$.findSym(CaseClassSigParser.scala:56) ~[jerkson_2.9.1-0.4.2.jar:na]
at com.codahale.jerkson.util.CaseClassSigParser$.parse(CaseClassSigParser.scala:83) ~[jerkson_2.9.1-0.4.2.jar:na]

Works fine in IDE (dependent jar containing the class is a part of the modular project). Class loading issue?
I can construct an instance of the class (Bottle) just fine at the beginning of the unit test.