I'm trying to use Jersey with Jackson in Android, but I got the following error:
Could not find class 'javax.xml.stream.XMLInputFactory', referenced from method org.glassfish.jersey.message.internal.MessagingBinders$MessageBodyProviders.configure
Here is my code:
public static List<Task> getAllTasks() {
WebTarget target = client.target(TARGET).path(ALL_TASKS_RESOURCE)
.queryParam("lang", "en");
List<Task> tasks = target.request(MediaType.APPLICATION_JSON_TYPE)
.get().readEntity(new GenericType<List<Task>>() {});
return tasks;
}
I found out that StAX XML parser is not a part of Android, but there are some alternatives. I just don't understand why Jersey wants to stream XML, and not just fetch it from the server and let Jackson to map it to POJO?