Hi,
Jersey 1.0.3 (also 1.0.1 and 1.0.2) breaks resource methods such as:
@GET
@Produces("text/plain")
public String getSimple()
{
return "something";
}
Even the provided Helloworld example is broken.
Also breaks @Produces("text/html"), @Produces("application/xhtml+xml"), etc.
Going back to Jersey 1.0 works fine.
Also, using my own subclasses of javax.ws.rs.ext.MessageBodyWriter work perfectly with all above versions of Jersey.
The exception I get is shown below.
I am using Maven to get Jersey (simply changing "1.0" to "1.0.1", etc. in the POM.xml).
Thanks for help.
Gaëtan Sheridan
The exception is:
INFO: Started org.mortbay.jetty.Server_at_19d0a1
13-May-2009 9:29:20 AM com.sun.jersey.spi.container.ContainerResponse write
SEVERE: A message body writer for Java type, class java.lang.String, and MIME media type, application/xhtml+xml, was not found
13-May-2009 9:29:20 AM com.sun.jersey.server.impl.application.WebApplicationImpl onException
SEVERE: Internal server error
javax.ws.rs.WebApplicationException
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:240)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:593)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
13-May-2009 9:29:20 AM com.sun.jersey.spi.container.ContainerResponse write
SEVERE: A message body writer for Java type, class java.lang.String, and MIME media type, application/octet-stream, was not found
13-May-2009 9:29:20 AM org.mortbay.jetty.servlet.ServletHandler handle
WARNING: /srv/ws/doc/resources:
javax.ws.rs.WebApplicationException
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:240)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:599)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
HTTP: 09:29:20 925 INFO [ ] JettyWebServer 127.0.0.1 - GET /srv/ws/doc/resources HTTP/1.1 500 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0 x64; en-US; rv:1.9.0.7) Gecko/2009030713 Minefield/3.0.7"