无法调用Tomcat管理器:FAIL - 在上下文路径上部署应用程序但上下文无法启动

时间:2013-06-17 10:11:53

标签: tomcat

当我尝试使用Tomcat 7和Maven部署Spring应用程序时出现此错误:

  

无法调用Tomcat管理器:FAIL - 在上下文中部署应用程序   path / DocumentManagerGui但上下文无法启动


我的Maven的 settings.xml 文件是:

<server>  
    <id>localhost</id>  
    <username>script</username>  
    <password>script</password>  
</server>  


我的 tomcat-users.xml 文件是:

<role rolename="manager-gui"/>   
<role rolename="manager-script"/>  
<role rolename="manager-jmx"/>  
<role rolename="manager-status"/>  
<role rolename="admin-gui"/>  
<role rolename="admin-script"/>  

<user username="script" password="script" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>  


我的上下文文件位于src目录下的META-INF文件夹中。 content.xml 是:

<?xml version="1.0" encoding="UTF-8"?>   
<Context  antiJARLocking="true" antiResourceLocking="true">

    <WatchedResource>WEB-INF/web.xml</WatchedResource>  

    <Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"  />  

    <Transaction factory="com.atomikos.icatch.jta.UserTransactionFactory" timeout="60" />  

</Context> 


POM 文件中的我的Tomcat插件配置为:

<plugins>  
    <plugin>  
        <groupId>org.codehaus.mojo</groupId>  
        <artifactId>tomcat-maven-plugin</artifactId>  
        <configuration>  
            <url>http://localhost:8080/manager/text</url>  
            <path>/DocumentManagerGui</path>  
            <server>localhost</server>  
            <mode>both</mode>  
        </configuration>  
    </plugin>  
</plugins> 

1 个答案:

答案 0 :(得分:2)

  

我想了解一下这个问题的所有常见问题,包括参考链接和结构良好的教程。

我恐怕无法评估可能触发tomcat显示此错误的所有可能问题,因为错误过于通用且有太多常见情况可以触发它。试图做到这一点就像试图猜测崩溃的未知应用程序只知道它崩溃的事实。

可以肯定地说的原因是这个错误的原因是应用程序初始阶段出现了问题。

从我的实践中我可以想到一些通用的案例集:

  1. 在app init上抛出PermGen Space错误(大多数情况下这是类加载器泄漏的结果)。

  2. ServletContextListener实现中处理app init时抛出了一些异常(其原因可能是从某些框架的错误配置到未解析的类依赖性)。

  3. 其他的东西。真的,tomcat可能存在某种形式或其他原因的错误配置/故障。

  4. 处理此错误的最有效方法来检查:

    1. 应用程序的日志(您可以在其中找到日志,具体取决于您在webapp中如何设置日志记录)

    2. tomcat的日志(通常你可以在{tomcat dir}/logs中找到这些)

    3. ...获取有关导致错误的原因的更多信息并处理问题的根源。试图以其他方式解决这个问题就像打击风车一样。

      希望这会有所帮助。

相关问题