users@jersey.java.net

[Jersey] NSIMPL/LinkedHashMap type returned when getting data via Jersey

From: Eric Reagan <reaganej_at_gmail.com>
Date: Sun, 11 Sep 2011 19:26:00 -0400

Hello,
     I have been trying to create a generic way to return lists and map data
with Jersey. I have followed the tutorial on
http://stackoverflow.com/questions/818327/jaxb-how-should-i-marshal-complex-nested-data-structures/818399#818399and
I can get Lists of Strings and Integers just fine using the above
method. I can also get back custom classes I create and own just fine.

    However, I have several classes which a supplier of mine gave me. They
only have @XmlType annotations. An example is like below

@Xmltype(propOrder("name","description","recordType")
public class Record
{
.....
}

When I try to use Jersey to get a list of records I get a list of NSIMPL
when I do xml or a List of LinkedHashMaps when I use JSON. When I use XML
and cast the NSIMPL as a Node and then re-run it through my JAXBContext
provider, created exactly like the Jersey examples suggest, I get the typed
objects I am looking for.

   I don't understand what I am doing wrong so that when I get a Record type
I get a NSIMPL but when I do String or some other class I made everything
works just fine?

   I was doing a lot of searching and I'm not sure if its related to this
issue I saw on Jira http://java.net/jira/browse/JERSEY-747 ?

Thank you,
-- 
Eric Reagan