2 Replies Latest reply on Dec 2, 2011 5:59 PM by 902605

    Why can't I get basic XPath to work in a Java 6 environment?

      Why do I get the following exception when trying to invoke XPathFactory.newInstance() in a Java 6 runtime? The runtime is hosting an OSGi container that underlies an Atlassian JIRA 4.1.x environment.

      [INFO] [talledLocalContainer] Caused by: java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFactory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom
      [INFO] [talledLocalContainer] at javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:101)

      How can an XPathFactory implementation not be found in a Java 6 environment? Is it because JIRA placed the following three JARs in my dependencies automatically (sucked in from an M2 REPO that is automatically created when setting up this plugin project):

      * xalan-2.7.0.jar
      * xercesImpl-2.9.1.jar
      * xml-apis-1.3.04.jar

      How can I work around this?