Thanks for your reply.

I tried what you said. I am getting error like

Nested error: org.xml.sax.SAXException: Parsing Error : Premature end of
file.
Line : -1
Column : -1

I used like,

mapping.loadMapping(new InputSource(mappingUrl.toString());
(toAbsolutePath is not available in this class java.net.URL)

I tried so many ways. What is the problem? Can you explain?
Thanks in advance.



Werner Guttmann-6 wrote:
> 
> Hi,
> 
> why not go about using a SAX InputSource for configuring Castor with a
> mapping ? In other words, something similar to ....
> 
> URL mappingurl =
>    getClass().getClassLoader().getResource("com/test/mapping.xml");
> mapping.loadMapping(new InputSource(mappingUrl.toAbsolutePath());
> 
> Kind Regards
> Werner
> 
> On 25.03.2011 08:48, rag007 wrote:
>> 
>> Hi All,
>> 
>> I am using castor 1.3. I am using mapping file. I placed in my mapping
>> file
>> like this
>> 
>> com.test
>>    -TestOne.java
>>    -mapping.xml
>> 
>> In TestOne.java, i am using like
>> 
>> Mapping mapping = new Mapping();
>> mapping.loadMapping("D:/test/TestProject/com/test/mapping.xml");
>> 
>> Instead of the full path, Is it possible to give like this
>> mapping.loadMapping("mapping.xml")?
>> 
>> I tried like this also
>> java.net.URL
>> mappingurl=getClass().getClassLoader().getResource("com/test/mapping.xml");
>> Mapping mapping = new Mapping();
>> mapping.loadMapping(mappingurl);
>> 
>> I am getting error. I dont know the problem.
> What error are you actually getting ?
>> 
>> please help me asap. Thanks in advance.
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Mapping-loading-Filepath-problem-castor-1.3-tp31235772p31237323.html
Sent from the Castor - User mailing list archive at Nabble.com.


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

    http://xircles.codehaus.org/manage_email


Reply via email to