This discussion is archived
7 Replies Latest reply: Mar 8, 2010 2:19 PM by EJP RSS

XMLEncoding an ArrayList - InstantiationException

843790 Newbie
Currently Being Moderated
Hi all. I am trying to XMLEncode an ArrayList for another class to decode and use, but I keep getting:
java.lang.InstantiationException: Locations.Location
Continuing ...
java.lang.Exception: XMLEncoder: discarding statement ArrayList.add(Location);
Continuing ...

The ArrayList stores objects of type Location, and the way these errors look indicates to me that there is a problem with the objects I am trying to store in the ArrayList and then XMLEncode.

Can anyone drop me a couple of hints here? Or advise a better way of making the contents of an ArrayList in one class accessible to another?

Many thanks.