axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Vardeman <>
Subject Re: Finding a WEB Service's Directory
Date Thu, 12 Sep 2002 20:00:16 GMT

this gets you to the WEB-INF directory in the webapp.  I'm saving service 
configuration stuff there, though there have been some threads where people 
have suggested cleaner ways of getting configuration information.


At 02:50 PM 9/12/2002 -0500, you wrote:

>How do I find the directory where my service's '.class' files reside (and
>from which they were loaded)?  I need to be able to read/write files specific
>to my service, and its intallation directory would seem to be the right 
>Using Tomcat 4.0.4 and Axis beta 3, File() creates and opens always go to
>the <CATALINA_HOME>/bin directory. In other words:
>         File(".").getAbsolutePath();
>returns "C:\jakarta-tomcat-4.0.4\bin\."
>I do not wish to hard-code the path to my service
>(ie: <CATALINA_HOME>/webapps/axis/WEB-INF/classes/myservice) since it will 
>for each deployment container used (WEB Logic, Tomcat, etc).
>The file "test.txt" exists in the "myservice" subdirectory -and- in
>the "myservice/resource" subdirectory; I've tried:
>         URL = getClass.getClassLoader.getResource("test.txt");
>         URL = getClass.getClassLoader.getSystemResource("test.txt");
>         URL = 
> MessageContext.getCurrentContext.getClassLoader.getResource("test.txt");
>None of the above worked.
>Thanks & Regards,

View raw message