Hi

We have talked with Charles on Gmail and identified that the issue was to do with the CXF JAXB provider not seeing JAXB annotations, due to the fact the JAXB-annotated classes have been moved to another OSGI bundle.
Two possible solutions :
- update the bundle containing the JAXRS service class to import a 
javax.xml.bind.annotation package
- configure CXF JAXBElementProvider to marshall away without @XMLRootElement 
being available, as described here
http://cwiki.apache.org/CXF20DOC/jax-rs.html#JAX-RS-HandlingJAXBbeanswithoutXmlRootElementannotations

Charles suggested to update JAXBElementProvider so that it logs/reprots why a given element is seen as not readable/writable, something I will do shortly...

thanks, Sergey



Hi,

I have designed a project running on Apache Felix Karaf 1.2.0 and using the
following components :
- Apache CXF : 2.2.5
- Camel-cxf : 2.2.0-SNAPSHOT

This project consists in 4 different bundles :
- REST service
- Model
- DAO
- Route

All the required packages are imported/exported accordingly.

Surprisingly, when I try to do a GET, I receive the following warning
without any error in the log except that the response send to the browser is
"No message body reader has been found for request class ReportIncident":

14:30:38,271 | WARN  | 7...@qtp-8345336-0 | JAXRSUtils                       |
pache.cxf.jaxrs.utils.JAXRSUtils  973 | No message body reader has been
found for request class ReportIncident, ContentType :
application/xml;charset=UTF-8.

In debug mode, I have see that the instance MessageBodyReader is null at the
line 950 of the code

   @SuppressWarnings("unchecked")
   private static <T> Object readFromMessageBody(Class<T> targetTypeClass,
                                                 Type parameterType,
                                                 Annotation[]
parameterAnnotations,
                                                 InputStream is,
                                                 MediaType contentType,
                                                 List<MediaType>
consumeTypes,
                                                 Message m) {

       List<MediaType> types = JAXRSUtils.intersectMimeTypes(consumeTypes,
contentType);

       MessageBodyReader provider = null;
       for (MediaType type : types) {
           provider = ProviderFactory.getInstance(m)
               .createMessageBodyReader(targetTypeClass,
                                        parameterType,
                                        parameterAnnotations,
                                        type,
                                        m);



Where is the issue ?

Regards,



-----
Charles Moulliard
SOA Architect

My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
--
View this message in context: http://old.nabble.com/JAXRSOutInterceptor---346---No-message-body-writer-has-been-found-for-response-class-Incidents.-tp26888538p26888538.html
Sent from the cxf-user mailing list archive at Nabble.com.


Reply via email to