On Tue, Apr 21, 2009 at 08:37:53AM +0200, Paul Sandoz wrote:
> Hi Gene,
>
> Does this work correctly when you marshall and unmarshall to/from XML?
>
> Can you send an example of the serialized JSON?
>
> Can you describe a bit more how you are de-serializing?
>
> I wonder if it is the namespace declarations:
>
> @OneToMany(mappedBy = "participant", cascade = CascadeType.ALL,
> fetch = FetchType.EAGER)
> @XmlElement(name = "Group",
> namespace =
> "urn:com:lmco:energyc2:seeload:participantsvc:ejb")
> private List<Group> group;
>
> @OneToMany(mappedBy = "participant", cascade = CascadeType.ALL,
> fetch = FetchType.EAGER)
> @XmlElement(name = "LoadControlDevice",
> namespace =
> "urn:com:lmco:energyc2:seeload:participantsvc:ejb")
> private List<LoadControlDevice> loadControlDevice;
>
> IIRC there are some issue with namespaces and JSON. Jakub knows more about
It is probably indeed the namespaces. As we do not support them yet.
I was thinking of adding such a support into the next version.
Gene, it would be the most useful, if you could file a bug [1] and
attach an example (ideally maven based) test case application.
I suspect the root causes for [2] and you issue might be the same.
Thanks,
~Jakub
[1]
https://jersey.dev.java.net/issues/
[2]
https://jersey.dev.java.net/issues/show_bug.cgi?id=272
> this than I.
>
> Paul.
>
> On Apr 21, 2009, at 12:10 AM, Turner, George wrote:
>
>> I am trying to get some help on resolving an issue on some new code using
>> 1.0.3 that is using the “natural” implementation for JSON.
>> My classes all have JAX XML annotations, as created using JAXB XJC.
>>
>> I have a top level parent Participant class containing two Lists of child
>> Group and Devices classes. The Group and Device classes have a reference
>> to parent Participant that is annotated XMLTransient.
>>
>> When I serialize to JSON, everything works fine, but when the JSON
>> de-serializes to Java, the Lists are null.
>>
>> If anyone can provide some pointers as to what is happening or how to fix
>> it, it would be greatly appreciated.
>>
>> The classes are attached. ( I have already tried removing the XmlType and
>> XmlRootElement annotations in the child classes with no change)
>>
>> George (Gene) Turner
>> <image001.png>
>> Senior Staff Software Engineer
>> Information Systems & Global Services
>> Work:(719) 277-5244 Cell:(719) 237-0490
>> george.turner_at_lmco.com
>>
>>
>> <LoadControlDevice.java><Participant.java><Group.java>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>