0

我知道这可能是个坏问题,但也许有人以前有过这个问题。

我用下面列出的框架创建了 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>
4

0 回答 0