2016-02-25 1:17 GMT+01:00 ravi <[email protected]>: > Hi Romain, > > By making the below changes my rest services are working fine in tomee > 7.0.0-M2 (both jaxrs client and jaxrs service) > > > https://github.com/apache/tomee/blob/120a33c7b4de07ae01c17978ea37d88a911ea860/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRSService.java > > CxfRSService.java (Lines 195 to 217) I registered Wildcard json providers > as default one's and tested my applications > > try { > final List all; > final String userProviders = > SystemInstance.get().getProperty("openejb.jaxrs.client.providers"); > if (userProviders == null) { > (all = new ArrayList<>(2)).addAll(asList( > new WildcardJohnzonProvider<>(), //Register > Wildcard Providers > new WildcardJsrProvider() > )); > } else { > all = new ArrayList<>(4 /* blind guess */); > for (String p : userProviders.split(" *, *")) { > p= p.trim(); > if (p.isEmpty()) { > continue; > } > > > > all.add(Thread.currentThread().getContextClassLoader().loadClass(p).newInstance()); > } > > all.addAll(asList( // added after to be after in the > list once sorted > new WildcardJohnzonProvider<>(), //Register > Wildcard Providers > new WildcardJsrProvider())); > } > > > > *Why Wilcard Json Providers are not the default providers in tomee? * > > It is really good if we make Wilcard Json Providers the default providers. > > > > For you :D
It brings a lot of drawbacks and is not deterministic in several cases, the worse being your provider is not used even if manually registered in a sorted list as first item. That's why we changed this. FYI here is the johnzon related issues https://issues.apache.org/jira/browse/JOHNZON-51 and you can check JAX-RS spec point 4.2.3 which is the origin of this change (forcing the runtime to re-sort the provider list it gets). This broke several cases and we mitigated the most common default case the best we could. > > > > -- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/Tomee-7-0-0-M2-JaxRs-Client-No-message-body-reader-has-been-found-for-class-ContentType-application-n-tp4677664p4677675.html > Sent from the TomEE Users mailing list archive at Nabble.com. >
