Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jersey-common 2.13 - javax.ws.rs-api 2.0.1 and swagger-play2 1.3.12 incompatibility #900

Closed
joantune opened this issue Mar 9, 2015 · 9 comments
Assignees
Labels
Milestone

Comments

@joantune
Copy link

joantune commented Mar 9, 2015

Hi Fellas!

Thanks for the great work.
I searched on the issues page for a solution for the problem that I have, the closest I found was this: #862 but I don't think I can just switch to 1.5.X-M because that branch only supports Jersey and not Play2.

So, I think that my problem is related with the following:

I have a play2-java 2.3.X (2.3.8) application, that also has a dependency with a library that uses javax.ws.rs-api 2.0.1 (https://github.com/paymill/paymill-java in its 5.0.0 version) and because swagger-play2 1.3.12 depends on an earlier version of the javax.ws.rs-api I get exceptions like these, when using Paymill's library:

Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.sun.ws.rs.ext.RuntimeDelegateImpl
    at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:122)
    at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91)
    at javax.ws.rs.core.UriBuilder.newInstance(UriBuilder.java:69)
    at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:80)
    at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:99)
    at org.glassfish.jersey.client.JerseyWebTarget.<init>(JerseyWebTarget.java:71)
    at org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:185)
    at org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:70)
    at com.paymill.utils.JerseyClient.get(JerseyClient.java:47)
    at com.paymill.services.RestfulUtils.list(RestfulUtils.java:37)
    at com.paymill.services.WebhookService.list(WebhookService.java:72)
    at com.paymill.services.WebhookService.list(WebhookService.java:54)

Any thoughts on this? I kinda envy Node.js because of the way they deal with dependencies, when will Java support this..

@webron
Copy link
Contributor

webron commented Mar 9, 2015

Have you tried excluding the offending dependency from the swagger-core library that you use?

@joantune
Copy link
Author

joantune commented Mar 9, 2015

I thought of that but I haven't tried it. I will ASAP and let you guys know
how it went
Em 09/03/2015 12:57, "Ron" notifications@github.com escreveu:

Have you tried excluding the offending dependency from the swagger-core
library that you use?


Reply to this email directly or view it on GitHub
#900 (comment)
.

@joantune
Copy link
Author

Ok, so, good news:

I bumped everything to 1.3.13-SNAPSHOT (in second thought I should have bumped it to something like 1.3.12-RS2-SNAPSHOT, as it's a bit of a bummer to do so because one has to go through all the poms to do that. I think the version can be a property stated in the parent pom [I think this is doable, i'm not sure anymore], also, if I recall I also think that there was a maven plugin to assist with the version bumping, I haven't used mvn in a bit..)

And all of the dependencies that one had with "javax.ws.rs" % "jsr311-api" % "1.1.1" were changed to "javax.ws.rs" % "javax.ws.rs-api" % "2.0.1" .
After a bit of a hassle with Java8 new Javadoc rules that were making the mvn install fail, i managed to mvn install and sbt publishLocal without a problem (the tests had no errors). I updated the use of the library to that version, and the paymill client works fine, I haven't tested Swagger's functionalities, but I'm assuming they work because the tests worked!

I'm glad to submit a pull request if you think this is worthy of that (while updating also the Readme.md to have this special note of a version with play2 support and rs-api 2.X)

@fehguy fehguy added this to the v1.3.13 milestone Mar 11, 2015
@fehguy fehguy self-assigned this Mar 11, 2015
@joantune
Copy link
Author

@fehguy: yet in another note (I write it here because I'm not sure if its related with this change or not) the samples/java-play2 petstore looks weird using the dist of the swagger-ui master folder, i'm not sure if it's a problem of the changes I made to the swagger-core to add the RS 2.X API, if it was a problem that happened before that is on the sample side, or if it's the editor. But only the GET methods appear, none of the POST methods do.

@fehguy
Copy link
Contributor

fehguy commented Mar 14, 2015

Hi, that's intentional, there is a filter that requires a valid api key to show all validations.

@joantune
Copy link
Author

Didn't noticed that. Got it, the 'special-key' :)

Nice, it actually works well with the version bumps I did, so nevermind my
previous comment.

Tks for making it clearer to me, Tony.

Cheers

On Sat, Mar 14, 2015 at 4:12 PM, Tony Tam notifications@github.com wrote:

Hi, that's intentional, there is a filter that requires a valid api key to
show all validations.


Reply to this email directly or view it on GitHub
#900 (comment)
.

João Antunes
http://web.ist.utl.pt/~joao.a.p.antunes/
http://web.ist.utl.pt/~joao.a.p.antunes/?reference=emailSig

@fehguy
Copy link
Contributor

fehguy commented Mar 14, 2015

Sure thing :) You're not the first person to miss that, I need to make it more clear.

@webron
Copy link
Contributor

webron commented Jul 13, 2015

Closing as we're not going to release 1.3.13. Please upgrade to the latest version.

@webron webron closed this as completed Jul 13, 2015
@webron
Copy link
Contributor

webron commented Jul 13, 2015

Apologies, noticed this is related to the Play module and not the Jersey one. Please follow #918 for progress regarding the Play module migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants