Tomcat 7.0.12上“部署配置描述符时出错”的原因

时间:2011-05-04 17:35:43

标签: java tomcat java-ee

当我尝试通过将WAR文件放入webapps目录来部署它时,我在控制台中收到以下消息:

04.05.2011 19:34:07 org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying configuration descriptor xyz.war

我没有在日志中找到关于此详细原因的任何提示。

我在哪里可以找到有关此故障的详细信息(例如堆栈跟踪)?

这是web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
    <display-name>myapp</display-name>
    <context-param>
        <description>
    Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>
    <servlet>
        <servlet-name>Project Control Center Application</servlet-name>
        <servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
        <init-param>
            <description>
        Vaadin application class to start</description>
            <param-name>application</param-name>
            <param-value>at.mycompany.myapp.ProjectControlCenterApplication</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>Project Control Center Application</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
    <listener>
        <listener-class>at.mycompany.myapp.impl.persistence.DatabaseStartStopServletContextListener</listener-class>
    </listener>
    <session-config>
        <session-timeout>480</session-timeout>
    </session-config>
</web-app>

2 个答案:

答案 0 :(得分:2)

我找到了答案。问题的原因是格式错误的context.xml文件。

答案 1 :(得分:0)

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" ...>
    <welcome-file-list>
        <welcome-file>
            ...
        </welcome-file>
    </welcome-file-list>
    <servlet>
        <servlet-name>info</servlet-name>
        <servlet-class>servlets.info.Properties</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Properties</servlet-name>
        <!-- Here I forget to change the servlet name to info -->
        <!-- So, the reason is invalid web.xml file -->
        <url-pattern>/Properties</url-pattern>
    </servlet-mapping>
</web-app>

仔细检查您的web.xml文件。

相关问题