tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Austad" <baus...@xtendsoft.com>
Subject RE: Loading property files using ClassLoader.getSystemResource()
Date Wed, 13 Feb 2002 16:57:48 GMT
I use a class with static methods to load properties.  getResource() does
not return a static URL, so I cannot use it within my static method.
getSystemResource() returns a static URL.

-----Original Message-----
From: Randy Layman [mailto:randy.layman@aswethink.com]
Sent: Wednesday, February 13, 2002 4:32 AM
To: 'Tomcat Users List'
Subject: RE: Loading property files using
ClassLoader.getSystemResource()



	First, you could use getResource instead of getSystemResource.
System Resource doesn't use the class loader delegation and only uses the
root class loader.  Second, if you don't want to change your code, you need
to modify the wrapper.properties file.  In there it builds up a classpath
that is then passed on to Java.  You could add your directory to that
classpath.

	Randy


> -----Original Message-----
> From: Bryan Austad [mailto:baustad@xtendsoft.com]
> Sent: Tuesday, February 12, 2002 7:58 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Loading property files using ClassLoader.getSystemResource()
>
>
> I use ClassLoader.getSystemResource() to load property files
> through out my
> application.  I then am able to set the directory of where
> these property
> files are located in the CLASSPATH.  I then can load the
> property files.
> With Tomcat 4.0.2 using the NT/2K service, and cannot specify
> a directory of
> where these property files are, therefore they are not
> loading.  I tried
> putting these resources(property files) in the
> WEB-INF/classes directory,
> the %CATALINA_HOME%/classes directory, or the
> %CATALINA_HOME%/common/classes
> directory.  Still I am unable to load the property files.  I
> even tried the
> lib directories at all levels.  The only way I could get this
> to work was
> modifying the catalina.bat file and appending to the
> CLASSPATH.  I want it
> to work with the NT/2K service though.  Is it possible?  Or
> am I going to
> need to redesign how I load the property files in my application?
>
> Thanks
> Bryan
>
>
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message