I have a web application running in WebSphere Application Server 9.0.x, and I integrate the Shiro security framework to the web application recently.
web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app 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"
metadata-complete="true">
<display-name>xxxx</display-name>
<listener>
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
</listener>
<filter>
<filter-name>ShiroFilter</filter-name>
<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ShiroFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
However, after I restart the server and access my index.jsp, those static resources which not exist in the server will generate an error message with a FileNotFoundException stack trace per each not existed resources in the SystemOut.log:
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper doFilter SRVE8109W: Uncaught exception thrown by filter ShiroFilter: java.io.FileNotFoundException: SRVE0190E: File not found: /js/test.js
...
...
...
I checked the IBM document and know that I can add a custom property (com.ibm.ws.webcontainer.suppressLoggingFileNotFoundExceptions) to suppress the FileNotFoundException and output a warning message in the SystemOut.log instead. (Reference: https://www.ibm.com/docs/en/was/9.0.5?topic=configuration-web-container-custom-properties#com.ibm.ws.webcontainer.suppressLoggingFileNotFoundExceptions)
But my question is that, why the FileNotFoundException will shown in the SystemOut.log after I add the filter config in web.xml. Before this, there is not this kind of issue (error message) in SystemOut.log although static resources not exist in the server.
Why FileNotFoundException generate in SystemOut.log after add filter config in web.xml