Week 7 - Dependency Issues 2/2
07 Jul 2014After I hadn’t made any progress comparing openmrs and optaplanner dependencies, I decided to debug the entire optaplanner initialization process in order to find the difference between running standalone and inside openmrs. I found some dissimilarities inside Parser.class. This class should be imported from ecj-3.7.2.jar Again I checked the dependencies of openmrs with the command
but couldn’t find this particular library in the resulting output. In a next step I wanted to figure out, where Parser.class is loaded from. Therefore I inserted the following code snippet and redeployed my module to openmrs:
Alternatively you can use the vm option -verbose:class
The output told me that this class has been loaded from:
It turned out that the jetty maven plugin imports this library. As a quick fix I updated this plugin inside openmrs-core/webapp/pom.xml and the exception vanished. A better solution would be to force the modules class loader to look for classes in the modules classpath first. I will discuss that on openmrs talk.