【问题标题】:Severe error in re-deploying servlet - silly error重新部署 servlet 时出现严重错误 - 愚蠢的错误
【发布时间】:2013-09-16 17:14:29
【问题描述】:

我正在尝试重新部署一个我最近取消部署的 servlet,但一直收到 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.

以下是来自日志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.

这与Cannot Undeploy a web-app completely in Tomcat 7Installing JSTL results in org.xml.sax.SAXParseException: Content is not allowed in prolog 无关,尽管我在这些方面浪费了很多时间。一切似乎都应该如此,所以我被难住了。最后,我自己解决了。我的答案如下。

【问题讨论】:

    标签: servlets tomcat7


    【解决方案1】:

    原来我已经部署了

    /path/to/servlet/web/
    

    作为 XML 配置文件而不是

    /path/to/servlet/website.xml
    

    正如 Tomcat 所期待的那样。

    快速检查我的其他浏览器保存的表单内容发现了这个自我错误,所以我在这里发布一个问答,希望这可以节省一些时间。

    各位,手动部署时请小心。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-05
      • 2022-01-21
      • 2019-08-20
      相关资源
      最近更新 更多