-
Notifications
You must be signed in to change notification settings - Fork 16
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
Oslc Xml Provider always kicks in for application/xml #356
Comments
Hello Benjamin, Are you asking us to apply this fix? #228 Also, please specify which version do you need fixed? From the link you gave, it looks like 4.1.0. Regarding the fix itself, we need to be quite careful, because this is the place where any change could be breaking if someone relied on it (cf. https://www.hyrumslaw.com/). I think that the actual problem is not in the You should be able to work around it in your application by registering your providers like this: RESOURCE_CLASSES.addAll(JenaProvidersRegistry.getProviders());
RESOURCE_CLASSES.remove(OslcXmlArrayProvider.class);
RESOURCE_CLASSES.remove(OslcXmlCollectionProvider.class);
RESOURCE_CLASSES.remove(OslcXmlProvider.class); PS. We already made changes/tests to the isReadable/isWritable methods in these two PRs: |
@jadelkhoury I would also like to remove these providers either from |
We should also deprecate |
Hey, thanks for the fast & detailed reply. I admit I did not try to understand your PRs fully. Currently, I am not interested in any future versions of Eclipse Lyo. Returning true is the only problem, which seems to be changed from version 2.4 to 4.x, which is a breaking change already. Now, I have circumvented the situation, defining my own provider which inherits the OslcRdfXmlProvider and checks with old behaviour. |
Somewhere in your code (I guess an Application class that extends javax.ws.rs.core.Application), you are calling So instead of calling I believe this would be a more stable solution. Calling |
@berezovskyi are there "bad" providers, or are some simply not desired in certain scenarios. |
@benjaminr-ps It's fine, we are only asking you to clearly state the version you are using right now.
The reason to reduce the checks was to allow instances of different resources to be de/serialized, see eclipse/lyo.core#21. Setting it to
Could you please confirm that the JAXB Provider is supposed to read To be clear, this should never happen. We've had a small number of such reports over the years but I was never able to reproduce with Jersey to trigger a provider on a MIME type it didn't declare. Please confirm you are using Jersey (<= 2.29.1 if you are on Lyo 4.x, iirc), package as WAR and run it using Tomcat or Jetty in a non-embedded more? These are the environments we regularly test. And please confirm Jersey is calling I tested PS:
We are trying to stay as low as possible with the JDK requirement, we understand the needs of integration library users. But our upstream dependencies are making our life hard, esp. Jena, which we can't replace. They already declared a plan to drop JDK 11 support shortly after JDK 21 is released in 2023-09 and only support JDK 17 and JDK 21. Spring framework, Jakarta EE, and many other projects seem to be following the "2 last LTS" policy as well. Right now the policy of Lyo is to stay on the lowest JDK version possible, using oldest possible Jena versions without CVEs. But when a CVE is filed on Jena, we must upgrade due to security concerns and this sometimes brings a JDK dependency increase. This is how things will remain to be unless we get enough financial support to keep forks of older Jena versions and backport CVE patches to them. |
@Jad-el-khoury, the https://www.w3.org/TR/rdf-syntax-grammar/#section-MIME-Type spec defines "The Internet media type / MIME type for RDF/XML is application/rdf+xml — RFC 3023 [RFC3023], section 8.18.". Parsing or sending RDF/XML using |
Thanks for your detailed thoughts. My current setup looks as follows:
I noticed, that OslcRdfXmlProvider.isReadable is getting called, since being defined first by Jersey, and JAXB is not called. Not sure, if there is any response with content-type "application/xml", but actually having the content with RDF/XML, returned by our supported 3rd party tools (like IBM's ELM). (unfortunately anything can be possible in real world ;)) |
It will only get called if the request comes with ELM is quite likely to return |
@benjaminr-ps I will close the issue. Please reopen if you can reproduce your issue on top of my JAXB example: oslc-op/refimpl@91b92c6 |
The Olsc Xml Provider is not usable in a mixed setup, with simple JAXB Provider, since it is now always tried to read as RDF/XML.
Can you please fix this issue?
We try to upgrade from previous version of Eclipse Lyo.
I can't upgrade to 5, since this is already build with Java 11.
lyo/core/oslc4j-jena-provider/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/OslcRdfXmlProvider.java
Line 232 in bdac27f
The text was updated successfully, but these errors were encountered: