我试图重新部署一个我最近取消部署但不断获得org.apache.catalina.LifecycleException
. Tomcat 无法正确加载上下文。
这是触发搜索的原因:
FAIL - Unable to delete [/var/lib/tomcat7/conf/Catalina/localhost/app.xml].
The continued presence of this file may cause problems.
以下是 log 中的错误catalina.out
,重新排列以适合该列:
WARNING: Calling stop() on failed component [{0}] to trigger clean-up
did not complete.
org.apache.catalina.LifecycleException:
An invalid Lifecycle transition was attempted ([after_stop]) for
component [org.apache.catalina.startup.FailedContext@13150fc] in state
[FAILED]
WARNING: Error while removing context [/app]
java.lang.ClassCastException:
org.apache.catalina.startup.FailedContext cannot be cast to
org.apache.catalina.core.StandardContext
向上滚动,我注意到了一个完整的SEVERE
错误列表,首先是:
SEVERE: Parse error in context.xml for /app
org.xml.sax.SAXParseException;
systemId: file:/etc/tomcat7/Catalina/localhost/app.xml/;
lineNumber: 1;
columnNumber: 1;
Content is not allowed in prolog.
这与无法在 Tomcat 7 中完全取消部署 Web 应用程序或安装 JSTL 导致 org.xml.sax.SAXParseException: Content is not allowed in prolog 无关,尽管我浪费了很多时间查看这些内容。一切似乎都应该如此,所以我被难住了。最后,我自己解决了。我的答案如下。