Hi, it is likely to do with JSONProvider now in another module,
cxf-rt-rs-extension-providers, can you load it please ?
I'll add it to the multibundle distro
Cheers, Sergey
On 13/06/13 17:11, NCorbet wrote:
Hello all,
I didn't want to hijack the existing thread that allam started but it may be
a similiar problem and solution, so I added my own.
I have the following class:
@XmlRootElement
public class SimpleObject implements Serializable{/**
*
*/
private static final long serialVersionUID = -7048688656613033399L;
private String name;
private String text;
public SimpleObject(){
this.setName("SimpleObject");
this.setText("This is some simple Text");
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
This service:
@Path("/report")
public interface ReportService {
@GET
@Path("/request")
@Produces(MediaType.APPLICATION_JSON)
public SimpleObject getRequest();
}
This impl:
public class BirtReportService implements ReportService{
public SimpleObject getRequest() {
return new SimpleObject();
}
}
This Spring configuration:
<osgi:reference id="reportService"
interface="org.syntech.reports.shared.services.ReportService" />
<osgi:service
interface="org.syntech.reports.shared.services.ReportService">
<osgi:service-properties>
<entry key="service.exported.interfaces" value="*" />
<entry key="service.exported.configs"
value="org.apache.cxf.rs" />
<entry key="service.exported.intents" value="HTTP" />
<entry key="org.apache.cxf.rs.databinding" value="jaxb"
/>
<entry key="org.apache.cxf.rs.in.interceptors"
value="org.apache.cxf.interceptor.LoggingInInterceptor" />
<entry key="org.apache.cxf.rs.out.interceptors"
value="org.apache.cxf.interceptor.LoggingOutInterceptor" />
<entry key="org.apache.cxf.rs.provider">
<array>
<ref bean="jsonProvider" />
</array>
</entry>
<entry key="org.apache.cxf.rs.address"
value="${address-base-url}/ReportService" />
</osgi:service-properties>
<ref bean="reportService" />
</osgi:service>
<bean id="jsonProvider"
class="org.apache.cxf.jaxrs.provider.json.JSONProvider" >
<property name="singleJaxbContext" value="true" />
<property name="extraClass">
<list>
<value>org.syntech.reports.shared.domain.SimpleObject</value>
</list>
</property>
</bean>
This all works fine when using DOSGI 1.3. Once I migrated to DOSGI 1.4, I
get the following:
Jun 13, 2013 12:04:48 PM org.apache.cxf.interceptor.LoggingInInterceptor
INFO: Inbound Message
----------------------------
ID: 5
Address: http://localhost:9001/syntech-reports/ReportService/report/request
Http-Method: GET
Content-Type: application/json
Headers: {Accept=[application/json], accept-encoding=[gzip, deflate],
Accept-Language=[null], connection=[keep-alive],
content-type=[application/json],
Cookie=[JSESSIONID=kxblc992kyyxi8d0mp0v4gb1; settingStore=1371064495728_0],
Host=[localhost:9001], User-Agent=[Mozilla/5.0 (Windows NT 6.1; WOW64;
rv:21.0) Gecko/20100101 Firefox/21.0]}
--------------------------------------
Jun 13, 2013 12:04:48 PM
org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor
writeResponseErrorMessage
WARNING: No message body writer has been found for response class
SimpleObject.
Jun 13, 2013 12:04:48 PM org.apache.cxf.interceptor.LoggingOutInterceptor
INFO: Outbound Message
---------------------------
ID: 5
Response-Code: 500
Content-Type: text/plain
Headers: {Date=[Thu, 13 Jun 2013 16:04:48 GMT]}
Payload: No message body writer has been found for response class
SimpleObject.
I can change to JacksonJaxbJsonProvider and I get the appropriate json back,
but when I use JacksonJaxbJsonProvider with its annotation introspector ( to
allow it to process jaxb annotations) another service I use fails because I
have an abstract class with @XmlSeeAlso annotation. Apparently this is not
implemented yet in Jackson? I really do not want to use Jackson specific
annotations. The default Jettison worked fine in this instance in the old
CXF.
Any insight?
--
View this message in context:
http://cxf.547215.n5.nabble.com/JaxRs-Yet-another-Unmarshall-Marshall-issue-with-CXF-2-7-2-tp5729213.html
Sent from the cxf-user mailing list archive at Nabble.com.
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com