Thursday, April 13, 2006

I'm a Mandarin!?

You're an intellectual, and you've worked hard to get where you are now. You're a strong believer in education, and you think many of the world's problems could be solved if people were more informed and more rational. You have no tolerance for sloppy or lazy thinking. It frustrates you when people who are ignorant or dishonest rise to positions of power. You believe that people can make a difference in the world, and you're determined to try.

Talent: 51%
Lifer: 33%
Mandarin: 59%

Take the Talent, Lifer, or Mandarin quiz.

Thursday, April 6, 2006

The best text editor

Many programmers have experiences of using UltraEdit as the code editor, even if they have some complicated IDE available. However, UE is a shareware ... You may want to try something that you do not need to care about expiration, then PSPad is the best text editor for you. I would like to say that PSPad suplies all the features I need. You can find an interesting artical on various editors here.

Sunday, March 19, 2006

Load-balance Jetty using mod_proxy

Here are two reference articles for this topic: one from Jetty and the other by PierFumagalli. Although they were developed before the release of Apache Httpd 2.2, most of the configuration can still be applied to the current version.

Thursday, March 2, 2006

Using mod_proxy and mod_proxy_balancer to cluster and load-balance Tomcat application servers

I just updated the Apache HTTP server on my Window box from 2.0.54 to the current 2.2.0. Release 2.2.0 includes many new features, among which mod_proxy and its extension for load balancing, mod_proxy_balancer are most interesting to me as replacements for load balancing using mod_jk. Graham King has a good article about how to setup mod_jk/mod_jk2 for clustering Tomcat using Apache. Now he also changed to the new mod_proxy and mod_proxy_balancer, and say goodbye to mod_jk. To setup mod_proxy_balancer in 2.2.0 is quite straightforward and you can refer to mod_proxy_balancer document and Graham’s post.

To test the load balancing of Tomcat, I have to start several Tomcat instances on my Windows system. I found some hints about running Tomcat instances on the same system from the Web, but they did not help me so
much. The method I figured out is as follows:

  1. Download the zip version of core release of Tomcat, and unzip it to a directory where will be the Home of one Tomcat instance, say c:\tomcat0. Read the RUNNING.txt in the directory. The “Advanced Configuration - Multiple Tomcat Instances” part will help you a lot during the further configurations.

  2. Download the Tomcat Native library and put it in the \bin if you want to improve Tomcat’s performance.

  3. In server.xml, change the ports for connections to avoid conflict with other applications including other tomcat instances. Add jvmRoute=”tomcat0” into the line of < Engine name="Catalina"
    defaultHost="localhost" > to specify the route required in < proxy/ > entry of httpd.conf.

  4. At the beginning of startup.bat and shutdown.bat, set both CATALINA_HOME and CATALINA_BASE to be c:\tomcat0.

  5. Copy the folder c:\tomcat0 to c:\tomcat1 to create another Home for an instance, and change its server.xml, startup.bat and shutdown.bat correspondingly.


Now you can run startup.bat in c:\tomcat0 to get the Tomcat instance of tomcat0, and the same for instance of tomcat1, and so on.

I have tried both ajp and http connections to forward the request from Apache proxy to Tomcat instances, and using JMeter to test the performance of both options. Unfortunately, ajp always triggers exceptions related to socket connections. My Tomcat log is quite similar to those catched when using mod_jk . I am not sure if that mean we cannot avoid the bugs in org.apache.jk package even if switching from mod_jk to mod_proxy_ajp. Therefore I suggest to use http to connect Tomcat with Apache other than ajp at this moment.

Wednesday, January 11, 2006

A nice FREE webcam software for Windows

I just installed a webcam software named Fwink. It is light and works perfectly.

Friday, November 25, 2005

Solution for listServices.jsp of Axis 2 returning errors

The errors indicate that "root cause java.lang.NoClassDefFoundError: org.apache.ws.security.handler.WSHandler". The problem is caused by XPath lib. Download and install the xalan-j lib of 2.6.0, and that will be fixed. You can find detailed information at jira.

Monday, November 21, 2005

Stateless process manageability

It is a common principle of SOA that services are stateless. The statelessness supports loose coupling, reusability, and composability of services. In the principled Web architecture, stateless communication improves the system's visibility, reliability, and scalability. When the applications of cookies and other approaches in the Web make the communication stateful, the visibility and reliability of Web applications are degraded. Similar to the case of Web architecture, services can be developed to manage state information, but that would detract from some benefits of SOA. However, it does not introduce any conflicts in managing stateful processes and process instances using stateless web services. That directly implies that the process state information is carried by the messages or events going in/out the manageability services, and some applications maintaining the state information are hidden behind the manageability services.



Manageability services communicate with the applications maintaining state information through specific application protocol. On the other side, the communication between manageability consumers and manageability services just need to follow the open service protocol. Databases can store large amounts of state information of processes and process instances during and after their lifetime. Another kind of application, like message topics, maintains a certain group of messages with state information. The management of BPEL processes is essentially monitoring, tracing, and controlling the states through the corresponding manageability service endpoints.