RESTEasy server in OSGI can't process annotations

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!

Answers


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


Need Your Help

iPhone/iPod - prevent font-size-changing

iphone css css3 orientation ipod

I was wondering whether it is possible to prevent following behaviour:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.