Title: RE: [castor-user] problem with mapping.xml

Hi Marco,

It might be because the castor classes are in a parent classloader to the one where your business classes are loaded from.

Make sure you construct your Mapping object with the classloader that contains your classes.

Something like:
mapping = new Mapping(getClass().getClassLoader());
mapping.loadMapping(getClass().getResource("mapping.xml"));

Hope that helps :-)
Claude


> -----Original Message-----
> From: Marco Mistroni [mailto:[EMAIL PROTECTED]]
> Sent: 7 June 2004 14:48
> To: [EMAIL PROTECTED]
> Subject: [castor-user] problem with mapping.xml
>
>
>
> Hi all
>       I m using Castor XML2j in a J2EE application..
>
> I am experiencing problems with the Mapping.xml file, in the sense
> That it tells me 'org.exolab.castor.mapping.MappingException: Nested
> error: org.exolab.castor.mapping.MappingException: Could not find the
> class com.myapp.Request
>
> But that class is in the same JAR as the mapping.xml..
>
> And, if I run my application NOT in an application server
> Everything works just fine....
>
> Anyone has any idea on what could be wrong?
>
> Regards
>       marco
>
>
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-user
>
__________________________________________________________________________
· This email and any files transmitted with it are CONFIDENTIAL and intended
solely for the use of the individual or entity to which they are addressed.

· Any unauthorized copying, disclosure, or distribution of the material within
this email is strictly forbidden.

· Any views or opinions presented within this e-mail are solely those of the
author and do not necessarily represent those of Odyssey Asset Management
Systems SA unless otherwise specifically stated.

· An electronic message is not binding on its sender.  Any message referring to
a binding engagement must be confirmed in writing and duly signed.

· If you have received this email in error, please notify the sender immediately
and delete the original.

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to