Reputation: 10075
I'm trying to use RestEasy inside Equinox. The only document that I've seen on the web for this configuration is here: http://sarbarian.wordpress.com/2010/03/07/resteasy-and-osgi-perfect-match/
I've followed the steps here and fixed a few things, but I got stuck at this point. When I call a url on the server, the call reaches the annotated class and method, but resteasy can't seem to serialize the result. I get the error:
org.jboss.resteasy.core.SynchronousDispatcher
SEVERE: Failed executing GET /sample2/hello
org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: java.lang.String of media type: */*
I've created an OSGI bundle from RestEasy Jars (2.2.1.GA). The bundle automatically exports all packages. Somehow the OSGI class loader is failing to load a required class I guess. I'd really appreciate input, since I am really stuck!
Upvotes: 1
Views: 1117
Reputation: 66
I came across the same issues. In my effort to resolve this I created the following item:
https://issues.jboss.org/browse/RESTEASY-640
From my research I I ended up going with the following options:
A simple code example of how an OSGi bundle can use an embedded Resteasy instance: bitbucket.org/mark1900/resteasy-osgi-embedded
A simple code example of how an OSGI bundle can export a Resteasy Service that other OSGi bundles can integrate and use: bitbucket.org/mark1900/resteasy-osgi-service
Upvotes: 2