Hi,
I've spent the last day trying to do this with no success and here is what I 
would like to do:

What I want to be able to do
--------------------------------------------------------------
Have a custom virtual host called "myApp", this host will run one 
web-application, and that web application should respond at the "/". I would 
also like to deploy this web-application via the manager interface. From time 
to time I would like to stop the application , undeploy it and then re-deploy a 
new war for "myApp". Preferably I would like to be able to define the Context 
in META-INF rather than on the tomcat server itself. Regardless I can live for 
now with having to define it locally on the tomcat server. 

Seems pretty straightforward. I've put the following together after reading the 
docs and getting some help on this list.

Here is what I have setup so far

Custom Directories
-----------------------
TOMCAT_HOME/myAppBase
TOMCAT_HOME/myDocBase/myApp

SERVER.XML
------------------------------
       <Host name="myAppHost" appBase="myAppBase" unpackWARs="true" 
autoDeploy="true">
                <Context path="/manager" 
docBase="${catalina.home}/server/webapps/manager"
                         privileged="true" antiResourceLocking="false" 
antiJARLocking="false">

                  <ResourceLink name="users" global="UserDatabase"
                                type="org.apache.catalina.UserDatabase"/>

                </Context>
        </Host>


TOMCAT_HOME/conf/Catalina/myAppHost/ROOT.xml
-----------------------------------------------------------------------------

<!-- NOTE in addition to the below I have tried a docBase of 
${catalina.home}/myDocBase/myApp.war as well with no success-->

<Context docBase="${catalina.home}/myDocBase/myApp"
   debug="0"
   workDir="c:\temp\work"
   reloadable="true" 
   override="true"
   swallowOutput="true"
   crossContext="false" >

</Context>


STARTUP TOMCAT
-------------------------------------------
a) Now, I start up tomcat. Note I have nothing deployed to this server yet. 

b) Secondly I then go to http://myAppHost:8080/manager/html

c) There I see two applications listed: "/" & "/manager" as I would expect. 
Nothing responds at "/" because I have not deployed yet.

d) I proceed to upload (via manager app) my WAR named "myApp.war" and specify 
the path "/". Press "deploy".

e) Tomcat proceeds to upload "myApp.war" into "myAppBase" and then expand the 
war to the following dir structure. "myApp/ROOT/". The new application is now 
deployed at http://myAppHost:8080/myApp however nothing responds because the 
web.xml is under myApp/ROOT/WEB-INF/web.xml and not directly under myApp.

f) Wait a second.. everything I have read is that the docBase must NOT live 
under the appBase, yet tomcat just deployed my application in just this 
fashion. However the application will not start because Tomcat is looking for 
myApp/WEB-INF/web.xml, and it does not exist there. It exists where tomcat put 
it myApp/ROOT/WEB-INF/web.xml. The docBase I defined in my ROOT.xml is ignored 
or I am doing something wrong. From all my tests so far, I am having trouble 
following the usage of docBase and its significance.

g) Note I have also attempted specifying my docBase to be 
${catalina.home}/myDocBase/myApp.war with no success either.

java.lang.IllegalArgumentException: Invalid or unreadable WAR file : C:\Program 
Files\Apache Software Foundation\Tomcat 5.5\myDocBase\myApp\myApp.war
    at 
org.apache.naming.resources.WARDirContext.setDocBase(WARDirContext.java:130)
    at 
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3855)

h) Lastly I have also tried deleting the conf/Cataling/myAppHost/ROOT.xml. In 
this case tomcat starts up, I upload a ROOT.war file, with no 
META-INF/context.xml. Tomcat deploys this to myAppBase/ROOT/ROOT.  If I upload 
the war file as "myApp.war", tomcat expands it to myAppBase/myApp and it runs 
OK, but...not under "/". In either case the specification of a "docBase" seems 
to have no effect.

j) I have also tried defining all of this directly in server.xml. However 
tomcat will not allow me to deploy applications to contexts defined in 
server.xml. The manager interface returns an error.

Any assistance appreciated. I'm pretty confused at this point.












---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to