I had a WAR previously deployed on my local Tomcat (6.0.35) instance called appdata.war, and so the webapps directory looked like:
webapps/
docs/
examples/
host-manager/
manager/
appdata/ (exploded WAR)
ROOT/
appdata.war
I deleted appdata/ and appdata.war (so that Tomcat wouldn’t try to redeploy it) and then added a new war (appmon-qa.war) to this directory. I then ran the Tomcat startup script and saw deployment errors referencing the “old” appdata WAR. I poked around and saw a folder with that name located at ${TOMCAT.HOME}/work/Catalina/localhost/appdata and I deleted it (again, just to prevent Tomcat from re-deploying it). I then re-ran the startup scripts and am seeing this in the catalina log:
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\Program Files\Apache\apache-tomcat-6.0.35\webapps\appdata does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4320)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4489)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
...rest of stacktrace omitted for brevity
Jun 7, 2012 11:35:27 AM org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart()
Jun 7, 2012 11:35:27 AM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Jun 7, 2012 11:35:27 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/appdata] startup failed due to previous errors
Jun 7, 2012 11:35:27 AM org.apache.catalina.core.StandardContext stop
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/appdata] has not been started
Jun 7, 2012 11:35:27 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive appmon-qa.war
Jun 7, 2012 11:35:28 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Jun 7, 2012 11:35:28 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/appmon-qa] startup failed due to previous errors
I assume that my oh-so-perfectly-written appmon-qa.war app is failing to deploy because of some ghost reference to this old appdata.war app. If so, do I (properly) undeploy or delete it from Tomcat altogether so that it doesn’t cause problems for my new app?
Otherwise, if this log output indicates that there is something wrong with appmon-qa.war itself, then where do I start debugging? Usually these “failed due to previous errors” output also includes a reason or source of what the errors are; this output is pretty undescriptive and vague. Thanks in advance!
Take a look at
${TOMCAT.HOME}/conf/Catalina/localhost/appdata.xmland delete it if it exists.