泽西岛:com.sun.jersey.server.impl.template.ViewableMessageBodyWriter [英] Jersey: com.sun.jersey.server.impl.template.ViewableMessageBodyWriter

查看:103
本文介绍了泽西岛:com.sun.jersey.server.impl.template.ViewableMessageBodyWriter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对泽西岛完全陌生.我试图运行一个在击中端点时抛出javax.ws.rs.WebApplicationException的jar.该程序引发的错误如下:

I'm totally alien to Jersey. I'm trying to run a jar which throws javax.ws.rs.WebApplicationException when I hit the endpoint. The error thrown by the program is as follows:

09-Apr-2011 08:32:20 com.sun.jersey.spi.container.ContainerResponse写

09-Apr-2011 08:32:20 com.sun.jersey.spi.container.ContainerResponse write

严重:找不到Java类java.lang.String和Java类型类java.lang.String以及MIME媒体类型application/json的消息正文编写器

SEVERE: A message body writer for Java class java.lang.String, and Java type class java.lang.String, and MIME media type application/json was not found

09-Apr-2011 08:32:20 com.sun.jersey.spi.container.ContainerResponse写

09-Apr-2011 08:32:20 com.sun.jersey.spi.container.ContainerResponse write

严重:与MIME媒体类型兼容的已注册消息正文编写者是: /-> com.sun.jersey.server.impl.template.ViewableMessageBodyWriter

SEVERE: The registered message body writers compatible with the MIME media type are: / -> com.sun.jersey.server.impl.template.ViewableMessageBodyWriter

09-Apr-2011 08:32:20 com.sun.jersey.spi.container.ContainerResponse logException

09-Apr-2011 08:32:20 com.sun.jersey.spi.container.ContainerResponse logException

关于从哪里开始进行调试的任何想法?

Any ideas for where to start looking at for debugging?

更新:我在jar的META-INF/services中找到了javax.ws.rs.ext.MessageBodyWriter,内容如下:com.sun.jersey.server.impl.template.ViewableMessageBodyWriter

Update: I've got javax.ws.rs.ext.MessageBodyWriter in the META-INF/services of the jar with the following content: com.sun.jersey.server.impl.template.ViewableMessageBodyWriter

在程序的开头,我看到:com.sun.jersey.server.impl.application.WebApplicationImpl _initiate

And at the beginning of the program I see: com.sun.jersey.server.impl.application.WebApplicationImpl _initiate

推荐答案

您需要在类路径中包括jersey-json模块-请参阅Jersey依赖项页面,该页面包含您需要根据类型包含的依赖项列表您需要的功能: http://jersey.java.net/nonav/documentation/Latest/chapter_deps.html

You need to include jersey-json module on your class path - see the Jersey dependencies page, which has a list of dependencies you need to include based on the type of functionality you need: http://jersey.java.net/nonav/documentation/latest/chapter_deps.html

这篇关于泽西岛:com.sun.jersey.server.impl.template.ViewableMessageBodyWriter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆