说说BES
Borland 的BES也許并沒有太多人用,我也是公司買了后才知道的
SERVER的內核都是apache,tomcat之類的開源服務器,因此比較便宜(而且我們只購買了web edition),
不過它做了個看起來比較花哨的管理界面。
不過后來用了以后還感覺作為低成本的應用服務器也可可以一用。
但是這段時間卻出現了一個蹊蹺的事,我們的應用需要記錄每個用戶登錄
的IP地址(自然而然用request.getRemoteAddr()),后發現BES記錄的IP讓
人不可預測,比如,你剛啟動了partition.用112去訪問,此時,后端記錄下
是112,后從10訪問,顯示的IP一會兒是112,一會兒是10,完全沒有規律,再從另
臺機器登錄,則IP好象是隨機的三個曾訪問過的IP,讓我非常懊惱。
開始我是想呀,怎么說也是花錢買的商用服務器吧,不可能出現這么低級的問題,
所以一直在找我自身應用程序的原因,里為里面用了好多過濾器,上下文管理
之類的東東,擔心是在某個地方代碼出了問題,找的結果是沒一點成效,后干脆
就開發一個小SERVLET部署上去測試,結果依據,這才讓我堅信這是BES有問題。
真FT!
即然確定是它的問題,就看看網上應該有人遇到過,幸運的是,前兩條就是關
于這個問題的(google:? BES getRemoteAddr),其中一個還是Borland官方網
站呀,心想一定會有答案了,它網上的內容如下(http://support.borland.com/entry.jspa?externalID=3370&categoryID=120):
BES60 RP1 - httpservletrequest.getRemoteAddr() gives an old IP address???
Applicable for:
BES60 RP1 - httpservletrequest.getRemoteAddr() gives an "old" ip address
Product Name: BES
Product Version: 6.0RP1
Product Component: Web Container
Platform/OS Version: Win32
JDK/Compiler Version:? 1.3.1/1.4.1
Problem Description:
httpservletrequest.getRemoteAddr() gives an "old" ip address from someone who used connection earlier.
Resolution:
This is a known issue in the default connector with a BES 6.0RP1. However the workaround is:
Go to the server.xml as follows:
Borland Management Console --> Configuration --> Partition --> Web Container right click on web container, click properties,
click 'Service:HTTP', click 'Connector:CoyoteConnector:xxxx', click the XML tab on the right pane, comment the line
highlighted that is as follows by placing at the end of this element.
Then add the following line:
port="xxxx" minProcessors="5" maxProcessors="75" enableLookups="true" redirectPort="8443" acceptCount="100" debug="0"
connectionTimeout="20000" useURIValidationHack="false" disableUploadTimeout="true"/>
Note: change port number in new connector to match the port number that existed previously.
我看了半天,對比一下它說要替換的部分,根我現有配置一模一樣,這倒底怎么回事呢?
后找了半天,才找到SUN的一個論壇里有人討論這個問題,人家最終解決是更換了一個tomcat 的connector
可borland的網站上恰恰沒有應該用什么connector的語句,只是給出一一堆根本用不著替換的配置(我愿意相
信是這輸入人員的問題),但其職業精神也可想已知了,又FT!
將org.apache.coyote.tomcat4.CoyoteConnector換成org.apache.catalina.connector.http.HttpConnector
這是一個很簡單的問題,也是一個顯而易見的問題,因此,我覺得這種問題絕對不應出現在商用服務器上!!
總結
- 上一篇: 有关于微软的IWebBrowser2::
- 下一篇: Java中文问题详解