You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by pattabi <Pa...@aig.com> on 2009/11/16 17:55:08 UTC

ClasscastException - XmlAnyTypeImpl cannot be cast to - Error

Hi,
I searched the forum and googled but could not get a solution. hence posting
it.

I am using Spring Marshaller with xmlbeans 2.4. In the bean config file, I
am just defined the XmlbeansMarshaller with no properties set.

I am accessing it this way:
ResDecisionServiceType  response = (ResDecisionServiceType)
unmarshaller.unmarshal(source);

and am getting the following error:
org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to
decisionserviceapp.ResDecisionServiceType. 

Please help.
Thanks


-- 
View this message in context: http://old.nabble.com/ClasscastException---XmlAnyTypeImpl-cannot-be-cast-to---Error-tp26375379p26375379.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: ClasscastException - XmlAnyTypeImpl cannot be cast to - Error

Posted by pattabi <Pa...@aig.com>.
Thank you. Yes the xml input is of different schematype. Mistake was
corrected by using the right schema.


Cezar Andrei-3 wrote:
> 
> I'm not familiar with Spring Marshaller, but it seems that the source is
> not parsed in the schema context you expect.
> 
> Also you can declare your response an XmlObject and use changeType method.
> 
> Cezar
> 
>> -----Original Message-----
>> From: pattabi [mailto:Pattabiraman.Meenakshisundaram@aig.com]
>> Sent: Monday, November 16, 2009 10:55 AM
>> To: user@xmlbeans.apache.org
>> Subject: ClasscastException - XmlAnyTypeImpl cannot be cast to - Error
>> 
>> 
>> Hi,
>> I searched the forum and googled but could not get a solution. hence
>> posting
>> it.
>> 
>> I am using Spring Marshaller with xmlbeans 2.4. In the bean config file,
>> I
>> am just defined the XmlbeansMarshaller with no properties set.
>> 
>> I am accessing it this way:
>> ResDecisionServiceType  response = (ResDecisionServiceType)
>> unmarshaller.unmarshal(source);
>> 
>> and am getting the following error:
>> org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to
>> decisionserviceapp.ResDecisionServiceType.
>> 
>> Please help.
>> Thanks
>> 
>> 
>> --
>> View this message in context: http://old.nabble.com/ClasscastException---
>> XmlAnyTypeImpl-cannot-be-cast-to---Error-tp26375379p26375379.html
>> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/ClasscastException---XmlAnyTypeImpl-cannot-be-cast-to---Error-tp26375379p26390786.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: ClasscastException - XmlAnyTypeImpl cannot be cast to - Error

Posted by Cezar Andrei <ce...@oracle.com>.
I'm not familiar with Spring Marshaller, but it seems that the source is not parsed in the schema context you expect.

Also you can declare your response an XmlObject and use changeType method.

Cezar

> -----Original Message-----
> From: pattabi [mailto:Pattabiraman.Meenakshisundaram@aig.com]
> Sent: Monday, November 16, 2009 10:55 AM
> To: user@xmlbeans.apache.org
> Subject: ClasscastException - XmlAnyTypeImpl cannot be cast to - Error
> 
> 
> Hi,
> I searched the forum and googled but could not get a solution. hence
> posting
> it.
> 
> I am using Spring Marshaller with xmlbeans 2.4. In the bean config file, I
> am just defined the XmlbeansMarshaller with no properties set.
> 
> I am accessing it this way:
> ResDecisionServiceType  response = (ResDecisionServiceType)
> unmarshaller.unmarshal(source);
> 
> and am getting the following error:
> org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to
> decisionserviceapp.ResDecisionServiceType.
> 
> Please help.
> Thanks
> 
> 
> --
> View this message in context: http://old.nabble.com/ClasscastException---
> XmlAnyTypeImpl-cannot-be-cast-to---Error-tp26375379p26375379.html
> Sent from the Xml Beans - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org