HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › General questions / FAQ › Custom PD4ML classloader › Re: Re: Custom PD4ML classloader
Current versions load the class like that:
[language=java:f8vh12om]Class c = Class.forName(className);
ResourceProvider provider = (ResourceProvider) c.newInstance();[/language:f8vh12om]
We’ve just changed to
[language=java:f8vh12om]Class c;
try {
c = Class.forName(className);
} catch (ClassNotFoundException e) {
try {
c = Thread.currentThread().getContextClassLoader().loadClass(className);
} catch (ClassNotFoundException e1) {
c = ResourceCache.class.getClassLoader().loadClass(className);
}
}[/language:f8vh12om]
(ResourceCache is one of PD4ML classess)
In theory it should help. Please contact support pd4ml com if you have anything to add to the code or if you want to test it with your application before we released new version.