BPEL Engines …

If you want to work with a BPEL engine, you always have some trouble. Always!

For my diploma thesis, I used the OpenESB engine 2.2 which was originally developed by Sun. I had made good experience working with this engine during other courses at university. The installation is very simple as there is a single installer which installs and configures NetBeans, Glassfish and the OpenESB engine in one step. Everything can be controlled from within NetBeans (starting and stopping of Glassfish, (un)deployment of BPEL processes, debugging!). Additionally, NetBeans provides extensive validations to ensure that the BPEL process is correct.

After Sun’s acquisition by Oracle, the engine has not been maintained anymore. Many pages of its documentation are broken and it is very very hard to find a download link in this mess. A few people are trying to keep it alive under http://openesb-dev.org/. They released a new version (2.3) at https://openesb-dev.org/file/showfiles.php?group_id=102. This version is from February 2011 and has only been declared a milestone instead of a stable release. I do not have much hope that this project will be relevant for praxis in the future.

For a paper of mine, I wanted to use the OpenESB engine 2.2. I had required a specific construct which is valid according to the BPEL standard. The engine, however, only threw NullPointerExceptions when it executed the problematic part of the process. Therefore, I had to look for alternatives.

Next, I evaluated the Apache ODE 1.3.5, however, I could not get it working. I had so many NullPointerExceptions in the log files … it was simply ridiculous.

Consequently, I said to myself, lets just use industry proven product which have to be great. This is how I began looking at the BPEL engine from Oracle which is shipped with their Oracle SOA Suite 11g product. Its installation is quite cumbersome and takes half a day to complete. When it is installed, the start of the server takes more than 5 minutes. It is hard to handle as everything feels very slow, but, I got it working! Thus, I used it for my paper and it worked out well.

As this product is very heavy-weight, I was still looking for a more light-weight alternative running only in a simple servlet container for other research projects.

This week, my collegue Jörg Lenhard pointed me to the bpel-g engine. This engine is based on the open sourced code of the ActiveBPEL engine and looks really promising according to their own comparison with other open source BPEL engines. It starts within ca. 20 seconds on a simple servlet container like tomcat. Here is a small guide on how to get this engine running as the project site does not contain one:

  1. Download Tomcat 7.0.26, unpack it and start it using startup.bat/startup.sh
  2. Download bpel-g-web-5.2.war and copy it into $TOMCAT_HOME/webapps
  3. Download h2-1.2.122.jar and copy it into $TOMCAT_HOME/webapps/bpel-g-web-5.2/WEB-INF/lib
  4. Restart tomcat and point your browser to localhost:8080/bpel-g-web-5.2

Note: You have to use the version 1.2.122 of the in-memory database h2 as newer versions do not work!

Maybe this engine suffices for my work? I will investigate!

PS: It is a pity that bpel-g is hosted using SVN instead of git …

Initializing Arrays in Java

Arrays are widely used in many (almost any) programming languages. In Java, you have to specific the length of an Array at the creation of an Array.

Here is a short example how to initalize an Array containting the numbers 1, 2 and 3:

int[] numbers = new int[3];
numbers[0] = 1;
numbers[1] = 2;
numbers[2] = 3;

In order to abbreviate this, there is a short form which can do this work in one line. This works as Java can determine the length of the array by looking at the number of elements within the curly brackets. At compile time, the short form is translated to the form above within the byte code.

int[] numbers2 = {1,2,3};

Now, there are some quirks to be aware of regarding the short form. You can use this only while defining the array variable. The following will result in a compile error:

int[] numbers2 = {1,2,3};
numbers2 = {4,5,6}; // compile error!

Why does this happen? The error message says: “Array constants can only be used in initializers”. But I am not quite sure, what the meaning behind is. I consider it a quirk of the Java language without any further research regarding this construct. 😉

However, today, I found a trick to circumvent this issue. You can find the solution in the Oracle Java Magazine, Section Fix This.

int[] numbers3 = {1,2,3};
numbers3 = new int[]{4,5,6};

I am not quite sure, why this works. Do you?