2/24/2009

Tomcat6和NIO

Tomcat6开始支持NIO,在配置Tomcat6的Connector的protocol时又多了一个可选项org.apache.coyote.http11.Http11NioProtocol -非阻塞的java connector:
<connector protocol="org.apache.coyote.http11.Http11NioProtocol" connectionTimeout="20000"redirectPort="8443" />

Http11NioProtocol使用java5中的NIO实现,使用selector和channel来创建处理server socket. 根据三种connector的比较, 使用NIO的connector,可以处理更多的connection,不受accecptCount和maxThreads的限制。



JBossESB4.5.GA 发布

JBossESB Team在2月12号发布了最新的JBossESB 4.5.GA. 最新版本的JBossESB包括了众多的bug fix ,以及新的特性. 详细信息列在了JBossESB 4.5.GA发布说明中. 新特性中包含了我contribute的Tomcat Gateway代码.在这一个版本中你可以使用http provider来配置一个http的gatway来实现多个ESB Service共用同一个端口.详细的配置说明清参考这篇wiki .

12/30/2008

XPath and default name space

when you use xpath to select nodes from a xml document which contains default namepsace, you may need read this article. If the xpath expression is "//cd" , the xpath parser will treat it as the element which namespace is null and local name is "cd". Adding the prefix and default namespace to namespace context always can help you resolve this issue perfactly. I remembered I also wrote some code for jaxws cosomization parser for cxf wsdl2java tool. I just reviewed. It probably can not handle the xpath expression. I will take a look at it and fix it later...

12/25/2008

How to write RHQ plugin

If you do not experience the RHQ, you can look at rhq-project.org to get more information. If you want to monitor and management your own software or your enterprise application , you may need to write your own rhq plugin . How to wirte a RHQ plugin ? Heiko will tell you about how in his series rhq plugin tutorial.

12/11/2008

Install DB2 on Fedora8

If you are about to install DB2 on Fedora 8 or other linux platform , maybe this entry is worth reading.
When you use root user to install the DB2 database, you 'll find it does not take your much efforts to install it successfully. But if you intend to use the normal user to install DB2 in your home directory, there are somethings needed to be configured.
1. Enable DB2 Authentication using local operating system security and reserve the remote connection
When you installed DB2 in the home dir of normal user , you will find there is no security authentication . And the remote connection also does not work. To enable this , create a configuration file and execute db2rfe command.
Under /sqllib/instance directory , there is shell script named db2rfe. The comment for this command gives the clue it is to check system before installation. Do not know if it needs some update. At least I used it to set my db2 instance attribute.
Write the following configuration file for this db2ref script and save it as file db2ref.cfg:
** ============================================================================
INSTANCENAME=jimma
** This is required keyword.
** ----------------------------------------------------------------------------
** Enable DB2 High Availability (HA) feature
** ----------------------------------------------------------------------------
** Valid value is NO and YES. Change to YES if you need to enable this feature.
ENABLE_HA=YES
** ------------------------------------------------------------------------------
** ENABLE DB2 Authentication on the server using local operating system security.
** ------------------------------------------------------------------------------
** Valid value is NO and YES. Change to YES if you need to enable this feature.
ENABLE_OS_AUTHENTICATION=YES
** --------------------------------------------
** Reserve DB2 remote connection service entry
** --------------------------------------------
** Valid value is NO and YES. Change to YES if you need to do the reservation.
** If SVCENAME and/or SVCEPORT are defined and valid, the DB2 database manager
** configuration will be updated accordingly.
RESERVE_REMOTE_CONNECTION=YES

After db2rfe is executed, you will find you can use "db2 connect sample using sampleuser" to connect your database.
The remote service port also takes effect , you can use a JDBC client to connect the database you created.

2. Change the service port
Use the normal user install DB2, you may find the service port is not common used 50000. Use this command to change it :
db2 update dbm cfg using SVCENAME 50000, restart db2 instance .

After follow this two steps, the db2 works fine to be connected with a remote java client .