tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: how to load a property file in tomcat4.1.24???
Date Tue, 13 May 2003 13:17:27 GMT


Or search the archives.

WEB-INF/classes is automatically on the "classpath" for your webapp and
JSP.  You don't need to modify the classpath environment variable nor
any of the classpaths in tomcat's startup scripts.

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: pawan []
>Sent: Tuesday, May 13, 2003 9:12 AM
>To: 'Tomcat Users List'
>Subject: how to load a property file in tomcat4.1.24???
>Hello Everyone,
>in my application's web-inf/classes folder i have a package named
>in that i have a file ""
>in which i am loading a property file in static block, by using the
>ClassLoader.. now to load ALERT_CONFIG_FILE this file should eb in
>classpath. so i have set the classpath to
>and i have put my file Shyam.config in there. But its giving error when
>call this class by a jsp page in tomcat.
>Its working file if i use command line argument e.g.
>I think i need to set the CLASSPATH variable for tomcat window where
>console output comes.
>Please help me how i can make it work?? Or is there any other
>Thank you in advance.
>Here is a part of source code
>private static final String ALERT_CONFIG_FILE ="Shyam.config";
>	{
>        try
>		{
>            cfg =  getAlertConfig();
>		}
>		catch(Exception e){}
>    }
> public static Properties getAlertConfig() throws IOException
>	{
>		Properties prop = new Properties();
>		try
>		{
>			InputStream fin =
>			prop.load(fin);
>			System.out.println("File Loaded Successfully");
>		}
>		catch(Exception e)
>		{
>			System.out.println("Either ALERT Configuration
file: '"
>+ALERT_CONFIG_FILE+"' Not found in CLASSPATH or it can not be read");
>		}
>		System.out.println("........"+prop);
>		return prop;
>    }
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message