java - FAIL - 上下文路径/CONTROL 中的应用程序无法启动

标签 java jsf tomcat

当我尝试在 tomcat 7 上部署我的 WAR 文件 Web 应用程序时遇到问题。它昨天工作正常,但我认为 web.xml 中存在问题。我试图按下开始按钮但收到此消息:

FAIL - Application at context path /CONTROL could not be started

谁能帮帮我?

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_3_0.xsd"
version="3.0">

<display-name>Archetype Created Web Application</display-name>
<filter>
    <filter-name>LoginFilter</filter-name>
    <filter-class>org.primefaces.examples.view.LoginFilter</filter-class>
</filter>

<!-- Set the login filter to secure all the pages in the /secured/ * path 
    of the application -->
<filter-mapping>
    <filter-name>LoginFilter</filter-name>
    <url-pattern>/secured/ *</url-pattern>
</filter-mapping>

<!-- By default go to secured welcome page -->
<welcome-file-list>
    <welcome-file>secured/welcome.xhtml</welcome-file>
</welcome-file-list>

<filter>
    <filter-name>urlRewriteFilter</filter-name>
    <filter-class>org.primefaces.examples.view.UrlRewriteFilter
    </filter-class>
</filter>

<filter-mapping>
    <filter-name>urlRewriteFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
</filter-mapping>


<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>

<welcome-file-list>
    <welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/ *</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
</servlet-mapping>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

<context-param>
    <description>State saving method: 'client' or 'server' (=default). See
        JSF Specification 2.5.2</description>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
</context-param>

<context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext
    </param-name>
    <param-value>resources.application</param-value>
</context-param>

<listener>
    <listener-class>com.sun.faces.config.ConfigureListener
    </listener-class>
</listener>

<context-param>
    <param-name>primefaces.THEME</param-name>
    <param-value>custom-theme</param-value>
</context-param>
</web-app>

日志文件:

http://sams-app.com/catalina.out

最佳答案

我看到您的 web.xml 的某些部分似乎被注释了。它显示为灰色。您发布的那个在您的工作环境中是否也相同。下面是灰色的部分。


</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF   
Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>custom-theme</param-value>
 </context-param>
  <filter>
<filter-name>urlRewriteFilter</filter-name>
<filter-class>org.primefaces.examples.view.UrlRewriteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>urlRewriteFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
 </filter-mapping>

<filter>
<filter-name>LoginFilter</filter-name>
<filter-class>org.primefaces.examples.view.LoginFilter</filter-class>
</filter>
    <!-- Set the login filter to secure all the pages in the /secured/* path of 
the     application  -->
<filter-mapping>
<filter-name>LoginFilter</filter-name>
<url-pattern>/secured/*</url-pattern>
 </filter-mapping>

 <!-- By default go to secured welcome page -->
 <welcome-file-list>
<welcome-file>secured/welcome.xhtml</welcome-file>
</welcome-file-list>

关于java - FAIL - 上下文路径/CONTROL 中的应用程序无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19662590/

相关文章:

java - 如何显示 <h :selectOneMenu> in a <h:outputText>? 的选定值的标签

css - 当打开部署在服务器 tomcat 上的页面时,IE 无法响应屏幕,但在部署前使用 IE 在 eclipse 元素上运行时它工作正常

java - 转换旧的 html 表单 servlet 以在 Tomcat 7 上运行

java - 带 JSON 的 Spring Security 不起作用

java - 如何在用户单击时更改 InlineKeyboardButton 标签?

JSF如何在Netbeans7.1中升级到Mojarra 2.1.21(只是子jsf-api.jar和jsf-impl.jar失败)

jsp - 无法在eclipse中显示tomcat 6的主页

java - 将 NSData 转换为 Java 字符串

java - 从 WEB-INF 中包含 javascript 文件

java - Servlet - 强制覆盖下载的文件