0

i placed war file on shared drive. And i set docBase in my tomcat ...\conf\Catalina\localhost\myapp.xml like this:

When shared drive is up then tomcat (AutoDeployOnStartup=true) checks war and deploy it successfully. But when shared drive is down then tomcat (on startup) failed to start myapp and does not use already deployed webapp\myapp (which was deployed previously).

is it possible to run previously deployed /webapp/myapp if docBase war file is not available? Or what fail-over solution you are using if docBase war file is not available?

trix0gen
  • 11
  • 2

1 Answers1

0

When myapp is unavailable (not deployed), the request will be handled by the ROOT web application. (You can create a directory "ROOT/myapp" there, or configure a Servlet or Filter to that path, to deal with the outage in a more sophisticated way).

I wonder what would happen if ..\conf\Catalina\localhost\myapp.xml file is actually a symlink to a file on your shared drive (that goes AWOL when the drive is unavailable). Will Tomcat use the unpacked war from webapps directory, or not? (It ..\conf\Catalina\localhost\myapp.xml exists, it takes priority over webapp\myapp. Reference. That is why am am wondering what will happen if myapp.xml is a symlink.)

Generally, I think that you should not deploy the web application to a shared drive. You can upload it to the server automatically through the Manager web application (e.g. with an Ant task or with curl + PUT request). The Manager application can also get the war from a remote source.

UPDATE

There also exist such tool as FarmWarDeployer (javadoc, example, reference). It pulls wars from a remote source.

Konstantin Kolinko
  • 3,854
  • 1
  • 13
  • 21
  • tomcat (when starting) takes war file from shared drive and then deploy it to local webapp folder on the server. When tomcat is running it is not use shared drive anymore , because webapp\myapp folder is local on the server. – trix0gen Oct 23 '18 at 08:47