On Mon, 24 Sep 2001, Dan Powell wrote:
> Date: Mon, 24 Sep 2001 11:34:27 -0400
> From: Dan Powell <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: RE: Context Unpacking too Late
>
> Hmm, yes, that does work. I guess the only problem there is that
> getServletContext().getRealPath() returns null, now (as it should) which
> makes it difficult for me to find properties files in /WEB-INF.
>
> Oh well, time to find a different way to load them, I suppose.
>
Or use ServletContext.getResourceAsStream -- it works whether apps are
loaded from war files or directories. For example, you can read your
app's depoyment descriptor like this:
InputStream is =
getServletContext().getResourceAsStream("/WEB-INF/web.xml");
This call is also portable to any conforming servlet container.
Craig McClanahan
> -----Original Message-----
> From: Simphoukham, Southin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 24, 2001 10:41 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Context Unpacking too Late
>
> Try docBase="myApp.war". I notice the same behavior and made the
> changes
> per the documentation and that works.
>
> Southin Simphoukham
>
>
> -----Original Message-----
> From: Dan Powell [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 24, 2001 9:31 AM
> To: [EMAIL PROTECTED]
> Subject: Context Unpacking too Late
>
>
> In Tomcat 4's server.xml, I have the directive <Context path=""
> docBase="myApp" debug="0"/>, and I am deploying the application myApp
> from a war. However, the war has not yet unpacked when Tomcat starts,
> and so when parsing the config file, when it finds that the myApp
> directory does not yet exist, Tomcat fails to start. Presently, I have
> to install the webapp without that Context directive, start Tomcat so
> that it unpacks the war, stop it, add the Context, and restart Tomcat.
> Surely there is a better way....
>
> Help?
>
> --
> J. Daniel Powell
> Sr. Systems Architect
> Wellogic, Inc.
>