0

I have 2 different dependencies which have the same package and same set of classes due to which I get the exception below while I run the application using Spring Boot. The build is successful using gradle.

Two classes have the same XML type name "{http://xml.welcome.com/types}ExceptionType". 
Use @XmlType.name and @XmlType.namespace to assign different names to them.

I am not able to change the XMlType.Name because these are jar files provided to us by different vendors. I can exclude any of these jars altogether because apart from this conflicting package , both these jars have other packages that I make use of.

What is the approach that I need to follow here? Is there a way to exclude a package from being imported while adding dependency or is there a different approach that I need to follow?

EDIT:

I have 2 dependencies , one is spring boot style dependency which has includes multiple jars to my project. xyz-soap-types is one of the jar files which has a package common.types. I want this jar to be included in the project. I have another jar file which is a SOAP webservice client library. The client jar files has 4 different packages and one of them is common.types. I want to use all the packages except common.types from this jar.

Punter Vicky
  • 15,954
  • 56
  • 188
  • 315
  • The accepted answer linked above has an option for cases when you are not able to change the classes themselves. – Gergely Bacso Sep 11 '15 at 15:17
  • Is there a way to do it without using eclipseLink moxy possibly by enforcing runtime resolution strategy in gradle file? – Punter Vicky Sep 11 '15 at 15:20
  • I do not know any, but if you are looking for a solution like that, you should probably add some specifics about what do you want to achieve? Like would you like to use any of the conflicting classes, or they just happen to be in the jars you have included? Or you may want to use both, but you do not know how? – Gergely Bacso Sep 11 '15 at 15:22
  • Sure , I will add. Thank You! – Punter Vicky Sep 11 '15 at 15:23

0 Answers0