RESTEasy client not able to (unmarshale) the string returned by my REST
service.
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)
    @ResponseBody
    public String myTest(@PathVariable Integer id) {
        System.out.println("## myTest: " + "<h2>Hello " + id.toString() +
"</h2>");
        return "<h2>Hello " + id.toString() + "</h2>";
    }


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

    ClientRequest request = new ClientRequest(
                "http://tcmachine:9191/myservice/test/{id}";);
    request.accept("text/html");
    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:
javax.ws.rs.ext.MessageBodyReader.isReadable(Ljava/lang/Class;Ljava/lang/reflect/Type;[Ljava/lang/annotation/Annotation;Ljavax/ws/rs/core/MediaType;)Z
at
org.jboss.resteasy.spi.ResteasyProviderFactory.getMessageBodyReader(ResteasyProviderFactory.java:544)

When I look at the response object in the debugger I see the default
messageBodyReaderInterceptor is GZIPDecodingInterceptor which seems odd.
    messageBodyReaderInterceptors
org.jboss.spi.interception.MessageBodyReaderInterceptor

[org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor@62b56d87
]


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. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to