Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Version 3.0.2
-
None
-
Important
Description
I did upgrade from xmlbeans v2.6.0 to the latest available version i.e. v3.0.2 It is unable to locate and load the service which we are using in XPath engine.
Exception thrown is mentioned below.
java.lang.RuntimeException: Trying XBeans path engine... Trying XQRL... Trying
XDK... Trying delegated path engine... FAILED on //dbm:applicationModelStringsJa
r
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:211)
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:137)
at org.apache.xmlbeans.impl.store.Cursor._selectPath(Cursor.java:902)
at org.apache.xmlbeans.impl.store.Cursor.selectPath(Cursor.java:2634)
at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBas
e.java:476)
at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBas
e.java:460)
After some investigation I found that this is because of the below code present inside static block in class org\apache\xmlbeans\impl\store\Path.java
String id = "META-INF/services/org.apache.xmlbeans.impl.store.PathDelegate.SelectPathInterface";
InputStream in = Path.class. getResourceAsStream(id);
Here I think, it is unable to locate and get resource from the provided id if the resource is outside the library which is the case for me.
Reverting back to xmlbeans v2.6.0 fixes the issue for me which has below code in class org\apache\xmlbeans\impl\store\Path.java.
ClassLoader cl = Path.class.getClassLoader();
String id = "META-INF/services/org.apache.xmlbeans.impl.store.PathDelegate.SelectPathInterface";
InputStream in = cl.getResourceAsStream(id);
I think this is probably a bug which needs to get fixed. For me it is a blocker for now and I can't uptake the latest xmlbeans version.
Attachments
Issue Links
- is duplicated by
-
XMLBEANS-534 Latest version 3.0.2 causes XPath exception
- Closed