Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在tomcat 6上自动部署war文件_Tomcat_Deployment_War - Fatal编程技术网

在tomcat 6上自动部署war文件

在tomcat 6上自动部署war文件,tomcat,deployment,war,Tomcat,Deployment,War,我让Tomcat6在Windows7上运行。当我在webapps文件夹内部署war文件foo.war作为示例时,它会自动部署。但是,如果我要重新部署同一war文件,服务器会报告一个错误: SEVERE: Context [/foo] startup failed due to previous errors 当我查看localhost.log文件时,记录了以下异常 SEVERE: Exception sending context initialized event to listener i

我让Tomcat6在Windows7上运行。当我在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服务器 删除webapps文件夹下的foo文件夹和foo.war文件 重新启动tomcat服务器 部署foo.war文件拖放 有没有一种方法可以让我不必每次重新部署foo.war时都关闭/重新启动服务器

[更新]

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>

特定的Tomcat版本?提示:您应该使用最新版本,目前是6.0.44。你应该开始考虑升级到Tomcat 8.0.x.@Christopher:谢谢你的回复。我现在使用6.0.37作为测试平台。如果我将foo.war的新副本拖放到webapps文件夹中,我想将您的声明解释为6.0.44将完全删除之前部署的foo.war。我只是想确保您使用的是Tomcat 6的最新版本。Tomcat6已经很老了,所以版本号上的微小变化有时意味着它们之间要经过几年的时间。无论如何,您的web应用程序中有META-INF/web.xml文件吗?我明白了。是的,它在web-INF中有web.xml。有人可以纠正我的以下陈述,但很久以前,当我在linux平台的tomcat 6上部署war文件时,我不记得我必须手动关闭/重新启动应用服务器。我可以简单地把它扔掉,然后应用程序服务器将旧的删除,然后安装新的。感谢您抽出时间阅读本帖。这只是我方便的问题。我会考虑迁移到Tomcat 8。祝你有幸福的一天!Tomcat仍将进行autp更新。但您所说的似乎是Tomcat抱怨缺少web.xml文件。事实上,这不是Tomcat在抱怨。。。这是Java Faces。你能发布完整的堆栈跟踪吗?