Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-526

Unable to locate and load the service class in XPath engine

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Version 3.0.2
    • Fix Version/s: Version 3.1.0
    • Component/s: XPath
    • Labels:
      None
    • Flags:
      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

            Activity

              People

              • Assignee:
                pj.fanning PJ Fanning
                Reporter:
                riteshk7j Ritesh Kumar
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: