Java client has conflicting javax.ws.rs dependencies
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 178
- Forks
- 96
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe the bug
In https://github.com/ory/sdk/blob/master/contrib/poms/client/pom.xml two dependencies are defined, javax.ws.rs:javax.ws.rs:2.1.1 and javax.ws.rs:jsr311-api:111. Those are basically different versions of the same library and contain overlapping classes. So to me it happened in our Docker deployment everything is fine but if I run our web application (using Jersey 2.29) in a stand-alone Tomcat the latter library is given preference and then I get the following error:
jersey java.lang.NoSuchMethodError: 'java.util.Map [[javax.ws.rs](http://javax.ws.rs/)](http://javax.ws.rs/).core.Application.getProperties()'
Excluding the JAX RS 1.0 library in our POM solved the issue for me:
<dependency>
<groupId>sh.ory</groupId>
<artifactId>ory-client</artifactId>
<version>1.6.2</version>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
</exclusion>
</exclusions>
<dependency>
Reproducing the bug
I use the Maven Cargo plugin 1.10.9 to run Tomcat 9.0.80, but I'm not sure what influences the library loading order.
Relevant log output
No response
Relevant configuration
No response
Version
1.6.2
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Other
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in contrib/poms/client/pom.xml and inspect the javax.ws.rs:javax.ws.rs:2.1.1 and javax.ws.rs:jsr311-api:111 dependencies. Use Maven dependency resolution with the Java client version 1.6.2 to confirm the overlapping JAX-RS classes and verify that the conflicting dependency is no longer brought into consuming applications.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100