Skip to content
Permalink
Browse files
Fixed: Display file name in XML parsing errors
(OFBIZ-6993)
  • Loading branch information
mthl committed Dec 7, 2019
1 parent 071a742 commit 3c9af842458d7a31f57feb4ddc389f87c2d79625
Showing with 3 additions and 2 deletions.
  1. +3 −2 framework/webapp/src/main/java/org/apache/ofbiz/webapp/WebAppUtil.java
@@ -253,11 +253,12 @@ private static WebXml parseWebXmlFile(String webXmlFileLocation, boolean validat
LocalResolver lr = new LocalResolver(new DefaultHandler());
ErrorHandler handler = new LocalErrorHandler(webXmlFileLocation, lr);
Digester digester = DigesterFactory.newDigester(validate, namespaceAware, new WebRuleSet(), false);
digester.getParser();
digester.push(result);
digester.setErrorHandler(handler);
try (InputStream is = new FileInputStream(file)) {
digester.parse(new InputSource(is));
InputSource iso = new InputSource(is);
iso.setSystemId(file.getAbsolutePath());
digester.parse(iso);
} finally {
digester.reset();
}

0 comments on commit 3c9af84

Please sign in to comment.