Comments (6)
I noticed in my sample code that the custom ObjectMapper provided by the ObjectMapperContextResolver was not being used. The setting on that ObjectMapper is DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES = false, and this setting was not being applied.
I'm not sure what the underlying issue is, but I've found that the registration of the JaxRSClientJacksonJaxbJsonProvider (in JaxRSClientJacksonFeature) is unsuccessful when the priority is 1 or higher. Setting the priority to 0 seems to fix the issue.
I can look into this more on my own, but I wanted to see if you have any immediate thoughts. For now, I've added this VM arg to my product configuration:
-Dorg.eclipse.ecf.provider.jaxrs.client.JaxRSClientContainer.jacksonDefaultPriority=0
from jaxrsproviders.
Hi,
At first glance the behavior you are observing is a little confusing. Ultimately the priority of jackson feature and the JaxRSClientJacksonJaxbJsonProvider is done here:
Although looking at it now, not that line 153 has this:
cb.register(new ObjectMapperContextResolver(), ContextResolver.class);
Perhaps since this is missing the jacksonPriority (which has to be set with register(Object,Map<Class,Integer>) version of ClientBuilder.register), it's using the default priority always and this is messing up your registration.
I scratched out this code as a replacement for line 153:
Map<Class<?>,Integer> typeMap = new HashMap<Class<?>,Integer>();
typeMap.put(ContextResolver.class, jacksonPriority);
cb.register(new ObjectMapperContextResolver(), typeMap);
Would you be able to test this in your environment to see if it fixes this issue?
It might be something else of course, but this seems like it could explain what you are experiencing.
Or maybe there is something weird about the handling of the register priority value, or maybe it's being used incorrectly.
This version of things is using the 2.1.1 version of javax.ws.rs-api-2.1.1.
from jaxrsproviders.
Also: I was just looking at these docs for Configurable.register methods
https://docs.oracle.com/javaee/7/api/javax/ws/rs/core/Configurable.html
and they do have this:
Note that in case the priority is not applicable to a particular provider contract implemented by the class of the registered component, the supplied priority value will be ignored for that contract.
I don't know whether this is relevant or not, but it was surprising to me on this reading.
from jaxrsproviders.
Thanks for looking into it. I tried the replacement code but it didn't resolve the issue.
I guess what I'm wondering is whether the priority needs to be set. Was there a particular goal you're trying to achieve by using a priority for all registrations in the context? When I take out the priority for the JaxRSClientJacksonJaxbJsonProvider everything works fine.
from jaxrsproviders.
My goal was simply to allow for prioritization...as supported by Jax-RS spec register methods. It may be that since the feature is registered with a priority that the feature priority overrides anything registered within that feature context...like the JaxRSClientJacksonJaxbJsonProvider.
In any case, I think I'll simplify by deprecating old constructor/3 for JaxRSClientJacksonFeature and replace it with
public JaxRSClientJacksonFeature(RemoteServiceClientRegistration reg, ClassLoader cl) {
this.reg = reg;
this.cl = cl;
}
from jaxrsproviders.
Applied fix for this issue by removing Jackson priority from JaxRSClientJacksonFeature constructor (with new constructor and deprecated JaxRSClientJacksonFeature/init/3.
from jaxrsproviders.
Related Issues (20)
- Replace service id in URL with a value of my choice? HOT 7
- new isssue HOT 3
- Could we make these features available on Eclipse update site? HOT 2
- Clean up metadata for features HOT 1
- Adding needed plug-ins to features HOT 1
- Remove example plugins from features HOT 1
- Update feature dependencies for Jersey JAX-RS Client feature HOT 3
- Cannot get asynchronous JAX-RS calls working as expected HOT 8
- Create simpler and more flexible endpoint descriptions HOT 21
- Provide JAX-RS and Jersey defaults so they don't have to be duplicated in EDEF files HOT 20
- Clean clone of repo will not build HOT 9
- cxf repository should be absolute HOT 1
- warning when com.mycorp.examples.student.client is executed in karaf HOT 1
- Consume Jersey and all dependencies using Maven repositories HOT 6
- Blank default uuid causes issues with multiple bundles providing services HOT 2
- Issues when starting RCP Client via Webstart HOT 16
- Possible racecondition on Service creation and injection? HOT 27
- Wrong Character enconding on % in parameter HOT 3
- Problem running the example com.mycorp.examples.student.remoteservice.host HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jaxrsproviders.