Yes, that's what needs to be done. Though I suppose that you still need a default constructor, as Castor is looking for one.

Feel free to open a feature request to have this improved (in case that's what the problem is). And any patches obviously welcome.

Regards
Werner

On 28.02.2011 21:05, John Dzak wrote:
Hello,

When I set my mapping file in my Marshaller instance I'm receiving an
exception that says, "org.exolab.castor.mapping.MappingException: The Java
class
edu.northwestern.bioinformatics.studycalendar.domain.ScheduledActivityState
is not constructable -- it does not contain a default public constructor".
This is correct since the class has a protected default constructor. This
led me to use the set-method field attribute in my mapping file like the
example in the docs[1], so my public constructor which takes one argument
will be used instead of the default constructor.  I tried this, but the same
exception is being thrown.

Is this the right behavior?  It seems that if I set the marshaller to use
the one argument constructor for this class, it shouldn't matter if the
default constructor is not public.

Thanks again,
John

[1]:
http://www.castor.org/xml-mapping.html#Mapping-constructor-arguments-%28since-0.9.5%29


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to