ory / sdk

The place where ORY's SDKs are being auto-generated
Apache License 2.0
140 stars 85 forks source link

Java client has conflicting javax.ws.rs dependencies #380

Open GitoMat opened 2 weeks ago

GitoMat commented 2 weeks ago

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

aeneasr commented 8 hours ago

Can yuo please upgrade to a newer version of our SDK?