yeah, that kind of proves I'm right about the cause.
Can you please make sure that META-INF/servces/* is correctly unpacked
into your jar and file named
META-INF/services/javax.ws.rs.ext.MessageBodyWriter
contains:
com.sun.jersey.core.impl.provider.entity.StringProvider
com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
com.sun.jersey.core.impl.provider.entity.FileProvider
com.sun.jersey.core.impl.provider.entity.InputStreamProvider
com.sun.jersey.core.impl.provider.entity.DataSourceProvider
com.sun.jersey.core.impl.provider.entity.RenderedImageProvider
com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
com.sun.jersey.core.impl.provider.entity.FormProvider
com.sun.jersey.core.impl.provider.entity.FormMultivaluedMapProvider
com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App
com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$Text
com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$App
com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text
com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$App
com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$Text
com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
com.sun.jersey.core.impl.provider.entity.ReaderProvider
com.sun.jersey.core.impl.provider.entity.DocumentProvider
com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
com.sun.jersey.atom.rome.impl.provider.entity.AtomFeedProvider
com.sun.jersey.atom.rome.impl.provider.entity.AtomEntryProvider
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App
com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App
com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$App
com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$App
com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
com.sun.jersey.json.impl.provider.entity.JSONWithPaddingProvider
com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetRootElementProvider
com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetJAXBElementProvider
com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetListElementProvider
Pavel
On 9/3/11 8:15 PM, avner.eizner wrote:
> Thanks for the answer,
> but even when I do Extract it does not work for me.
> I get the following output:
>
>
>
> C:\test\server>java -jar server.jar
> 2011-09-03 21:06:41.775:INFO::Logging to STDERR via
> org.mortbay.log.StdErrLog
> 2011-09-03 21:06:41.818:INFO::jetty-6.1.x
> 2011-09-03 21:06:41.876:INFO::Started SocketConnector_at_0.0.0.0:8080
> ±⌠Φ 03, 2011 9:06:44 PM com.sun.jersey.api.core.PackagesResourceConfig init
> INFO: Scanning for root resource and provider classes in the packages:
> restServlets
> ±⌠Φ 03, 2011 9:06:45 PM com.sun.jersey.api.core.ScanningResourceConfig
> logClasse
> s
> INFO: Root resource classes found:
> class restServlets.Test
> ±⌠Φ 03, 2011 9:06:45 PM com.sun.jersey.api.core.ScanningResourceConfig init
> INFO: No provider classes found.
> ±⌠Φ 03, 2011 9:06:45 PM
> com.sun.jersey.server.impl.application.WebApplicationImp
> l _initiate
> INFO: Initiating Jersey application, version 'Jersey: 1.8 06/24/2011 12:17
> PM'
> ±⌠Φ 03, 2011 9:06:45 PM com.sun.jersey.spi.container.ContainerResponse write
> SEVERE: A message body writer for Java class java.lang.String, and Java type
> class java.lang.String, and MIME media type text/plain was not found
> ±⌠Φ 03, 2011 9:06:45 PM com.sun.jersey.spi.container.ContainerResponse write
> SEVERE: The registered message body writers compatible with the MIME media
> type are:
> */* ->
> com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
>
> ±⌠Φ 03, 2011 9:06:45 PM com.sun.jersey.spi.container.ContainerResponse
> logException
> SEVERE: Mapped exception to response: 500 (Internal Server Error)
> javax.ws.rs.WebApplicationException: com.sun.jersey.api.MessageException: A
> message body writer for Java class java.lang.String, and Java type class
> java.lang.String, and MIME media type text/plain was not found
> at
> com.sun.jersey.spi.container.ContainerResponse.write(ContainerRespons
> e.java:285)
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1437)
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
> at
> com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
> at
> com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
> at
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
> at
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
> at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
> at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
> at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:326)
> at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
> at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> Caused by: com.sun.jersey.api.MessageException: A message body writer for
> Java class java.lang.String, and Java type class java.lang.String, and MIME
> media type text/plain was not found
> ... 21 more
>
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/jersey-with-jetty-runnable-jar-tp6753636p6757080.html
> Sent from the Jersey mailing list archive at Nabble.com.
>