From 7a4c4afc9b24448912bfa55d84293da92ef78ec5 Mon Sep 17 00:00:00 2001 From: Ulrich Zielhofer Date: Fri, 30 Oct 2020 13:41:13 +0100 Subject: [PATCH] avoid classloading issues within Wildfly; see https://developer.jboss.org/thread/80291 --- .../src/main/java/org/mustangproject/validator/Validator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validator/src/main/java/org/mustangproject/validator/Validator.java b/validator/src/main/java/org/mustangproject/validator/Validator.java index c1986a55..878d47a9 100644 --- a/validator/src/main/java/org/mustangproject/validator/Validator.java +++ b/validator/src/main/java/org/mustangproject/validator/Validator.java @@ -56,7 +56,7 @@ public abstract class Validator { * @throws IrrecoverableValidationError when any fatal errors arise, e.g. when the source file can not be found */ protected void validateSchema(byte[] xmlRawData, String schemaPath, int section, EPart part) throws IrrecoverableValidationError { - URL schemaFile = ClassLoader.getSystemResource("schema/" + schemaPath); + URL schemaFile = Thread.currentThread().getContextClassLoader().getResource("schema/" + schemaPath); Source xmlData = new StreamSource(new ByteArrayInputStream(xmlRawData)); SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); try {