Try this
 
Mapping mapping = new
Mapping(Thread.currentThread().getContextClassLoader());

mapping.loadMapping("castor_mapping.xml");

 

- Harjit


________________________________

        From: Barron, Ken (KCTP) [mailto:[EMAIL PROTECTED] 
        Sent: Tuesday, July 10, 2007 11:55 AM
        To: [email protected]
        Subject: [castor-user] Problem loading xml mapping file
        
        

        Hi 
        I'm new to castor and I must be doing something very silly, but
I can't get my xml mapping file to load.  I am using the latest version
of castor, castor-1.1.2.1.jar

        I have placed the file castor_mapping.xml on the classpath of my
webapp (directly under WEB-INF/classes where all my other .properties
files and config files are being picked up successfully).

        I am using the instructions: 
        Mapping mapping = XMLContext.createMapping(); 
        mapping.loadMapping("castor_mapping.xml"); 

        and I get the following FileNotfound exception: 
        java.io.FileNotFoundException:
castor_mapping.xml\castor_mapping.xml (The system cannot find the path
specified) 

        Notice how the filename is repeated twice? 

        I tried variations on the load statement such as 
        Mapping mapping = new Mapping(); 
        mapping.loadMapping("castor_mapping.xml"); 

        but they all give the same result. 

        What am i doing wrong? 

        Regards 
        Ken 




This email, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed.  If the reader of this email is not the 
intended recipient or his or her authorized agent, the reader is 
hereby notified that any dissemination, distribution or copying of this 
email is prohibited. If you have received this email in error, 
please notify the sender by replying to this message and delete this 
email immediately.

Reply via email to