当我在同一个tomcat中访问2个页面时,Tomcat停止工作

时间:2013-09-19 11:16:47

标签: spring-mvc spring-security tomcat7

我知道这可能是一个糟糕的问题,但也许有人之前有这个问题。

我使用下面列出的框架创建了2个页面,并将它们放在具有不同名称的同一个tomcat7中。当我访问它们时,Tomcat停止响应,我收到此错误:

Exception in thread "http-bio-80-exec-9" Exception in thread "http-bio-80-exec-1" Exception in thread "http-bio-80-exec-10" Exception in thread "http-bio-80-exec-13" Exception in thread "Timer-1" Exception in thread "Timer-0" 

当我只使用其中一个时,一切都按预期工作。 我第一次尝试部署它们时,出现了使用相同日志或其他内容的错误。所以我用

更新了web.xml文件
 <context-param>
    <param-name>log4jExposeWebAppRoot</param-name>
    <param-value>false</param-value>
 </context-param>

和网站“工作”。我刚收到这个错误。

Web.xml在两个项目中看起来都相似:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>Spring Security Tutorial</display-name>


    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>/WEB-INF/classes/log4j.properties</param-value>
    </context-param>
    <context-param>
        <param-name>log4jExposeWebAppRoot</param-name>
        <param-value>false</param-value>
    </context-param> 

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
        /WEB-INF/spring-security.xml

        /WEB-INF/applicationContext.xml
        /WEB-INF/spring-quartz.xml
        </param-value>
    </context-param>

    <context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>dark-hive-custom</param-value>
    </context-param>



    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

          <listener>
        <listener-class>
            org.springframework.web.context.request.RequestContextListener
        </listener-class>
      </listener>
    <filter>
            <filter-name>springSecurityFilterChain</filter-name>
            <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>

    <filter-mapping>
            <filter-name>springSecurityFilterChain</filter-name>
            <url-pattern>/*</url-pattern>
    </filter-mapping>


    <context-param>
        <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>


<!-- PRIMEFACES -->
    <filter>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
        <init-param>
        <param-name>thresholdSize</param-name>
            <param-value>104857600</param-value>
        </init-param>
        <init-param>
            <param-name>uploadDirectory</param-name>
            <param-value>D:/tmp/</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>



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

 <security-constraint>
    <display-name>Restrict direct access to XHTML files</display-name>
    <web-resource-collection>
        <web-resource-name>XHTML files</web-resource-name>
        <url-pattern>*.xhtml</url-pattern>
    </web-resource-collection>
    <auth-constraint />
</security-constraint> 


  <!-- Map these files with JSF -->
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
  </servlet-mapping>

    <welcome-file-list>
        <welcome-file>/jsp/home.jsf</welcome-file>
    </welcome-file-list>
    <error-page>
        <exception-type>org.springframework.security.access.AccessDeniedException</exception-type>
        <location>/jsp/access/login.jsf</location>
    </error-page>

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




</web-app>

0 个答案:

没有答案