title: Using Saxon to process XPath in a JIRA module
body: <p>I want to use saxon to process xpath in a jira module.
  Unit tests covering the problematic code were running fine in eclipse, so I have deployed the module, and ...</p>
  
  <p>I have encountered the dreaded</p>
  
  <p>java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory (see <a href="https://stackoverflow.com/questions/11677572/dealing-with-xerces-hell-in-java-maven">Dealing with &quot;Xerces hell&quot; in Java/Maven?</a>)</p>
  
  <p>I tried to exclude xml-apis from saxon dependencies, as it is suggested in <a href="https://answers.atlassian.com/questions/104121/i-m-blocked-help-cannot-be-cast-to-javax-xml-parsers-saxparserfactory" rel="nofollow noreferrer">https://answers.atlassian.com/questions/104121/i-m-blocked-help-cannot-be-cast-to-javax-xml-parsers-saxparserfactory</a></p>
  
  <p>Now I got w3c.dom missing, which is strange, because I would bet my hat that it is existing somewhere in jira.
  I added dom4j to pom dependencies nevertheless, and got</p>
  
  <p>java.lang.NoClassDefFoundError: Could not initialize class net.sf.saxon.Configuration</p>
  
  <p>With no indication of which class is missing.</p>
  
  <p>Here is the code with the initial problem:
  <a href="https://github.com/magwas/andreymarkelov-atlas-plugins-requestedfields/tree/feature/xsltfixes" rel="nofollow noreferrer">https://github.com/magwas/andreymarkelov-atlas-plugins-requestedfields/tree/feature/xsltfixes</a></p>
  
  <p>the patch leading to current state is at <a href="http://pastebin.com/vwR43hHt" rel="nofollow noreferrer">http://pastebin.com/vwR43hHt</a></p>
  
  <p>What would be the solution?</p>