Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Castor

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I'm a beginner to castor. Im using a mapping file and marshalling some objects.
In a certain class, I have a HashSet member, that stores a collection of another object. I have getter and setter but they dont actually take in and return HashSets; rather their input is an array of objects. please see below.
eg.
class Test {
HashSet data; // say, this stores a set of objects of type MyObj.
public void setData(MyObj[] objs) {
// convert the array into hashset and store.
}
public MyObj[] getData () {
// convert the hashset to array and return.
}
}
when i try to marshall this object, i get an exception related to this field, like
"access resulted in exception: java.lang.reflect.InvocationTargetException"
My mapping file has the following lines, incase u need it -
type="packagename.MyObj"
get-method="getData"
set-method="setData"
collection="array">

Please tell me where I'm going wrong.
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Since Caster is an OpenSource project, please follw that one for replies.
 
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    Bookmark Topic Watch Topic
  • New Topic