WebSphere 更新应用后请求静态资源出现 503 错误

系统环境:WebSphere 6.1.0.25 Network Deployment, 有集群,前端用IBM Http Server Plugin
 
事情是这样的,因为本集群上有多个应用,因此在更新应用时不能够重启App Server。同时,在集群环境中,若是直接更新应用,会自动触发WAS集群中的App Server重启。因此咱们更新应用的习惯是,先中止应用,再卸载,而后再部署新的版本。
 
在这样的应用更新实施以后,出现过两次这样的状况:部署后的新应用,功能都正常,就是样式全丢了。使用Firefox的Firebug跟踪一下,发现是在请求style.css时,服务器给了503 Service Unavailable的响应。检查服务器上应用部署目录,物理文件都在,访问权限也正常,可是就是没法正确请求到这个文件。
 
搜索了不少文档,终于找到了这个问题的缘由,属于WAS的Bug:
 
PK80333: CANNOT DISPLAY A CERTAIN GIF FILE
 
大意是说:当应用正在中止的时候,在某个很短的时间段内,若是服务器接收到一个静态资源(css, js, html, 图片等)的请求,此时,这个静态资源会被服务器标识为永久性不可用。即便应用再次启动,访问这个静态资源,服务器也会给出503 Service Unavailable的响应。可是对于动态资源,例如JSP和Servlet就不存在这个问题。
 
这个问题在6.0.1.27修复。
 
 
 
或者,从新启动App Server,也会恢复。
 
而且,在发生故障的场景中,应用启动以后,若是换一个域名访问此静态资源,就是正常的。
 
好比说:http://xx.com/styles/style.css 请求正好在应用中止的那个片刻到达服务器,那么后续全部的对于http://xx.com/styles/style.css的请求都会收到503的响应。可是若是换一个指向同一地址的http://xx1.com/styles/style.css请求,则是正常的。
 
如下是原文:
 
 
 
Problem summary
****************************************************************
* USERS AFFECTED:  IBM WebSphere Application Server Version 6.1*
*                  and Version 7.0 users.                      *
****************************************************************
* PROBLEM DESCRIPTION: All requests for a static file result   *
*                      in a                                    *
*                      Servlet.has.become.temporarily.unavaila *
*                      ble.for.service exception.              *
****************************************************************
* RECOMMENDATION:                                              *
****************************************************************
When an application is being stopped a small timing window
exists during which, if a request for a static file is
received, the static file will become permanently unavailable
even after the application has been restarted. Once the static
file has become permanently unavailable all requests for the
file will result in a
Servlet.has.become.temporarily.unavailable.for.service
exception. The problem will persist until the server on which
the application is running is restarted.
 
Note the problem  occurs for static files only and not, for
example, for servlets and JavaServer Pages (JSPs).
Problem conclusion
The WebContainer has been modified to remove the timing window
so that a request for a static file during application stop
cannot cause the static file to become permanently unavailable.
 
The fix for this APAR is currently targeted for inclusion in
fix packs 6.1.0.27 and 7.0.0.5.