ory / ory/sdk

Java client has conflicting javax.ws.rs dependencies

Open
#380 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
178
Forks
96
Avg merge
6d 23h
Merged PRs (30d)
3

Description

Preflight checklist
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.