系統(tǒng)環(huán)境:WebSphere 6.1.0.25 Network Deployment, 有集群,前端用IBM Http Server Plugin
事情是這樣的,由于本集群上有多個(gè)應(yīng)用,所以在更新應(yīng)用時(shí)不可以重啟App Server。同時(shí),在集群環(huán)境中,如果直接更新應(yīng)用,會(huì)自動(dòng)觸發(fā)WAS集群中的App Server重啟。所以我們更新應(yīng)用的習(xí)慣是,先停止應(yīng)用,再卸載,然后再部署新的版本。
在這樣的應(yīng)用更新實(shí)施之后,出現(xiàn)過(guò)兩次這樣的情況:部署后的新應(yīng)用,功能都正常,就是樣式全丟了。使用Firefox的Firebug跟蹤一下,發(fā)現(xiàn)是在請(qǐng)求style.css時(shí),服務(wù)器給了503 Service Unavailable的響應(yīng)。檢查服務(wù)器上應(yīng)用部署目錄,物理文件都在,訪問(wèn)權(quán)限也正常,但是就是無(wú)法正確請(qǐng)求到這個(gè)文件。
搜索了很多文檔,終于找到了這個(gè)問(wèn)題的原因,屬于WAS的Bug:
PK80333: CANNOT DISPLAY A CERTAIN GIF FILE
大意是說(shuō):當(dāng)應(yīng)用正在停止的時(shí)候,在某個(gè)很短的時(shí)間段內(nèi),如果服務(wù)器接收到一個(gè)靜態(tài)資源(css, js, html, 圖片等)的請(qǐng)求,此時(shí),這個(gè)靜態(tài)資源會(huì)被服務(wù)器標(biāo)識(shí)為永久性不可用。即使應(yīng)用再次啟動(dòng),訪問(wèn)這個(gè)靜態(tài)資源,服務(wù)器也會(huì)給出503 Service Unavailable的響應(yīng)。但是對(duì)于動(dòng)態(tài)資源,例如JSP和Servlet就不存在這個(gè)問(wèn)題。
這個(gè)問(wèn)題在6.0.1.27修復(fù)。
或者,重新啟動(dòng)App Server,也會(huì)恢復(fù)。
并且,在發(fā)生故障的場(chǎng)景中,應(yīng)用啟動(dòng)之后,如果換一個(gè)域名訪問(wèn)此靜態(tài)資源,就是正常的。
比如說(shuō):http://xx.com/styles/style.css 請(qǐng)求正好在應(yīng)用停止的那個(gè)片刻到達(dá)服務(wù)器,那么后續(xù)所有的對(duì)于http://xx.com/styles/style.css的請(qǐng)求都會(huì)收到503的響應(yīng)。但是如果換一個(gè)指向同一地址的http://xx1.com/styles/style.css請(qǐng)求,則是正常的。
以下是原文:
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.
posted on 2012-02-29 15:24
YODA 閱讀(3998)
評(píng)論(0) 編輯 收藏