我在Windows 7上运行了tomcat 6.当我在webapps文件夹中部署war文件(foo.war作为示例)时,它会自动部署,但是如果我想重新部署相同的war文件,服务器会报告错误:

SEVERE: Context [/foo] startup failed due to previous errors

当我查看localhost.log文件时,会记录以下异常 .

SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
com.sun.faces.config.ConfigurationException: no web.xml present

但是,如果我按照下面的步骤一切都很好,我的意思是部署/访问foo应用程序就好了 .

  • 关闭tomcat服务器

  • remove foo folder and foo.war file under webapps folder

  • 重新启动tomcat服务器

  • 部署foo.war文件(拖放)

有没有办法我每次必须重新部署foo.war时都不必关闭/重新启动服务器?

[更新]

enter image description here

index.xhtml内容:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">

<h:head><!-- requires head to load JS/CSS for primefaces --></h:head>
<h:body>
<h:outputStylesheet name="creds/css/creds.css" /> <!-- Should be here inside      of h:body -->
<p:layout fullPage="true">
     <p:layoutUnit position="north">
        north
    </p:layoutUnit>>
    <p:layoutUnit position="south">
       south
    </p:layoutUnit>
    <p:layoutUnit position="west" size="320">
        west
    </p:layoutUnit>  
    <p:layoutUnit position="center">
        center
    </p:layoutUnit>    
</p:layout>
</h:body>
</html>