Hi,

It looks like you are using one fo the static unmarshal() methods on the 
Unmarshaller class, which will *not* consider any mapping you set previously on 
this instance. Can you please switch to using one fo the non-static unmarshal() 
methods ß 

Werner

> -----Original Message-----
> From: Venkataramana [mailto:[EMAIL PROTECTED] 
> Sent: Mittwoch, 21. Februar 2007 08:00
> To: [email protected]
> Subject: [castor-user] MarshalException "The class for the 
> root element 'xsd' could not be found"
> 
> 
> Hi all,
> 
> We are working on Marshalling and Unmarshalling XML data using castor.
> While running test.xml we are getting the below exception.
> 
> MarshalException "The class for the root element 'Dtapp' 
> could not be found"
> 
> Below is the code i wrote in XMLTransform.java
> 
>  public final Object unmarshal(String xml)  {
>   StringReader stringReader = new StringReader( xml );
>   if (xml == null)
>      {
>        Logger.log("XMLTransformer\t unmarshal\t XML is null");
>      }
>         
>   InputSource inputSource = new InputSource( stringReader );
>   Object o = null;
>   try 
>     {
>      unmarshaller.setResolver ((XMLClassDescriptorResolver) xcdr);
>      unmarshaller.setValidation(true); //jk - set to false if 
> there is a performance impact.
>      o =  unmarshaller.unmarshal(Dtapp.class, inputSource );
>     }
>   catch (ValidationException e)
>     {
>      Logger.log("XMLTransformer\t unmarshal\t ValidationException"+e);
>     }
>   catch (MarshalException e1) 
>     {
>      Logger.log("XMLTransformer\t unmarshal\t MarshalException"+e1);
>     }
>   catch (Exception e2)
>     {
>      Logger.log("XMLTransformer\t unmarshal\t Exception"+e2);
>     }
>   return o;
> }
> 
> Can any one suggest me where the problem was?
> 
> Thanks & Regards,
> Venkat.
> --
> View this message in context: 
> http://www.nabble.com/MarshalException-%22The-class-for-the-ro
> ot-element-%27xsd%27-could-not-be-found%22-tf3265114.html#a9076206
> Sent from the Castor - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 

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

    http://xircles.codehaus.org/manage_email

Reply via email to