Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Using Abdera as dependency in JIRA plugins

Fábio Antunes September 10, 2015

Hi,

Im getting a "java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory" when added org.apache.abdera as dependency to pom. I'have tried to follow the tips in this post adding: 

<dependency>
	<groupId>xml-apis</groupId>
	<artifactId>xml-apis</artifactId>
	<version>1.3.04</version>
	<scope>provided</scope>
</dependency>

and excluding it from abdera dependency:

<dependency>
	<groupId>org.apache.abdera</groupId>
	<artifactId>abdera-parser</artifactId>
	<version>1.1.3</version>
	<exclusions>
		<exclusion>
			<groupId>xml-apis</groupId>
			<artifactId>xml-apis</artifactId>
		</exclusion>
	</exclusions>
</dependency>

But then i get "java.lang.ClassNotFoundException: org.w3c.dom.Node

at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772)" and i can't understand why.


Someone with similar problem and possible solutions ?

Kind regards,
Fábio Antunes 

 

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Fábio Antunes September 10, 2015

I found out the solution:

<dependency>
<groupId>org.apache.abdera</groupId>
<artifactId>abdera-parser</artifactId>
<version>1.1.3</version>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
<exclusion>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.abdera</groupId>
<artifactId>abdera-core</artifactId>
<version>1.1.3</version>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.abdera</groupId>
<artifactId>abdera-i18n</artifactId>
<version>1.1.3</version>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>

Regards

0 votes
Tormod Haugene December 12, 2018

An alternative to excluding the offending package would be to excplicitly import the one that we need. 

 

Error:

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

 

The following worked for me:

// pom.xml, inside maven-jira-plugin (or maven-amps-plugin)

<
Import-Package>
javax.xml.parsers, <<<<< Excplicitly import the one we want to use
*;resolution:=optional
</Import-Package>
TAGS
AUG Leaders

Atlassian Community Events