• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

how correctly produce json by RESTFUL web service on Fuse ESB?

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using FUSE ESB and CXf and JSON, I implement a restful web service as the following:

RestFul Method:
public User handleGeUser() {
User user = new User();
return user;
The provider in the bundle-context.xml
<bean class="org.apache.cxf.jaxrs.provider.JSONProvider">
<property name="dropRootElement" value="true" />
<property name="supportUnwrapped" value="true" />

and I got this error "No message body writer has been found for response class User." when calling the my rest service.

could any one advise?
Ranch Hand
Posts: 426
Eclipse IDE Fedora Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may need to follow the documentation about auto-discovery of new components (note Fuse is ServiceMix, and uses Apache Camel to define mediation) :


to support auto-discovery of your component add a file to META-INF/services/org/apache/camel/component/FOO where FOO is the URI scheme for your component and any related endpoints created on the fly. The latter file should contain the definition of the component class. For example if your component is implemented by the com.example.CustomComponent class, the service file should contain the following line - class=com.example.CustomComponent .

Camel empowers you to define routing and mediation rules in a variety of domain-specific languages, including a Java-based Fluent API, Spring or Blueprint XML Configuration files, and a Scala DSL. This means you get smart completion of routing rules in your IDE, whether in a Java, Scala or XML editor.
Apache Camel uses URIs to work directly with any kind of Transport or messaging model such as HTTP, ActiveMQ, JMS, JBI, SCA, MINA or CXF, as well as pluggable Components and Data Format options. Apache Camel is a small library with minimal dependencies for easy embedding in any Java application. Apache Camel lets you work with the same API regardless which kind of Transport is used - so learn the API once and you can interact with all the Components provided out-of-box.
Apache Camel provides support for Bean Binding and seamless integration with popular frameworks such as Spring, Blueprint and Guice. Camel also has extensive support for unit testing your routes.
The following projects can leverage Apache Camel as a routing and mediation engine:
Apache ServiceMix - a popular distributed open source ESB and JBI container
Apache ActiveMQ - a mature, widely used open source message broker
Apache CXF - a smart web services suite (JAX-WS and JAX-RS)
Apache Karaf - a small OSGi based runtime in which applications can be deployed
Apache MINA - a high-performance NIO-driven networking framework
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic