-
Notifications
You must be signed in to change notification settings - Fork 80
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
Requiring JAX-RS 2.0 has knock-on effects #90
Comments
@mcdee This change was discussed on mailing list and there were no objections, so I don't think we would like reversion, at least not without further discussion. Another angle here is that 2.7 is still JAX-RS 1.x compatible, and at some point we do need to move to JAX-RS 2. |
At the least there is a reference to NoContentException at jackson-jaxrs-providers/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java Line 972 in 5312811
I'm using 2.7.7 for now. |
I'm also having this problem. If I upgrade to 2.8.x, I get a java.lang.NoClassDefFoundError for NoContentException. I'm using 2.7.7 for now as well. |
@sappenin That would mean that you are trying to run on JAX-RS 1.x container (or perhaps have duplicate jars in classpath, including one for 1.x) |
@cowtowncoder Yes, exactly - I'm running Jersey 1.19.x/JAX-RS 1.1. |
I think, there should be definitely an option to use JAX-RS 1.x It is widely spread and I cannot see any reason why Jackson should be locked on JAX-RS 2.x only. |
This was discussed on dev list, and decision was made. If Jersey 1.x compatibility is needed, please use Jackson 2.7. If you do not like this, please bring it up on mailing lists; these issues are not debated or decided on issue tracker. I will leave this issue open in case others find it, but there will be no action without significant re-evaluation by developers. |
Thanks, for pointing it out. |
Thanks! Good idea to add the link too. |
Absence of NoContentException is not the only problem
JacksonJsonProvider would not be picking up properly as a reader/writer by Jersey 1.x with Jackson 2.8. Same works fine with Jackson 2.7. I don't see any stacktraces. I would try to investigate why integration broke maybe on free time. |
It is possible to change accessing of |
2.8.5 release works fine for me with Jersey 1.x. NoContentException fix was enough, at least for my usage. |
@Spikhalskiy excellent, thank you for verifying this. |
Fixed via #91 |
I am using Jackson 2.8.1 and Jersey 1.18.6, and am getting NoClassDefFoundError: javax/ws/rs/core/NoContentException I had to include javax.ws.rs-api 2.0.1 to fix this problem, even though I am not using services with JAX-RS 2.0 API |
@alexandru-2016 it was fixed in 2.8.5 as you can see above. |
The workaround code is removed in jackson 2.13 with this commit. Is there any other way to workaround with jersey 1.x for legacy users? |
Version 2.13 did drop JAX-RS 1.x compatibility so Jersey 1.x legacy users should keep using version 2.12; latest patch being 2.12.6. |
Placing both JAX-RS versions side-by-side will cause a Java loading race-conditions, given the two JAX-RS have same named classes with incompatible definitions. May only reveal itself sometimes, or in some OSs. In my case, the concurrency issue would happen in Windows and resulted in the error:
I think it is better to package the specific missing and needed class, https://github.com/javaee/jax-rs-api/blob/master/jaxrs-api/src/main/java/javax/ws/rs/core/NoContentException.java, in a custom JAR. Worked in my case. |
@pjfanning the class itself has no other dependencies. For FasterXML, I believe I read somewhere that this was a matter of simplifying their code-based, while still somewhat supporting both Jax-RS versions? I can only state this is working in my case... @cowtowncoder could you shed some light on if this is a feasible solution, or if hidden problems are likely to arise? Thank you. |
I have created https://github.com/pjfanning/jsr311-compat and will try submitting a PR to Hadoop team that uptakes it and a newer version of Jackson. |
I think @pjfanning 's project sounds like a good solution. FasterXML JAX-RS provider has moved on from Jersey 1.0 and trying to get support back in would be confusing and painful (including but not limited to clashes between JAX-RS 1.0 / 2.0 classes). |
Issue #82 has caused problems where Jackson can no longer be used with Jersey 1.x. Although Jersey 2.x is the current version 1.x is still very widely used. Could this change be considered for reversion?
The text was updated successfully, but these errors were encountered: