eclipse-ee4j / eclipse-ee4j/jersey

Root cause of ServletException. org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError:

Open
#5,728 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

In one our projects, we use the following packages: `jersey-server (2.28)` & `poi-ooxml(5.2.5)`. Both these packages have `commons-io` as sub-dependencies.

While `poi-ooxml` uses `2.15` version of `commons-io`, `jersey` uses `2.11` version, irrespective if we upgrade the `jersey` to its latest release (https://github.com/eclipse-ee4j/jersey/blob/3.1.8/tools/jersey-release-notes-maven-plugin/pom.xml#L77).

When we run the project, we get the following error:

<[ACTIVE] ExecuteThread:

'1' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <[ServletContext@264727129 [app:abc

module:abc.war path:null spec-version: 3.1]] Root cause of ServletException. org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError:

org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream.builder()Lorg/apache/commons/io/output/UnsynchronizedByteArrayOutputStreamSBuilder

We have explicitly included `commons-io 2.15.1 dependency in Pom.xml` so that the project uses this version and ignores the others.

My first impression is that there's a dependency clash for `commons-io`. Since I am pretty new with Java & inexperienced with it, I would like to know if there's a way to solve this dependency clash.

`pom.xml`



junit
junit
4.12
test



org.glassfish.jersey.containers
jersey-container-servlet-core
2.28



org.glassfish.jersey.core
jersey-client
2.28



org.codehaus.jackson
jackson-jaxrs
1.9.14.jdk17-redhat-00001



org.apache.commons
commons-collections4
4.1



javax.xml
jaxb-impl
2.1



org.jvnet.staxex
stax-ex
1.7.7




org.apache.poi
poi-ooxml-schemas
4.1.2



org.apache.xmlbeans
xmlbeans
5.0.3

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.