简体   繁体   中英

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

I got this error

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

when I execute this code

 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));

what is the problem ?

I deleted all generated classes and all restful classes and the GroupUClient then the program works without problems.

change from

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");
}

to

 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");
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM