i'm using Tomcat, Jersey and Moxy. I have an issue understanding the general problem and how to handle it the 'proper' way:
Jersey is using moxy to transform objects to json. This works out of the box without issues with Classes i wrote.
When using a List<SomeType> i have to wrap this List in a GenericEntity like so:
Now this is a issue but most desturbing to me, the following doesn't work at all:
I get the following exception:
SEVERE: MessageBodyWriter not found for media type=application/json, type=class java.util.ArrayList, genericType=java.util.List<java.lang.String>.
Now for specific questions i have:
- Isn't it the job of moxy to convert java objects to xml/json?
- If so why can it handle String and custome Classes but not something so basic like a List?
- What is the proper way of handling the List<X> issue?
- What is the proper way of handling the List<String> issue?
- Is there a standard which needs to be changed so that moxy can support this? What would be a way to put it into moxy?