我在web xml(war文件中)中声明了一个servlet过滤器。如果使用startup.bat运行tomcat(7.0.75),但是如果tomcat作为Windows服务运行,则无法在日志中启动而没有任何错误。如果我删除这个过滤器一切正常,无论它是服务还是蝙蝠。
<filter>
<filter-name>CustomFilter</filter-name>
<filter-class>com.company.customFilter</filter-class>
<init-param>
<param-name>spnego.allow.basic</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>spnego.allow.localhost</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>spnego.allow.unsecure.basic</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>spnego.login.client.module</param-name>
<param-value>spnego-client</param-value>
</init-param>
<init-param>
<param-name>spnego.krb5.conf</param-name>
<param-value>krb5.conf</param-value>
</init-param>
<init-param>
<param-name>spnego.login.conf</param-name>
<param-value>login.conf</param-value>
</init-param>
<init-param>
<param-name>spnego.preauth.username</param-name>
<param-value>bfldap</param-value>
</init-param>
<init-param>
<param-name>spnego.preauth.password</param-name>
<param-value>!user</param-value>
</init-param>
<init-param>
<param-name>spnego.login.server.module</param-name>
<param-value>spnego-server</param-value>
</init-param>
<init-param>
<param-name>spnego.prompt.ntlm</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>spnego.logger.level</param-name>
<param-value>1</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CustomFilter</filter-name>
<url-pattern>/login/*</url-pattern>
</filter-mapping>