Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apache-tomcat 7.0 does not unpack .war?

Tags:

java

tomcat

I want to deploy my app to the server, and then I can visit the app like this:

http://10.10.10.10/index.jsp

but not

http://10.10.10.10/bar/index.jsp

so this is my host configuration in server.xml:

   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Context docBase="/home/foo/bar.war" reloadable="false" path=""/>
   </Host>

But, after I start up tomcat

sh $CATALINA_HOME/bin/startup.sh

I found that tomcat does not unpack the war file in $CATALINA_HOME/webapps. then I try to delete all files in $CATALINA_HOME/webapps/ROOT, but it does not matter. so is there someone come cross this issue before? and how to solve the probelm?

like image 488
MouJian Avatar asked Mar 08 '13 13:03

MouJian


People also ask

Why my WAR file is not deployed in Tomcat?

Try stopping Tomcat, deleting the war and matching folder, copying the new war in, then starting Tomcat. If it works then, the problem might be left over files. (I have an app for example that doesn't completely clean itself up). (3) The app might not be initializing properly due to issues with the app.

How do I know if war is deployed in Tomcat?

The definitive way to determine if a war has finished deploying and the webapp has started is to look in the catalina. out log. A message will be logged. In operational terms, Tomcat will respond to a request made to that webapp in various ways depending on how far along it is.

Can we deploy WAR file in Tomcat?

Perhaps the simplest way to deploy a WAR file to Tomcat is to copy the file to Tomcat's webapps directory. Copy and paste WAR files into Tomcat's webapps directory to deploy them. Tomcat monitors this webapps directory for changes, and if it finds a new file there, it will attempt to deploy it.


1 Answers

Tomcat 7 does not unpack WAR files from outside the Host's appBase into the appBase.

Tomcat 7 will run your application from the WAR.

like image 71
Mark Thomas Avatar answered Sep 20 '22 23:09

Mark Thomas