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:[EMAIL PROTECTED]]
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:[EMAIL PROTECTED]]
> Sent: Tuesday, February 12, 2002 7:58 PM
> To: [EMAIL PROTECTED]
> 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:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to