468,537 Members | 1,960 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,537 developers. It's quick & easy.

JAXB marshalling and unmarshalling an ArrayList

1
Hello,

I am new to JAXB. So I would like somebody to help me solve this problem.

I have a class say Test which contains only a List which has some 6 to 7 user defined objects. I am able to marshal the Test object to an xml file. But while unmarshalling back to the java object, I am getting a NullPointerException and a part of the trace is pasted below

java.lang.NullPointerException
at com.sun.xml.bind.v2.runtime.reflect.Accessor$Gette rSetterReflection.set(Accessor.java:283)
at com.sun.xml.bind.v2.runtime.reflect.TransducedAcce ssor$CompositeTransducedAccessorImpl.parse(Transdu cedAccessor.java:196)
at com.sun.xml.bind.v2.runtime.unmarshaller.LeafPrope rtyLoader.text(LeafPropertyLoader.java:25)
at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lingContext.text(UnmarshallingContext.java:380)
at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnec tor.processText(SAXConnector.java:148)

Additional information:
If I edit the xml file such that the list contains only one object then unmarshalling works fine.
Also I am using jaxb-xjc2.0EA3.jar,jaxb-impl2.0EA3.jar and jaxb-api2.0EA3.jar

I would like to know if anything else is to be done to unmarshal the List object or if i have to use any other jars to make unmarshalling work.Thanks in advance.

Best Regards
Manish
Feb 29 '08 #1
0 4837

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Brahim Machkour | last post: by
4 posts views Thread by jesper | last post: by
1 post views Thread by Scott Bates | last post: by
reply views Thread by MNapoli | last post: by
1 post views Thread by kandra2k1 | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.