« Return to Thread: cglib 2.1_3 no dep and NPE in AbstractClassGenerator

cglib 2.1_3 no dep and NPE in AbstractClassGenerator

by Costin :: Rate this Message:

Reply to Author | View in Thread

Hi guys,

I get a strange NPE:

Caused by: java.lang.NullPointerException
        at net.sf.cglib.core.AbstractClassGenerator.getClassNameCache(AbstractClassGenerator.java:80)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:218)
        at net.sf.cglib.reflect.FastClass$Generator.create(FastClass.java:64)
        at net.sf.cglib.proxy.MethodProxy.helper(MethodProxy.java:81)
        at net.sf.cglib.proxy.MethodProxy.create(MethodProxy.java:47)
        at $java.util.ArrayList$$EnhancerByCGLIB$$99b990fd.CGLIB$STATICHOOK3(<generated>)
        at $java.util.ArrayList$$EnhancerByCGLIB$$99b990fd.<clinit>(<generated>)


which points to:

    private Set getClassNameCache(ClassLoader loader) {
        return (Set)((Map)source.cache.get(loader)).get(NAME_KEY);
    }

Basically, it seems that there the classloader asked from the cache, does not exist.
The problem occured when doing some proxying on OSGi for java.util.ArrayList. I'm completely buffled on why this occurs - seems to be working fine with other java classes such as java.util.Date.


Thanks,
 Costin

 « Return to Thread: cglib 2.1_3 no dep and NPE in AbstractClassGenerator