未找到Java类java.util.List和Java类型java.util.List<>以及MIME媒体类型text / html的消息正文阅读器

时间:2013-06-11 07:44:20

标签: java web-services

我收到了这个错误

A message body reader for Java class java.util.List, and Java type java.util.List<Entities.service.GroupU>, and MIME media type text/html was not found

执行此代码时

 GroupUClient client1 = new GroupUClient();
        ClientResponse response = client1.findAll_XML(ClientResponse.class);

        GenericType<List<GroupU>> genericType = new GenericType<List<GroupU>>() {
        };
// Returns an ArrayList of Players from the web service
        data = new ArrayList<GroupU>();
        data = (response.getEntity(genericType));

有什么问题?

1 个答案:

答案 0 :(得分:0)

我删除了所有生成的类和所有的restful类以及GroupUClient,然后程序运行没有问题。

改变
public ChatuserClient() {
    com.sun.jersey.api.client.config.ClientConfig config = new com.sun.jersey.api.client.config.DefaultClientConfig();
    client = Client.create(config);
    webResource = client.resource(BASE_URI).path("entities.chatuser");
}

 public ChatuserClient() {
        com.sun.jersey.api.client.config.ClientConfig config = new com.sun.jersey.api.client.config.DefaultClientConfig();
        client = Client.create(config);
        webResource = client.resource(BASE_URI).path("entities.service.chatuser");
    }