----- Original Message -----
From: "Bruce Snyder" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 5:32 PM
Subject: Re: [castor-dev] database.xml


> This one time, at band camp, michel said:
>
> m>Is there a way to change the location of the "database.xml" file?
> m>
> m>castor is looking for the file in a directory that does not exist; I can
always create/release a patch/hack to create the feature...
> m>
> m>The eror is:
> m>Nested error: org.xml.sax.SAXParseException: File
"file:///usr/share/tomcat-4.01/bin/database.xml" not found.
>
> Michel,
>
> The path in which to look for the database desciptor is not hard coded in
> Castor. Your application contains to the code which tells Castor where
> to look. Based on the error above, I would say that your application is
> simply performing a jdo.loadConfiguration( "database.xml" ) which looks
> in the directy from which the application was started (i.e. the Tomcat bin
> dir). I suggest loading it from the CLASSPATH as noted in the following
> thread:
>
>     http://www.mail-archive.com/[EMAIL PROTECTED]/msg07008.html


Being kind of slow, I had to really think about this! This is how I
implemented Bryce's great response to my problem:

- In the code I used:

         jdo = new JDO();
         jdo.setDatabaseName(Config.DATABASE_NAME);
         jdo.setConfiguration(Config.databaseXml());   // points to the
'database.xml' file, which I can call whatever I wish,

// along  with the file path of my choice.



Thanks Bruce!

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

Reply via email to