Websphere 6.1 出现奇怪的 404/j_security_check 错误
我有一个 websphere 6.1 配置并且应用程序正在运行,但一些请求转到 j_security_check,但最后一个请求(有与 J_security_check 关联的过滤器)将生成 404 错误。
例如:
(1) 用户发帖至: http://localhost:9081/Page/j_security_check 它适用于 Filter1, 但后来对 Filter2 的请求收到 404 错误。
(1a) 注意,以下过滤器与 j_security_check 关联:
<filter-mapping>
<filter-name>Filter1</filter-name>
<url-pattern>/j_security_check</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Filter2</filter-name>
<url-pattern>/j_security_check</url-pattern>
</filter-mapping>
(2) 代码到达过滤器代码:
chain.doFilter(req, res);
WASReqURL 具有以下 cookie 值,这是 j_security_check 需要的: http://localhost:9081/Test/test.html
理想情况下,客户端应该结束在 'http://localhost:9081/Test/test.html'
但是,我明白了对 j_security_check 的后续请求出现 404 错误: http://localhost:9081/Page/j_security_check
另外,这里是 web.xml 中的相关片段文件。
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/Go</form-login-page>
<form-error-page>/Go</form-error-page>
</form-login-config>
</login-config>
问题是,从 websphere 的角度来看,是什么控制着“J_security_check”。
细节: RAD7 Websphere Server 6.1,本地盒
I have a websphere 6.1 configuration and the application is running, but some requests go to j_security_check but the last one (there are filters associated with J_security_check) will generate a 404 error.
For example:
(1) User posts to:
http://localhost:9081/Page/j_security_check
And it works on Filter1,
but later requests to Filter2 get a 404 error.
(1a) Note, the following filters are associated with j_security_check:
<filter-mapping>
<filter-name>Filter1</filter-name>
<url-pattern>/j_security_check</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Filter2</filter-name>
<url-pattern>/j_security_check</url-pattern>
</filter-mapping>
(2)
The code reaches the filter code:
chain.doFilter(req, res);
WASReqURL has the following cookie value, this is needed by j_security_check:
http://localhost:9081/Test/test.html
Ideally, the client should end up on 'http://localhost:9081/Test/test.html'
But, I get a 404 error at a subsequent request to j_security_check:
http://localhost:9081/Page/j_security_check
Also, here is relevant snippet in the web.xml file.
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/Go</form-login-page>
<form-error-page>/Go</form-error-page>
</form-login-config>
</login-config>
The question is, what controls 'J_security_check' from the websphere perspective.
Details:
RAD7
Websphere Server 6.1, local box
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
转到应用程序服务器> 服务器1> 网络容器> 自定义属性并确保 com.ibm.ws.webcontainer.invokefilterscompatibility 变量设置为 true。 该变量充当应用程序的
j_security_check
开关。Go to Application servers > server1 > Web container > Custom Properties and make sure the
com.ibm.ws.webcontainer.invokefilterscompatibility
variable is set to true. This variable serves as thej_security_check
switch for the application.这是 WebSphere 6.1 和 Spring Security 的一个众所周知的问题。
您需要使用管理控制台将此变量添加到服务器属性中:
我还记得您需要安装一些 websphere 补丁,具体取决于确切的版本。
只需在互联网上查找我提到的变量,您就会找到解决方案...
希望它有帮助...
米格尔
This is a very well known issue with WebSphere 6.1 and Spring Security.
You need to add this variable to the server properties using the admin console:
also i remember you need to install some patch for websphere, depending on the exact version.
Just look in internet about the variable I mention and you will find the solution...
Hope it helps ...
Miguel