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

Can you paste the full exception stacktrace?

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

77 views 0 5
Read article

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