We have a class in our dss module called CompilingClassLoader
that extends OpenmrsClassLoader
. The purpose of this class is to compile and load logic rules on the fly. This class works just fine with Platform 1.7.x. However, when I upgrade to 1.9.10, I get the following error whenever it runs:
ERROR - ClassLoaderTask.lookForNewClasses(151) |2016-05-05 10:51:20,556| Parent must not be ModuleClassLoader
ERROR - ClassLoaderTask.lookForNewClasses(152) |2016-05-05 10:51:20,556| java.lang.IllegalArgumentException: Parent must not be ModuleClassLoader
at org.openmrs.util.OpenmrsClassLoader.<init>(OpenmrsClassLoader.java:81)
at org.openmrs.module.dss.CompilingClassLoader.<init>(CompilingClassLoader.java:81)
Here is the method:
private CompilingClassLoader(ClassLoader parent) {
super(parent); //Line 81
setupClassLoader();
}
The above method is called like this:
CompilingClassLoader compilingClassLoader = new CompilingClassLoader(this);
Why is Platform suddenly throwing this error with the newer version?