472,954 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,954 software developers and data experts.

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 5015

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

Similar topics

3
by: Brahim Machkour | last post by:
Hello, I'm using JAXB to export/import data from/to a DB through XML files. Everything is working well. I would like also to be able to edit the file using an editor, typically XMLSpy....
4
by: jesper | last post by:
Hi I am currently following the tutorial from IBM (http://www-106.ibm.com/developerworks/xml/edu/x-dw-xjaxb-i.html) I have three problems at the moment. 1. It says else where that when the...
1
by: Scott Bates | last post by:
I am attempting to create a JAXB Object that returns the CollectionType as a List. In my schema file, I used the following: <jxb:globalBindings> collectionType="java.util.Vector"...
0
by: MNapoli | last post by:
Hi all, I am wondering if there is a way to tell JaxB, when unmarshalling, to do not try to ignore a piece of xml (a tag and all the sub-tags)? Thanks, MNapoli.
13
by: Christoph Brunner | last post by:
Hi, on the sun homepage i had submit to the bugparade a request for feature enhancement for the JAXB API. After a period of time sun called me to post my request to a newsgroup an get comments...
1
by: kandra2k1 | last post by:
Hi, I created a JAXB Marshalling client. I have to get data from database and then build the XML file. My client Program is working 100% fine with upto 15000 records. But, when i tried to 50000...
2
by: d-42 | last post by:
Hi, I'm pretty sure I've just got a Marshalling problem, but I'm completely stumped. If there is a better newsgroup to post this in, please point me towards it. First I'm trying to use...
1
by: d-42 | last post by:
Hi, I'm pretty sure I've just got a Marshalling problem, but I'm completely stumped. If there is a better newsgroup to post this in, please point me towards it. First I'm trying to use...
0
by: malsh1358 | last post by:
Hi I need check required elements and attributes in JAXB java classes , if there are any value for them place it , otherwise place default value in xml file , because of it I upgrade JAXB2.0 to...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.