Here's the script:
I linked several .xml (several configurations) needed to run my application in a .jar file. The jar file has the following structure:
settings-1.0.0.jar หช resources/ หช 1.xml หช 2.xml หช 3.xml หช META-INF/ หช MANIFEST.MF
1.xml has the following contents:
<?xml version="1.0" encoding="UTF-8"?> <document xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="resource:resources/2.xml" /> <xi:include href="resource:resources/3.xml" /> </document>
based on this article . When I try to access them (after successfully deploying my application), I get the following error:
Caused by: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 43; An 'include' failed, and no 'fallback' element was found. at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:245) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121) at org.zcore.dkp.backend.mapper.MappingParser.parse(MappingParser.java:60) ... 327 more
I tried (& error'd) all imaginable options. What is the correct combination for xi:include 'of the .xml file in the jar file installed as the WildFly module?
Edit: this is how the xml file loads:
private void loadBackendMapping() { try { BackendMappingParser parser = new BackendMappingParser(); InputStream in = ResourceLoaderHelper.getResourceAsStream(BACKEND_MAPPING_RESOURCE); if (in == null) { throw new FileNotFoundException(); } try { parser.parse(in); } finally { try { in.close(); } catch (IOException e) { log.warn("Failed to close " + BACKEND_MAPPING_RESOURCE, e); } } backendMapping = parser.getMapping(); if (log.isDebugEnabled()) { log.debug(BACKEND_MAPPING_RESOURCE + " successfully loaded!"); } } catch (FileNotFoundException e) { log.warn("\"" + BACKEND_MAPPING_RESOURCE + "\" not found!"); backendMapping = new BackendMapping(); } catch (Exception e) { throw new CenterwareSystemException("Failed to parse " + BACKEND_MAPPING_RESOURCE, e); } }
BACKEND_MAPPING_RESOURCE contains the file name ( 1.xml ).
java xml module wildfly xerces
Rob
source share