I have a Java web app which I'm deploying using Tomcat but I'm having some trouble with this.
The problem is that my web app has to talk to some native libraries (via JNI) and those libraries do not handle errors that gracefully so if I try to start Tomcat and the native calls fail Tomcat startup halts partway through and does not start.
What I would like to do is have Tomcat not start this web app when it starts as I'll be using other means to start the web app which will ensure that the native calls will work. Specifically the native calls are to talk to another system which must already be running for the native calls to succeed.
One interesting thing I've found is that if I reload the app once Tomcat is successfully running failures in the native libraries only cause the context to fail and Tomcat continues running fine.
I've googled around and seen pointers to the context.xml file but it is unclear to me if I can use this to achieve my aim as the Tomcat reference doesn't seem to list any properties which stop a context automatically being loaded at startup.
Tomcat 6 behavior for deploying apps at startup is controlled by the
deployOnStartup
parameter in aHost
element in theserver.xml
file;However with autoDeploy set to "true" tomcat also supports hot deployment of war and context files that are located in the appBase or the
conf/localhost/Catalina
folder, so its not clear whether tomcat would see those existing war files and deploy them also. Hence it might be necessary to setautoDeploy="false"
also. In that scenario you would need to use tomcat manager tool to deploy your webapps to the running tomcat server