RESTEasy client not able to (unmarshale) the string returned by my REST
The only RESTEasy examples I find are for returning a user defined class but
there must be a way to get a basic string.  What am I doing wrong here?

I have a very simple REST service that returns a string.
I can verify the RESTEasy client call does reach the service.

 -- service is a Spring 3.0 REST service running on Tomcat 6
    @RequestMapping(value = "/test/{id}", method = RequestMethod.GET)
    public String myTest(@PathVariable Integer id) {
        System.out.println("## myTest: " + "<h2>Hello " + id.toString() +
        return "<h2>Hello " + id.toString() + "</h2>";

-- RESTEasy Client running in JBoss 4.2 using
    I had to replace resteasy-jaxrs-1.0-beta-5.jar with
    in order to get the ClientRequest and ClientResponse classes.

    ClientRequest request = new ClientRequest(
    request.pathParameter("id", 333);
    try {
        ClientResponse<String> response = request.get(String.class);
        if (response.getStatus() == 200){
            String str = response.getEntity();
        } ...

The response.getEntity() call throws error
Caused by: java.lang.NoSuchMethodError:;Ljava/lang/reflect/Type;[Ljava/lang/annotation/Annotation;Ljavax/ws/rs/core/MediaType;)Z

When I look at the response object in the debugger I see the default
messageBodyReaderInterceptor is GZIPDecodingInterceptor which seems odd.


Any help would be appreciated.
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Ciosco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities.
Resteasy-users mailing list

Reply via email to