users@jersey.java.net

[Jersey] Re: namespace problem with JSON on mac ?

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Tue, 18 Oct 2011 14:24:32 +0200

Hi,

interesting issue. I can't reproduce, your project is incomplete, mvn
clean test complains about missing resources and I checked that
src/main/resources is missing (and inovices.xsd is not present anywhere
else).

Can you please push invices.xsd and other required files into mentioned
repo and ping me?

Regards,
Pavel

error msg:

[ERROR] Failed to execute goal
org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.8.0:generate (invoices) on
project rest-json: Execution invoices of goal
org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.8.0:generate failed: basedir
/Users/pavel/Desktop/thehpi-rest-json-4a0e6a9/src/main/resources does
not exist -> [Help 1]


On 10/18/11 8:46 AM, thehpi wrote:
> 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.
>