users@jersey.java.net

Jersey JSON unmarshalling of array elements.

From: <EWILLIAMS_at_CERNER.COM>
Date: Fri, 22 Jan 2010 10:21:01 -0600

Hopefully, you can point me to the right people if you do not handle JSON questions.

I'm fairly new to Jersey, and have been producing/consuming xml for the most part.
I am using: jersey-json 1.1.4.1, jersey-server 1.1.4.1 and jaxb-impl 2.1.12.
I am using all defaults (no JSON provider, mapped

The issue:
The JSON I produce from a very simple test @GET does not get correctly unmarshalled when I pass it in to my @POST.
Specifically, the root object is created

Here is the JSON:

{
    "holderId" : "6666",
    "tests" : [
        {
            "allergyId" : "1111",
            "type" : "firstOne"
        },
        {
            "allergyId" : "2222",
            "type" : "secondOne"
        }
    ]
}


So there is an outer (JAXB-generated) class called TestArrayHolder which is created, but no properties are populated!
The marshalling seems to work like a charm, but I can get anything to unmarshall...

One last note that could be related: I run on Geronimo, so I had to add the hidden classes to get the JSON marshalling to pick up my project's xml/binding jars.
<sys:hidden-classes>
      <filter>com.sun.xml</filter>
      <filter>javax.xml.bind</filter>
</sys:hidden-classes>

I'm not sure what else to try from here. Can you help?

Thank you,
Ed


----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.