I'm creating an MVC Spring webapp. Using: Jetty (servlet container), DataNucleus (dao platform), DB4O (embedded datastore).
When I persist an object (done from within a Spring Controller) using JDO from DataNucleus, it stores to the DB fine.
@PersistenceCapable
public class Test {
@Persistent
private String testString;
//getter-setters implemented
}
When I do a simple query for the objects I previously added I get a ClassCastException
on my Test class (can't cast a.b.c.Test
to a.b.c.Test
).
The classloader of Test returned by JDO is (toString) [sun.misc.Launcher$AppClassLoader@5acac268]
, the classloader of the Test class before I persisted it to the DB is [WebAppClassLoader@1593275665]
I've gotten this far, but I don't really know what to do with a classloader issue like this, I've never spent much thought on classloaders before. Any direction is helpful.