Using the main.java from the link you provided, Castor will look in the current working directory for mapping.xml. If you call java from a directory other than where the classes are, Castor won't be able to find the mapping file. You can move the mapping.xml to the directory you call java from, or if you plan on keeping your mapping file in the classpath, you can look into the getResource method in java.lang.Class or java.lang.ClassLoader. I've had success using these methods as follows:

myMap.loadMapping(
   MyDriver.class.getResource( "/castor/examples/map.xml" ) );

Where my map.xml is in the castor.examples package in the classpath. For the getResource call, the "root" directory is the root of the classpath rather than the physical filesystem.

Hope that helps,
Stephen

[EMAIL PROTECTED] wrote:
Hi,

if I want to start the example from here http://www.castor.org/xml-mapping.html#4.-Usage-Pattern

following exception will be thrown

java.io.FileNotFoundException: mapping.xmlmapping.xml (Das System kann den angegebenen Pfad nicht finden)

Why? The "mapping.xml" is in the same path as the classes.

-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to