Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

org.exolab.castor.xml.MarshalException:Unable to instantiate java.util.List

843834Jun 15 2010 — edited Jun 17 2010
Hi,

I am using castor to unmarshal an xml into a java object.
This object has member variables as collections (List).

Even though in the mapping file I used collections attribute of <field> tag and has set it to arraylist, it is still throwing this exception.

After doing a bit of research on this,I found that since UnmarshalHandler uses reflection to create object from xml, it is trying to invoke java.util.List.newInstance() which is causing this problem.

The class which I am trying to unmarshal is an already existing class and I cannot change the type of the member variables to ArrayList from List.

How can it be resolved?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 15 2010
Added on Jun 15 2010
2 comments
1,190 views