let schematron use hapi-fhir-base classloader (#4366)
This commit is contained in:
parent
a04a49cb68
commit
f8548c5d7b
|
@ -33,6 +33,8 @@ import ca.uhn.fhir.validation.SingleValidationMessage;
|
||||||
import ca.uhn.fhir.validation.ValidationContext;
|
import ca.uhn.fhir.validation.ValidationContext;
|
||||||
import com.helger.commons.error.IError;
|
import com.helger.commons.error.IError;
|
||||||
import com.helger.commons.error.list.IErrorList;
|
import com.helger.commons.error.list.IErrorList;
|
||||||
|
import com.helger.commons.io.resource.ClassPathResource;
|
||||||
|
import com.helger.commons.io.resource.IReadableResource;
|
||||||
import com.helger.schematron.ISchematronResource;
|
import com.helger.schematron.ISchematronResource;
|
||||||
import com.helger.schematron.SchematronHelper;
|
import com.helger.schematron.SchematronHelper;
|
||||||
import com.helger.schematron.svrl.jaxb.SchematronOutputType;
|
import com.helger.schematron.svrl.jaxb.SchematronOutputType;
|
||||||
|
@ -149,7 +151,11 @@ public class SchematronBaseValidator implements IValidatorModule {
|
||||||
ourLog.error("Failed to close stream", e);
|
ourLog.error("Failed to close stream", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
retVal = SchematronResourceSCH.fromClassPath(pathToBase);
|
// Allow Schematron to load SCH files from the 'validation-resources'
|
||||||
|
// bundles when running in an OSGi container. This is because the
|
||||||
|
// Schematron bundle does not have DynamicImport-Package in its manifest.
|
||||||
|
IReadableResource schResource = new ClassPathResource(pathToBase, this.getClass().getClassLoader());
|
||||||
|
retVal = new SchematronResourceSCH(schResource);
|
||||||
myClassToSchematron.put(theClass, retVal);
|
myClassToSchematron.put(theClass, retVal);
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue