Issue
I am using java 11 , maven version 3.6 and Spring Boot. I am having a problem running a unit test due to error below:
at java.base/java.lang.Class.getDeclaredFields0(Native Method) ~[na:na]
at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3061) ~[na:na]
at java.base/java.lang.Class.getDeclaredFields(Class.java:2248) ~[na:na]
at com.sun.xml.bind.v2.model.nav.ReflectionNavigator$3.run(ReflectionNavigator.java:288) ~[jaxb-core-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.nav.ReflectionNavigator$3.run(ReflectionNavigator.java:285) ~[jaxb-core-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at java.base/java.security.AccessController.doPrivileged(Native Method) ~[na:na]
at com.sun.xml.bind.v2.model.nav.ReflectionNavigator.getDeclaredFields(ReflectionNavigator.java:285) ~[jaxb-core-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.nav.ReflectionNavigator.getDeclaredFields(ReflectionNavigator.java:64) ~[jaxb-core-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.findFieldProperties(ClassInfoImpl.java:380) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:311) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:186) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:261) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:103) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:84) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:227) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:98) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:84) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:375) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:390) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:465) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:303) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:139) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1156) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:165) ~[jaxb-runtime-2.3.0-b170127.1453.jar:2.3.0-b170127.1453]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:297) ~[jaxb-api-2.3.1.jar:2.3.0]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:286) ~[jaxb-api-2.3.1.jar:2.3.0]
at javax.xml.bind.ContextFinder.find(ContextFinder.java:409) ~[jaxb-api-2.3.1.jar:2.3.0]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:721) ~[jaxb-api-2.3.1.jar:2.3.0]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:662) ~[jaxb-api-2.3.1.jar:2.3.0]
at org.springframework.oxm.jaxb.Jaxb2Marshaller.createJaxbContextFromPackages(Jaxb2Marshaller.java:569) ~[spring-oxm-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.oxm.jaxb.Jaxb2Marshaller.getJaxbContext(Jaxb2Marshaller.java:502) ~[spring-oxm-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.oxm.jaxb.Jaxb2Marshaller.afterPropertiesSet(Jaxb2Marshaller.java:476) ~[spring-oxm-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
... 40 common frames omitted
Caused by: java.lang.ClassNotFoundException: XMLGregorianCalendar
I know that in java 11 the java.xml.bind is removed, and for this reason i have added in my pom.xml file the dependencies
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0-b170127.1453</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.activation/activation -->
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.0-b170127.1453</version>
<scope>runtime</scope>
</dependency>
I checked the jars downloaded from in maven dependcies and javax.xml.datatype is present. Like below:
Why is this happening? How it is possible that the XMLGregorianCalendar
class is not recognized even thought id downloaded ? What can I do to fix this problem?
I have tried to run :
mvn clean compile
mvn clean install
I executed a maven project update from eclipse
None of the action above worked.
Below it the result from running the command mvn dependency:tree
[INFO] +- org.springframework.boot:spring-boot-starter-web-services:jar:2.1.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-web:jar:2.1.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-json:jar:2.1.0.RELEASE:compile
[INFO] | | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.7:compile
[INFO] | | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.7:compile
[INFO] | | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.7:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.1.0.RELEASE:compile
[INFO] | | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.12:compile
[INFO] | | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.12:compile
[INFO] | | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.12:compile
[INFO] | | +- org.springframework:spring-web:jar:5.1.2.RELEASE:compile
[INFO] | | \- org.springframework:spring-webmvc:jar:5.1.2.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:5.1.2.RELEASE:compile
[INFO] | +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.5.0:compile
[INFO] | | +- javax.xml.soap:javax.xml.soap-api:jar:1.4.0:compile
[INFO] | | \- org.jvnet.mimepull:mimepull:jar:1.9.10:compile
[INFO] | +- javax.xml.ws:jaxws-api:jar:2.3.1:compile
[INFO] | | \- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | +- org.springframework:spring-oxm:jar:5.1.2.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:5.1.2.RELEASE:compile
[INFO] | \- org.springframework.ws:spring-ws-core:jar:3.0.4.RELEASE:compile
[INFO] | +- org.springframework.ws:spring-xml:jar:3.0.4.RELEASE:compile
[INFO] | \- org.springframework:spring-aop:jar:5.1.2.RELEASE:compile
[INFO] +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] | \- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] +- javax.activation:activation:jar:1.1:compile
[INFO] +- org.glassfish.jaxb:jaxb-runtime:jar:2.3.0-b170127.1453:compile
[INFO] | +- org.glassfish.jaxb:jaxb-core:jar:2.3.0-b170127.1453:compile
[INFO] | | +- org.glassfish.jaxb:txw2:jar:2.3.0-b170127.1453:compile
[INFO] | | \- com.sun.istack:istack-commons-runtime:jar:3.0.4:compile
[INFO] | +- org.jvnet.staxex:stax-ex:jar:1.7.8:compile
[INFO] | \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.13:compile
[INFO] | | +- org.elasticsearch.client:transport:jar:6.4.2:compile
[INFO] | | | +- org.elasticsearch:elasticsearch:jar:6.4.2:compile
[INFO] | | | | +- org.elasticsearch:elasticsearch-core:jar:6.4.2:compile
[INFO] | | | | +- org.elasticsearch:elasticsearch-secure-sm:jar:6.4.2:compile
[INFO] | | | | +- org.elasticsearch:elasticsearch-x-content:jar:6.4.2:compile
[INFO] | | | | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.9.7:compile
[INFO] | | | | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.9.7:compile
[INFO] | | | | | \- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.9.7:compile
[INFO] | | | | +- org.apache.lucene:lucene-core:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-analyzers-common:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-backward-codecs:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-grouping:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-highlighter:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-join:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-memory:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-misc:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-queries:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-queryparser:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-sandbox:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-spatial:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-spatial-extras:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-spatial3d:jar:7.4.0:compile
[INFO] | | | | +- org.apache.lucene:lucene-suggest:jar:7.4.0:compile
[INFO] | | | | +- org.elasticsearch:elasticsearch-cli:jar:6.4.2:compile
[INFO] | | | | | \- net.sf.jopt-simple:jopt-simple:jar:5.0.2:compile
[INFO] | | | | +- com.carrotsearch:hppc:jar:0.7.1:compile
[INFO] | | | | +- com.tdunning:t-digest:jar:3.2:compile
[INFO] | | | | +- org.hdrhistogram:HdrHistogram:jar:2.1.9:compile
[INFO] | | | | \- org.elasticsearch:jna:jar:4.5.1:compile
[INFO] | | | +- org.elasticsearch.plugin:reindex-client:jar:6.4.2:compile
[INFO] | | | | \- org.elasticsearch.client:elasticsearch-rest-client:jar:6.4.2:compile
[INFO] | | | +- org.elasticsearch.plugin:lang-mustache-client:jar:6.4.2:compile
[INFO] | | | | \- com.github.spullara.mustache.java:compiler:jar:0.9.3:compile
[INFO] | | | +- org.elasticsearch.plugin:percolator-client:jar:6.4.2:compile
[INFO] | | | +- org.elasticsearch.plugin:parent-join-client:jar:6.4.2:compile
[INFO] | | | \- org.elasticsearch.plugin:rank-eval-client:jar:6.4.2:compile
[INFO] | | \- org.elasticsearch.plugin:transport-netty4-client:jar:6.4.2:compile
[INFO] | | +- io.netty:netty-buffer:jar:4.1.29.Final:compile
[INFO] | | +- io.netty:netty-codec:jar:4.1.29.Final:compile
[INFO] | | +- io.netty:netty-codec-http:jar:4.1.29.Final:compile
[INFO] | | +- io.netty:netty-common:jar:4.1.29.Final:compile
[INFO] | | +- io.netty:netty-handler:jar:4.1.29.Final:compile
[INFO] | | +- io.netty:netty-resolver:jar:4.1.29.Final:compile
[INFO] | | \- io.netty:netty-transport:jar:4.1.29.Final:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.1.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:2.1.0.RELEASE:compile
[INFO] | | \- org.springframework.boot:spring-boot-starter-logging:jar:2.1.0.RELEASE:compile
[INFO] | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | \- org.apache.logging.log4j:log4j-to-slf4j:jar:2.11.1:compile
[INFO] | | | +- org.elasticsearch.client:rest:jar:5.2.2:compile
[INFO] | | | | +- org.apache.httpcomponents:httpasyncclient:jar:4.1.4:compile
[INFO] | | | | \- org.apache.httpcomponents:httpcore-nio:jar:4.4.10:compile
[INFO] | | | +- org.elasticsearch.client:sniffer:jar:5.2.2:compile
[INFO] | | | +- org.json:json:jar:20160810:compile
[INFO] | | | \- org.apache.logging.log4j:log4j-web:jar:2.11.1:compile
[INFO] | | +- org.apache.commons:commons-jcs-jcache:jar:2.1:compile
[INFO] | | | \- org.apache.commons:commons-jcs-core:jar:2.1:compile
[INFO] | | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | | | +- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] | | | \- org.mongodb:mongodb-driver:jar:3.8.2:compile
[INFO] | | | \- org.mongodb:mongodb-driver-core:jar:3.8.2:compile
[INFO] | | \- org.slf4j:slf4j-log4j12:jar:1.7.25:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] | \- jaxen:jaxen:jar:1.1.6:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.1.0.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:2.1.0.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.1.0.RELEASE:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.3:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.2:test
[INFO] | | \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | +- org.assertj:assertj-core:jar:3.11.1:test
[INFO] | +- org.mockito:mockito-core:jar:2.23.0:test
[INFO] | | +- net.bytebuddy:byte-buddy:jar:1.9.3:test
[INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.9.3:test
[INFO] | | \- org.objenesis:objenesis:jar:2.6:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] | +- org.springframework:spring-core:jar:5.1.2.RELEASE:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.1.2.RELEASE:compile
[INFO] | +- org.springframework:spring-test:jar:5.1.2.RELEASE:test
[INFO] | \- org.xmlunit:xmlunit-core:jar:2.6.2:test
[INFO] +- org.springframework.boot:spring-boot-starter-log4j2:jar:2.1.0.RELEASE:test
[INFO] | +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.11.1:test
[INFO] | | \- org.apache.logging.log4j:log4j-api:jar:2.11.1:compile
[INFO] | +- org.apache.logging.log4j:log4j-core:jar:2.11.1:compile
[INFO] | +- org.apache.logging.log4j:log4j-jul:jar:2.11.1:test
[INFO] | \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] +- org.hibernate.validator:hibernate-validator:jar:6.0.13.Final:test
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:test
[INFO] | \- com.fasterxml:classmate:jar:1.4.0:test
[INFO] +- com.github.javafaker:javafaker:jar:0.16:test
[INFO] | +- org.apache.commons:commons-lang3:jar:3.8.1:compile
[INFO] | +- org.yaml:snakeyaml:jar:android:1.20:test
[INFO] | \- com.github.mifmif:generex:jar:1.0.2:test
[INFO] | \- dk.brics.automaton:automaton:jar:1.11-8:test
[INFO] \- com.devskiller:jfairy:jar:0.6.2:test
[INFO] +- org.yaml:snakeyaml:jar:1.23:compile
[INFO] +- org.apache.commons:commons-text:jar:1.2:compile
[INFO] +- org.apache.commons:commons-math3:jar:3.6.1:test
[INFO] +- com.google.guava:guava:jar:24.0-jre:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] | +- org.checkerframework:checker-compat-qual:jar:2.0.0:compile
[INFO] | +- com.google.errorprone:error_prone_annotations:jar:2.1.3:compile
[INFO] | +- com.google.j2objc:j2objc-annotations:jar:1.1:compile
[INFO] | \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
[INFO] +- com.google.inject:guice:jar:4.2.0:test
[INFO] | +- javax.inject:javax.inject:jar:1:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:test
[INFO] +- com.google.inject.extensions:guice-assistedinject:jar:4.2.0:test
[INFO] +- org.iban4j:iban4j:jar:3.2.1:test
[INFO] \- org.codehaus.groovy:groovy-all:jar:2.4.14:test
Solution
"Welcome to jar hell" should be the title of this question.
You have stated correctly that javax.xml.bind module is removed from java 11 and it is also deprecated in java 9 and java 10.
You have correctly replaced the missing dependency from the removal of javax.xml.bind
module with the following:
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0-b170127.1453</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.activation/activation -->
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.0-b170127.1453</version>
<scope>runtime</scope>
</dependency>
I created a new maven project and added the above dependencies. I was able to successfully run the project with a
variable of the declared type of javax.xml.datatype.XMLGregorianCalendar
.
I think you don't need the xml-apis
, that comes as a transitive dependency of dom4j
. I think that if you remove
xml-apis
from dom4j, the problem will be fixed. Do the modification below:
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
If dom4j
is a transitive dependency for some other dependency you have in your pom, then you should find first which dependency has dom4j
as a transitive dependency. And after that you should make the following modification:
<dependency>
<groupId>{the dependency group id that has dom4j as transitive dependency}</groupId>
<artifactId>{the dependency artifact that has dom4j as transitive dependency}</artifactId>
<version>1.6.1</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
Explanation
I think that this problem has risen from dependencies having the same artifact and different group id and maven is not able to distinguish them.
xml-apis
artifact can be from the xerces
organization or from xml-apis
organization like below:
<dependency>
<groupId>org.apache.xerces</groupId>
<artifactId>xml-apis</artifactId>
<version>2.9.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.10</version>
</dependency>
Although they have the same artifact, maven does not recognize them as the same because they have different group id. This does not cause conflict and both dependencies are included as resolved dependencies.
My advice is, exclude the xml-apis
from dom4j
and update the project.
I hope this helps you solve the issue.
Answered By - Rando Shtishi
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)