Hi
(Running Ubuntu 17.10; java 1.8.0_25; Maven 3.1.1)
I have checked out the latest openmrs-core (based on https://github.com/openmrs/openmrs-core.git) and have run mvn install
.
I get this error when running tests:
startModule_shouldCreateDwrModulesXmlIfNotExists(org.openmrs.module.web.WebModuleUtilTest) Time elapsed: 0.319 sec <<< ERROR!
java.lang.BootstrapMethodError: call site initialization exception
at java.lang.Class.cast(Class.java:3361)
at java.lang.invoke.MethodHandles.constant(MethodHandles.java:2137)
at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(InnerClassLambdaMetafactory.java:216)
at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:304)
at java.lang.invoke.CallSite.makeSite(CallSite.java:289)
at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:296)
at org.openmrs.module.web.WebModuleUtil.getDWRModuleXML(WebModuleUtil.java:660)
at org.openmrs.module.web.WebModuleUtil.startModule(WebModuleUtil.java:251)
at org.openmrs.module.web.WebModuleUtilTest.startModule_shouldCreateDwrModulesXmlIfNotExists(WebModuleUtilTest.java:119)
startModule_dwrModuleXmlshouldContainModuleInfo(org.openmrs.module.web.WebModuleUtilTest) Time elapsed: 0 sec <<< ERROR!
java.lang.BootstrapMethodError: call site initialization exception
at java.lang.Class.cast(Class.java:3361)
at java.lang.invoke.MethodHandles.constant(MethodHandles.java:2137)
at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(InnerClassLambdaMetafactory.java:216)
at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:304)
at java.lang.invoke.CallSite.makeSite(CallSite.java:289)
at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:296)
at org.openmrs.module.web.WebModuleUtil.getDWRModuleXML(WebModuleUtil.java:660)
at org.openmrs.module.web.WebModuleUtil.startModule(WebModuleUtil.java:251)
at org.openmrs.module.web.WebModuleUtilTest.startModule_dwrModuleXmlshouldContainModuleInfo(WebModuleUtilTest.java:144)
On examination this relates to changes made in WebModuleUtil.java - at line 660 there is the following:
db.setEntityResolver((publicId, systemId) -> {
// When asked to resolve external entities (such as a DTD) we return an InputSource
// with no data at the end, causing the parser to ignore the DTD.
return new InputSource(new StringReader(""));
});
Before the changes the code was:
db.setEntityResolver(new EntityResolver() {
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
// When asked to resolve external entities (such as a DTD) we return an InputSource
// with no data at the end, causing the parser to ignore the DTD.
return new InputSource(new StringReader(""));
}
});
(This also requires the re-introduction of two imports for org.xml.sax.EntityResolver and org.xml.sax.SAXException).
When I revert this change WebModuleUtilTest
runs happily, and the whole test suite completes.
I’ve no idea why these changes don’t work for me, but presumably do work for everyone else.
Jerry