tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wouter Boers" <>
Subject RE: Tomcat can't open my file
Date Wed, 05 Sep 2001 15:58:28 GMT

You need to loopup the exaxt location of the properties file via the
Class.forname structure. That returns the input stream to the file which you
can then load into the contrucor of the properties.

This is the line that does this:
is =
ResourceAsStream("/" + DEFAULT_PROPSFILE);

Where the classname is the fully qualified name of the class that tries to
locate the properties file.


-----Original Message-----
From: []On Behalf Of
Enrique Marcote Peña
Sent: 01 September 2001 12:13
To: Tomcat-user mailing list
Subject: Tomcat can't open my file


I have Tomcat 3.2.2 running over Debian Potato and I'm trying to install
a simple JSP application with database access.

I've got a connection pool that works fine when I run it directly with
java. In the root of my classes directory I have a couple of files, a
log file called "ServidorConexiones.log" and the properties file


The source file for the Connection manager is


And reads the with these sentences...

public class ServidorConexiones {

     * <p>Nombre del fichero de propiedades empleado para la definición
de los
     * pools.
    static private String properties = "";


     * <p>Constructor privado que inicializa el servidor y todos sus
     * asociados.  Definiendo el constructor como privado se garantiza
     * comportamiento Singleton de la clase.  Las demás clases deberán
     * acceder a la instacia del servidor a través del método
     * <code>getInstance</code>.
    private ServidorConexiones() {
        Properties prop = new Properties();
        try {
            prop.load(new FileInputStream(properties));
        } catch (Exception e) {
            System.err.println("Error opening " +  properties + " file:
" + e);


As I said before, when I run my test applications from de classes
directory directly with java it works fine.  Then, for testing with JSP,
I copy the classes directory to:


After restarting Tomcat, my JSP test application fail opening the file:

Error opening file: (No such file or directory)

What should I do to make this file available for Tomcat?

Any help will be greatly appreciated.  Thanks,


View raw message