Hi,
I have a problem where a JSON response is not converted to an object while
testing a resource with the jersey test suite. This problem does not occur
on e.g. a linux (ubuntu) machine but it does on my mac.
So I'm looking for confirmation if this is indeed a mac issue.
I created a simple project to show my problem.
https://github.com/thehpi/rest-json
If you can build and test it using 'mvn clean test' without errors then it
works for you, if not, then two tests will fail. Please note I'm redirecting
all maven repository downloads through my own repository server so you might
need to add some repo's in the pom to get it working. (see
http://jersey.java.net/nonav/documentation/latest/user-guide.html#getting-started)
The problem occurs in the class WebAppTest, method testBean. It starts
grizzly and deploys the resource class Resource. The test calls the resource
accepting first xml and then json. Xml works fine, an object is created from
the response but for json it does'nt work. No error is produced but it
simply returns an empty list.
Fiddling around with it taught me that removing the namespace from the
XmlElement annotation on the getBeans() method in the MyJaxbBeans class
solved the issue.
I also added JAXBContextResolver to try and see if I could solve it like
this but no success. Actually, when I remove the namespace from the getBeans
method then it still doesn't work. I also have to de-activate the
JAXBContextResolver to get it working again (by commenting the @Provider
annotation).
As I said, this problem does not occur on ubuntu so I'm baffled.
I hope someone is able to reproduce this problem on a mac (or other os) to
make sure I'm not loosing my mind ;)
thanks for your help
--
View this message in context: http://jersey.576304.n2.nabble.com/namespace-problem-with-JSON-on-mac-tp6903460p6903460.html
Sent from the Jersey mailing list archive at Nabble.com.