Running EcPerf to measure performance of WebSphere Community Edition

So today we have decided to measure performance of the IBM WebSphere application Server Community Edition.

EcPerf has been selected as a standard J2EE performance measuring kit.

This application server from IBM is based on Apache Geronimo. So all the additional steps required to configure EcPerf to run on Apache Geronimo are quite the same. Detailed information on the difference between WAS CE and Apache Geronimo can be found here.

The first step is to populate database with the schema and initial data. PostgreSQL was used as a database. Execution of schema/sql/schema_C.sql script failed in one place. You’ll need to make the following replacement:


CREATE TABLE C_rule
(
    r_id        varchar(20) not null,
    r_text      long varchar text
);

Once the database schema is created we can start building ecperf.ear and emulator.ear. So it’s necessary to create a separate src/geronimo folder based on src/reference folder.

In my case I was using JDK 1.6, so I had to specify source=”1.4″ target=”1.4″ in the ant target named compile. To make this working – the more recent version of ant is required, for example 1.7.1 worked fine.

Okay, compilation is successful and trying to load database data into PostgreSQL I get:

org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block

So go to src/com/sun/ecperf/load/LoadCorp.java and do the following change:

public static void main(String [] argv) throws Exception {
        ...
        dbConnection.setAutoCommit(falsetrue);
        ...
}

Now all the data is uploaded successfully. Lets try to build application and deploy it. Build is fine and deploy gives the following error:

Unable to deploy: Unable to resolve resource reference ‘UtilDataSource’ (Could not auto-map to resource.  Try adding a resource-ref mapping to your Geronimo deployment plan.

Lets try to add all required datasources(UtilDataSource, CorpDataSource, OrdersDataSource, MfgDataSource, SupplierDataSource) via admin console. But still no success. It appeared that it’s required to have a special file in the application named geronimo-application.xml. It’s content is available below:


<app:application application-name="AppParent" xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0" xmlns:conn="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2" xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:pers="http://java.sun.com/xml/ns/persistence" xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1" xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0" xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
    <dep:environment>
        <dep:moduleid>
            <dep:groupid>default</dep:groupid>
            <dep:artifactid>AppParent</dep:artifactid>
            <dep:version>1.0</dep:version>
            <dep:type>ear</dep:type>
        </dep:moduleid>
        <dep:dependencies>
            <dep:dependency>
                <dep:groupid>console.dbpool</dep:groupid>
                <dep:artifactid>UtilDataSource</dep:artifactid>
            </dep:dependency>
            <dep:dependency>
                <dep:groupid>console.dbpool</dep:groupid>
                <dep:artifactid>CorpDataSource</dep:artifactid>
            </dep:dependency>
            <dep:dependency>
                <dep:groupid>console.dbpool</dep:groupid>
                <dep:artifactid>OrdersDataSource</dep:artifactid>
            </dep:dependency>
            <dep:dependency>
                <dep:groupid>console.dbpool</dep:groupid>
                <dep:artifactid>MfgDataSource</dep:artifactid>
            </dep:dependency>
            <dep:dependency>
                <dep:groupid>console.dbpool</dep:groupid>
                <dep:artifactid>SupplierDataSource</dep:artifactid>
            </dep:dependency>
        </dep:dependencies>
    </dep:environment></app:application>

And to have it bundled – you’ll need to change build.xml:

<property name="dd.application-specific" value="sun-j2ee-rigeronimo-application.xml"> 
</property>

Also it’s require to bundle xerces.jar into ecperf-ear and emulator-ear tasks to prevent ClassNotFoundException.

Okay deploying and seeing errors again

Unable to deploy: org.apache.openejb.OpenEJBException: Cannot unmarshall the ejb-jar.xml file: jar:file:/home/andy/Tools/wasce/var/temp/geronimo-deploymentUtil5319633835494891732.jar!/META-INF/ejb-jar.xml: unexpected element (uri:”http://java.sun.com/xml/ns/javaee”, local:”small-icon”).

It appears that supplier.xml.BMP and supplier.xml.CMP have invalid declaration. So you’ll need to remove all “small-icon” and “large-icon” tags from it.

Deploying and everything works! But it’s only half of the way.  Now it’s necessary to configure agent.

So creating jndi.properties file in classpath and putting the following data there:

java.naming.factory.initial=org.apache.openejb.client.RemoteInitialContextFactory
java.naming.provider.url=ejbd://192.168.56.1:4201

Starting the driver application and getting:

On client: java.lang.RuntimeException: Invalid response from server: -1
On server: ERROR remote “null  OEJ/0.0” FAIL “Unexpected error – For input string: “/””
java.lang.NumberFormatException: For input string: “/” 

It appears that client was using 3.1 version openejb-client while the server was expecting version 3.0.2 to be used. Okay, fixed.

What’s next…

NameNotFoundException: /WorkOrderSes does not exist in the system

Okay, iterating through the JNDI objects and we see WorkOrderSesRemoteHome. This time it’s required to change source code of EcPerf to add RemoteHome suffix.

Starting and WOW! It works!