You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by du...@bankone.com on 2003/06/11 18:20:22 UTC

ClassCast Exception when returning an object from the Digester.parse method

Hello, when I use the digester I am having an issue when I try to get the
return object from the digester.parse method. I know what kind of object it
is returning, but when I try to cast it as that object it throws a
ClassCast Exception.  What is strange is that when I cast it as an object,
it works fine and when I get the className on the object it is the object
type that I am expecting. But again when I try to cast that to the object
type that I know it is, it throws the ClassCast Exception. This is how I am
putting the class onto the digester stack.

digester.addObjectCreate("site-config",
"techone.groups.appcontainer.conf.SiteConfig", "className");

Any help would be greatly appreciated - dk





This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: ClassCast Exception when returning an object from the Digester.parse method

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
this smells like a classloader problem.

you might need to take a look at digester.setContextClassloader and 
digester.setClassloader methods.

- robert

On Wednesday, June 11, 2003, at 05:20 PM, duncan_l_krebs@bankone.com wrote:

> Hello, when I use the digester I am having an issue when I try to get the
> return object from the digester.parse method. I know what kind of object 
> it
> is returning, but when I try to cast it as that object it throws a
> ClassCast Exception.  What is strange is that when I cast it as an object,
> it works fine and when I get the className on the object it is the object
> type that I am expecting. But again when I try to cast that to the object
> type that I know it is, it throws the ClassCast Exception. This is how I 
> am
> putting the class onto the digester stack.
>
> digester.addObjectCreate("site-config",
> "techone.groups.appcontainer.conf.SiteConfig", "className");
>
> Any help would be greatly appreciated - dk
>
>
>
>
>
> This transmission may contain information that is privileged, 
> confidential and/or exempt from disclosure under applicable law. If you 
> are not the intended recipient, you are hereby notified that any 
> disclosure, copying, distribution, or use of the information contained 
> herein (including any reliance thereon) is STRICTLY PROHIBITED. If you 
> received this transmission in error, please immediately contact the 
> sender and destroy the material in its entirety, whether in electronic or 
> hard copy format. Thank you.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org