exception : org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory

I am trying to use Tika http://tika.apache.org/ to convert doc or pdf files to text.
        File document = new File(target);
        Parser parser = new AutoDetectParser();
        ContentHandler handler = new BodyContentHandler();
        Metadata metadata = new Metadata();
During execution " Parser parser = new AutoDetectParser(); " 
I get an exception : org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory
where is proposed to remove that jar file.
there are dependencies :
[INFO] +- com.atlassian.jira:jira-api:jar:6.4.3:provided
[INFO] |  +- com.atlassian.annotations:atlassian-annotations:jar:0.14:provided
[INFO] |  +- com.atlassian.ofbiz:entityengine-share:jar:1.0.64:provided
[INFO] |  |  \- xerces:xercesImpl:jar:2.4.0:provided
but com.atlassian.jira depends on xerces:xercesImpl:jar:2.4.0
Is it possible to remove xerces:xercesImpl.jar file from dependencies to be able to use Tika http://tika.apache.org/ and don't break com.atlassian.JIRA dependency?
Is there another solution to fix exception : "org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory" ?
Thank you

2 answers

This widget could not be displayed.

Can you paste the full exception stacktrace?

This widget could not be displayed.

java.lang.RuntimeException: org.apache.xerces.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory

 

This is all that returns 

throw new RuntimeException(e.getCause().getMessage(), e.getCause()); 

from com.atlassian.event.internal.SingleParameterMethodListenerInvoker file

Please let me know if I can provide you more information.

Thank you

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

282 views 1 4
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you