You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David LAFAY <da...@laposte.net> on 2003/09/11 09:49:15 UTC

ClassPath with Tomcat 4.1

Hello,

Tomcat 3.x have a wrapper.properties file.
Where is it on tomcat 4.1.x release.

I don't know how to configure classpath for my webApp

Thanks,

David
david.lafay@laposte.net




RE: ClassPath with Tomcat 4.1

Posted by Mike Curwen <gb...@gb-im.com>.
David,

If you place your properties files in WEB-INF/classes , then they are
guaranteed to be on the class loading path for the web application.
 
I use the following code in my webapps:

Properties p = new Properties();
Files.loadConfigFile("/database.properties", p);

And in my 'Files' class, the loadConfigFile method looks something like:

public static Properties loadConfigFile(String fileName, Properties def)
{

	Properties props = new Properties();

	try {
	logger.debug("USING Files.class.getResourceAsStream(" + fileName
+ ")");
	InputStream input = Files.class.getResourceAsStream(fileName);

	if (input != null) {
		try {
			props.load(input);
		} catch (Exception e)	{

		} finally {
			try {
				input.close();
			} catch (Exception e) {
				//well, we played nice.
			} 
		}
	}
	return props;
}

> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of David LAFAY
> Sent: Thursday, September 11, 2003 3:30 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: ClassPath with Tomcat 4.1
> 
> 
> Thanks but...
> 
> When the following code :
> System.getProperty("java.class.path")
> 
> return only C:\Program Files\Apache Group\Tomcat 
> 4.1.27\bin\bootstrap.jar
> 
> It is a problem for me because I use the java.class.path to 
> search my properties files
> 
> And then I don't find it !
> 
> 
> "Kwok Peng Tuck" <pe...@makmal.net> a écrit dans le 
> message news: 3F602CB5.1080906@makmal.net...
> > Classes for your webapp are looked for  in either  : 
> WEB-INF/lib; as a 
> > jar file or WEB-INF/classes; non jar files So for example 
> if you have 
> > a jar file that you want to use in your web app, put them in your 
> > webapp's WEB-INF/lib. You should be able to use them.
> >
> > David LAFAY wrote:
> >
> > >Hello,
> > >
> > >Tomcat 3.x have a wrapper.properties file.
> > >Where is it on tomcat 4.1.x release.
> > >
> > >I don't know how to configure classpath for my webApp
> > >
> > >Thanks,
> > >
> > >David
> > >david.lafay@laposte.net
> > >
> > >
> > >
> > >
> > 
> >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: 
> tomcat-user-help@jakarta.apache.org
> > >
> > >
> > >
> > >
> > >
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


Re: ClassPath with Tomcat 4.1

Posted by David LAFAY <da...@laposte.net>.
Thanks but...

When the following code :
System.getProperty("java.class.path")

return only C:\Program Files\Apache Group\Tomcat 4.1.27\bin\bootstrap.jar

It is a problem for me because I use the java.class.path to search my
properties files

And then I don't find it !


"Kwok Peng Tuck" <pe...@makmal.net> a �crit dans le message news:
3F602CB5.1080906@makmal.net...
> Classes for your webapp are looked for  in either  : WEB-INF/lib; as a
> jar file or WEB-INF/classes; non jar files
> So for example if you have a jar file that you want to use in your web
> app, put them in your webapp's WEB-INF/lib.
> You should be able to use them.
>
> David LAFAY wrote:
>
> >Hello,
> >
> >Tomcat 3.x have a wrapper.properties file.
> >Where is it on tomcat 4.1.x release.
> >
> >I don't know how to configure classpath for my webApp
> >
> >Thanks,
> >
> >David
> >david.lafay@laposte.net
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
> >
> >
> >




Re: ClassPath with Tomcat 4.1

Posted by Kwok Peng Tuck <pe...@makmal.net>.
Classes for your webapp are looked for  in either  : WEB-INF/lib; as a 
jar file or WEB-INF/classes; non jar files
So for example if you have a jar file that you want to use in your web 
app, put them in your webapp's WEB-INF/lib.
You should be able to use them.

David LAFAY wrote:

>Hello,
>
>Tomcat 3.x have a wrapper.properties file.
>Where is it on tomcat 4.1.x release.
>
>I don't know how to configure classpath for my webApp
>
>Thanks,
>
>David
>david.lafay@laposte.net
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>  
>


Re: ClassPath with Tomcat 4.1

Posted by Bill Barker <wb...@wilshire.com>.
4.1.x uses the (deprecated) JavaService to install a Windows service.  You
can continue to use (the even more deprecated, but at least it works :)
jk_nt_service from 3.x, or consider using the 5.x commons-daemon 'procrun'
(my personal recommendation).

"David LAFAY" <da...@laposte.net> wrote in message
news:bjp9gr$em8$1@sea.gmane.org...
> Hello,
>
> Tomcat 3.x have a wrapper.properties file.
> Where is it on tomcat 4.1.x release.
>
> I don't know how to configure classpath for my webApp
>
> Thanks,
>
> David
> david.lafay@laposte.net