db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiller, Frank RD-AS2" <Frank.Hil...@heidelberg.com>
Subject AW: Location of repository.xml
Date Tue, 14 Jun 2005 07:10:01 GMT
Thanks Thomas, that works fine.
The problem for me is my webapp is installed by an installer as a WAR file. When Tomcat starts
up the WAR file is extracted and OJB has to find it's configuration. So my idea was to install
the configuration files in a separate folder outside the home directory of my webapp. I added
the config directory to the classpath, but this does not help.

So I think I have two choices:
1. Let the installer set "repositoryFile" in OJB.properties to the correct path.
2. Put the repository.xml into WEB-INF/classes, as you suggested.

Or is there a third one?

Thanks................Frank

-----Urspr√ľngliche Nachricht-----
Von: Thomas Dudziak [mailto:tomdzk@gmail.com] 
Gesendet: Montag, 13. Juni 2005 23:50
An: OJB Users List
Betreff: Re: Location of repository.xml

On 6/13/05, Hiller, Frank RD-AS2 <Frank.Hiller@heidelberg.com> wrote:

> I'm using OJB 1.0.3 with Tomcat 5.0.28.
> In my servlet I set
> System.setProperty("OJB.properties",
> "D:/jakarta-tomcat-5.0.28/webapps/MyWebAppConfig/OJB.properties");
> Doing this loads OJB.properties without problems.
> But "repository.xml" is not found though it is located in the same 
> directory.

I'd suggest that you honor the location that the servlet spec suggests for webapp configuration
files, which is WEB-INF or - for resources loaded from the classpath as OJB does - WEB-INF/classes.
If you put your files in there, OJB will find the files automatically (when using the default
configuration), and it will be guaranteed to be portable across servlet containers.
 
Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Mime
View raw message