tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: Tomcat Manager deploy and undeploy
Date Thu, 05 Jun 2003 17:03:35 GMT

One clarification and a solution...

At 12:48 PM 6/5/2003 -0400, you wrote:
>I finally had my Catalina-Ant undeploy task working after I included
>context.xml into my war's META-INF directory. What this deployment doing is
>
>- war is uploaded to $CATALINA/work/Standalone/my.host/manager;
>- war is unpacked into $CATALIAN_HOME/webapps/myapp;

completely false

It is actually (partially) unpacked to 
CATALINA_HOME/work/Standalone/my.host/myapp .  I say "partially" because 
only contents of the WEB-INF/classes and WEB-INF/lib directory are 
extracted to said place.

>- context.xml is extracted to manager directory as myapp.xml;
>- server.xml is modified to include the content in myapp.xml;
>- myapp is loaded.
>
>I noticed that myapp's docBase in the modified server.xml is the war in
>manager directory. This helps to undeploy myapp but prevents me from reading
>my configuration xmls from WEB-INF/conf. I cannot
>getServletContext().getRealPath("/") to get $CATALINA_HOME/webapps/myapp.
>According to Servlet API doc, getRealPath returns null if content is
>available from war. I don't want to hard-code the path into web.xml as
>init-param or into my init Servlet. Does any one have input?

This one is easy.  Never ever use File IO unless there is no other way to 
do what you need.  I this case, you can use 
context.getResourceAsStream("/WEB-INF/myconfigfile.properties");

See the javadoc for ServletContext for other ways to do this as well.

Jake


>Regards,
>
>
>
>PQ
>
>"The difference between 'involvement' and 'commitment'
>is like an eggs-and-ham breakfast: the chicken was
>'involved' - the pig was 'committed'."

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message