tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael D. Spence" <spe...@panix.com>
Subject Where should I put properties files
Date Thu, 18 Sep 2003 14:57:21 GMT
I have a web service (call it XYZ) which requires a .properties file.  I had
been putting it in
%CATALINA_HOME%\webapps\axis\services\XYZ, with the classes in
%CATALINA_HOME%\webapps\axis\services\WEB_INF\classes and using this to
open the properties file.

    File PFile = new File("webapps" + File.separator +
                          "axis" + File.separator +
                          "services" + File.separator +
                          "XYZ" + File.separator + "XYZ.properties");

    if (!PFile.exists())
      throw new CFException("No properties file: " +
PFile.getAbsolutePath());

This works, but there are two problems:

1) If Tomcat is run as a service, I have to put the properties file in
%CATALINA_HOME%\webapps\axis\services\XYZ, instead.

2) I recently ditched the classes and put XYZ.jar into
%CATALINA_HOME%\webapps\axis\services\WEB_INF\lib.  Now, unless I hard-code
a path for the properties file (e.g., C:\XYZ.properties), the service can't
find it.

How is this issue normally handled?

Michael D. Spence
Mockingbird Data Systems, Inc.


Mime
View raw message