moxy is not able to convert a List<String> to JSON [message #1753162] |
Thu, 02 February 2017 05:53  |
Eclipse User |
|
|
|
Hi,
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:
new GenericEntity<List<Test>>(tests){};
Now this is a issue but most desturbing to me, the following doesn't work at all:
new GenericEntity<List<String>>(names){};
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?
Tx!
Sigi
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.25060 seconds