[infinispan-dev] removing Cache::with(CL)
Paul Ferraro
paul.ferraro at redhat.com
Fri May 11 12:03:55 EDT 2012
On Fri, 2012-05-11 at 10:24 +0200, Ales Justin wrote:
> > The details of the query module are a little out of my realm of
> > experience. I'm CC'ing infinispan-dev, to open up the larger discussion
> > to classloading and compatibility with modular environments.
> >
> > Off the top of my head, it seems like you need a custom
> > KeyTransformationHandler that can resolve classes using a ModuleLoader
> > (i.e. module ID + class name). Thoughts?
>
> That's one way of solving it.
>
> But AdvancedCache::with(CL) already solves this problem - that's why I used it (I remembered later :-)).
But that only helps during serialization - not deserialization where
this classloader is no longer available, thus class resolution will
fail.
> Where I think the two: AC::with(CL) and ServiceModuleLoader impl of ClassResolver, should no be connected.
> Since they solve diff problems, imo.
True, but with(CL) can really only be used (e.g. in a cluster, with a
cache store, etc.) if storeAsBinary is enabled - for the reason
mentioned above.
> Anyway, I'm now gonna try and hunt down where plain ML impl of CR somes in ...
>
> -Ales
>
> > On Thu, 2012-05-10 at 23:10 +0200, Ales Justin wrote:
> >> If I do <subject> I get this CNFE, see below.
> >>
> >> Looks like I still need a combination of Cache::with(CL) -- so this code sees Key class,
> >> and at the same time I don't want Infinispan to depend on GAE API.
> >> Where I also need to have SML as ClassResolver.
> >>
> >> Are you sure setting CL on Cache breaks ClassResolver?
> >>
> >> -Ales
> >>
> >> ---
> >>
> >> 23:00:50,321 ERROR [org.infinispan.query.backend.KeyTransformationHandler] (http-/192.168.1.101:8080-2) ISPN014001: Could not locate key class com.google.appengine.api.datastore.Key: java.lang.ClassNotFoundException: com.google.appengine.api.datastore.Key
> >> at java.net.URLClassLoader$1.run(URLClassLoader.java:202) [classes.jar:1.6.0_31]
> >> at java.security.AccessController.doPrivileged(Native Method) [classes.jar:1.6.0_31]
> >> at java.net.URLClassLoader.findClass(URLClassLoader.java:190) [classes.jar:1.6.0_31]
> >> at java.lang.ClassLoader.loadClass(ClassLoader.java:306) [classes.jar:1.6.0_31]
> >> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) [classes.jar:1.6.0_31]
> >> at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [classes.jar:1.6.0_31]
> >> at java.lang.Class.forName0(Native Method) [classes.jar:1.6.0_31]
> >> at java.lang.Class.forName(Class.java:247) [classes.jar:1.6.0_31]
> >> at org.infinispan.util.Util.loadClassStrict(Util.java:127) [infinispan-core-5.2.0-SNAPSHOT.jar:5.2.0-SNAPSHOT]
> >> at org.infinispan.query.backend.KeyTransformationHandler.getCustomTransformer(KeyTransformationHandler.java:108)
> >> at org.infinispan.query.backend.KeyTransformationHandler.stringToKey(KeyTransformationHandler.java:96)
> >> at org.infinispan.query.impl.CacheQueryImpl.fromEntityInfosToKeys(CacheQueryImpl.java:174)
> >> at org.infinispan.query.impl.CacheQueryImpl.iterator(CacheQueryImpl.java:144)
> >> at org.infinispan.query.impl.CacheQueryImpl.iterator(CacheQueryImpl.java:137)
> >> at org.jboss.capedwarf.datastore.query.PreparedQueryImpl.createQueryIterator(PreparedQueryImpl.java:108) [capedwarf-datastore-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
> >> at org.jboss.capedwarf.datastore.query.PreparedQueryImpl.asQueryResultIterator(PreparedQueryImpl.java:73) [capedwarf-datastore-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
> >> at org.jboss.capedwarf.datastore.query.PreparedQueryImpl.asIterator(PreparedQueryImpl.java:64) [capedwarf-datastore-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
> >> at org.jboss.capedwarf.datastore.query.PreparedQueryImpl.asIterator(PreparedQueryImpl.java:60) [capedwarf-datastore-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
> >> at org.jboss.test.capedwarf.datastore.test.PreparedQueryTestCase.testAsIteratorWithOptionstestCountEntities(PreparedQueryTestCase.java:77) [classes:]
> >>
> >
> >
>
More information about the infinispan-dev
mailing list