Mike,
What is the data type of obj?
Is it a castor-generated value object?
If so, they don't have methods named 'unmarshal',
like this code presumes:
> obj.getClass().getMethod("unmarshal",
> params).invoke(obj, objArray);
Castor-generated classes do, however, contain 'unmarshallFoo()' methods (for objects
named 'Foo')
as long as you don't use the -nomarshall flag on the command line when generating.
Perhaps you meant this:
> Unmarshaller.getClass().getMethod("unmarshal",
> params).invoke(obj, objArray);
> -----Original Message-----
> From: Mike OConnell [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 18, 2003 3:48 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] Wierd differences...
>
>
> Hello All
>
> I'm writing a dynamic loading program and i came across
> something odd:
>
> Version 1:
> Class[] params = {Reader.class};
> Reader in = new BufferedReader(new FileReader(file));
> Object [] objArray = {in};
> obj.getClass().getMethod("unmarshal",
> params).invoke(obj, objArray);
>
> Version 2:
> Reader in = new BufferedReader(new FileReader(file));
> obj = Unmarshaller.unmarshal(obj.getClass(), in);
>
> the obj is instantiated earlier on in the code.
> for some reason version 1 does not want to load the
> data correctly and
> it's child elements give me null, but version 2 works, why?
>
>
> Regards,
>
> Mike
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev