datanucleus-core icon indicating copy to clipboard operation
datanucleus-core copied to clipboard

Class loading inside the loadClass (PersistenceCapable) method, should use the classloader of the current class

Open andyjefferson opened this issue 8 years ago • 1 comments

current:

try
{
    return Class.forName(className);
}
catch (ClassNotFoundException e)
{
    throw new NoClassDefFoundError(e.getMessage());
}

and it should be:

try
{
    return Class.forName(className, false, CurrentClass.getClass().getClassLoader());
}
catch (ClassNotFoundException e)
{
    throw new NoClassDefFoundError(e.getMessage());
}

This change breaks test.jdo.general "org.datanucleus.tests.metadata.AnnotationsPersistentInterfacesTest". Change rolled back

andyjefferson avatar Apr 11 '16 08:04 andyjefferson