Tomcat Error on deploy / undeploy on an application

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base <application> does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:141)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3855)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4024)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)

Tomcat throws this error when the <application> path is hard-coded/set in the context but it doesn’t find the corresponding directory.

One possible reason can be that the application/war has been removed from the webapps directory but the context for this exist. Try removing the context from the conf at location {CATALINA_HOME}/conf/{Engine}/{Host}/<applicationname>.xml

Example:
You have an application called testapplication.war in webapps and now you replaced it with tryapp.war. This may lead to
above mentioned error.

Solution:
1. Remove the {CATALINA_HOME}/conf/Catalina/localhost/testapplication.xml
2. Enjoy 🙂

Reference:
http://www.mulesoft.com/tomcat-context

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s