com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChainContents中的java.lang.NullPointerException

时间:2016-01-28 10:04:47

标签: spring hibernate websphere richfaces jsf-1.2

我在我的was8.5服务器上运行了一个war应用程序(spring + jsf1.2 / richfaces + hibernate),当我尝试访问http://localhost:9080/name_app/login.xhtml时,我得到来自服务器内部的[28/01/16 09:45:06:325 WET] FFDC Exception:java.lang.NullPointerException SourceId:com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters -RE ProbeId:1123 Reporter:com.ibm.ws.webcontainer.filter.WebAppFilterManagerImpl@9afb2765 java.lang.NullPointerException at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChainContents(WebAppFilterManager.java:775) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:379) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:931) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3926) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1007) at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881) source,下面是错误的日志跟踪:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="Auth_Super_Admin_WEBAPP" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> 

    <description>Antij Project web.xml</description>
    <display-name>Antij -AuthForte-User-Admin-web</display-name>
    <context-param>
        <param-name>org.richfaces.SKIN</param-name>
        <param-value>classic</param-value>
    </context-param>
    <!-- added , but doesn't affect-->
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.enableViewStateIdRendering</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>WEB-INF/web-context.xml</param-value>
    </context-param>
    <context-param>
        <param-name>facelets.REFRESH_PERIOD</param-name>
        <param-value>1</param-value>
    </context-param>
    <context-param>
        <param-name>facelets.SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>
<!--    <context-param> -->
<!--        <param-name>javax.faces.STATE_SAVING_METHOD</param-name> -->
<!--        <param-value>server</param-value> -->
<!--    </context-param> -->
    <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>


 <context-param>
  <param-name>facelets.LIBRARIES</param-name>
  <param-value>/WEB-INF/components/antij.taglib.xml</param-value>
 </context-param>
<!--   -->


    <filter>
        <filter-name>extensionsFilter</filter-name>
        <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
        <init-param>
            <description>Set the size limit for uploaded files.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
            <param-name>uploadMaxFileSize</param-name>
            <param-value>100m</param-value>
        </init-param>
        <init-param>
            <description>Set the threshold size - files below this limit are stored
in memory, files above this limit are stored on disk.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
            <param-name>uploadThresholdSize</param-name>
            <param-value>100k</param-value>
        </init-param>
    </filter>
    <filter>
        <display-name>RichFaces Filter</display-name>
        <filter-name>richfaces</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>richfaces</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <filter-mapping>
        <filter-name>extensionsFilter</filter-name>
        <servlet-name>*.xhtml</servlet-name>
    </filter-mapping>
    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping> 
    <!-- listener to load spring beans -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    <!-- Faces Servlet -->
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <!-- Faces Servlet Mapping -->
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>/modules/index.xhtml</welcome-file>
    </welcome-file-list>
    <!--
    <resource-ref>
        <description>My Data Source.</description>
        <res-ref-name>acs_3ds</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>-->

    <!-- resource ref for websphere -->

     <resource-ref>
       <res-ref-name>jdbc/acs_3ds_websphere_db</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <res-auth>Container</res-auth>
       <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>

    <persistence-unit-ref>
       <persistence-unit-ref-name>persistence/authentification-forte-user-admin-entityManager-pu</persistence-unit-ref-name>
       <persistence-unit-name>authentification-forte-user-admin-entityManager-pu</persistence-unit-name>
    </persistence-unit-ref>
</web-app>

web.xml:

pytz

根据日志跟踪,它不是源自自己的代码,我认为这是关于web.xml中的一些配置错误,我不确定。

这是如何引起的?如何解决?

1 个答案:

答案 0 :(得分:0)

我遇到了同样的错误,并找到了解决方案。

找出一次导致此错误的过滤器,方法是一次从web.xml中删除过滤器,直到您未收到此错误。

然后在两个<filter><filter-name> and <filter-mapping><filter-name>中重命名该过滤器。请注意,filter-name可以是任何字符串,但是值必须匹配。它不需要与您的过滤器类名称相同,仅<filter-class>与您的类名称相同。

现在尝试运行它,它应该可以工作。现在,您应该能够将过滤器重命名为其原始名称。