Thoughts and Tutorials about Continuous Integration, Application Integration, SOA, IT Architecture, WebSphere and Liferay

Dec 10, 2008

Set HTTP Response Header Cache-Control and enable mod_cache for higher performance

To enable the ability of caching of pictures open the httpd.conf of your IBM HTTP Server and add following lines

LoadModule headers_module modules/

<Location ~ "\.(jsgifjpgjpegpngjpe)$">

Header add Cache-Control "public, max-age=432000, post-check=172000"


These lines enable the module and are setting a Cache-Control header. A Cache-Control header enables clients, webservers and proxys to cache pictures.

Adding the Cache-Control-Header is very useful for older Liferay-Versions.

To enable a IBM HTTP Server to cache those pictures add additionally these lines:

LoadModule cache_module modules/

LoadModule mem_cache_module modules/

<IfModule mod_mem_cache.c>

CacheEnable mem /

MCacheSize 4096

MCacheMaxObjectCount 100

MCacheMinObjectSize 1M

CacheMaxObjectSize 2048


Link to sample httpd.conf

Nov 26, 2008

Enable g-zip for IBM HTTP Server

In order to deflate the content served form a IBM HTTP Server (IHS) it is possible to enable the g-zip-option in httpd.conf to compress the traffic between a client and a IHS.

To enable g-zip add this lines at the bottom of httpd.conf:

# compress everything but images
LoadModule deflate_module modules/
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
# log some info
#LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
#CustomLog logs/deflate_log deflate
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gifjpe?gpngexe)$ no-gzip dont-vary

Link to sample httpd.conf

To enable mime-types exiplict look at this sample file

Link to sample httpd.conf (Version 2)


Nov 19, 2008

Form Login for WebSphere Application Server 6.1

To enable a form based login (instead of a Basic Authentification) edit the web.xml of the application and add a login configuration:

<login-config id="LoginConfig_1"><auth-method>FORM</auth-method><realm-name>Example Form-Based Authentication Area</realm-name><form-login-config id="FormLoginConfig_1"><form-login-page>/login.jsp</form-login-page><form-error-page>/error.jsp</form-error-page></form-login-config></login-config>
The login.jsp contains the login form (ibm example):
<!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.0 Transitional//EN"><html><META HTTP-EQUIV = "Pragma" CONTENT="no-cache"><title> Security FVT Login Page </title><body><h2>Form Login</h2><FORM METHOD=POST ACTION="j_security_check"><p><font size="2"> <strong> Enter user ID and password: </strong></font><BR><strong> User ID</strong> <input type="text" size="20" name="j_username"><strong> Password </strong> <input type="password" size="20" name="j_password"><BR><BR><font size="2"> <strong> And then click this button: </strong></font><input type="submit" name="login" value="Login"></p>
the error.jsp contains an error message (ibm example):

<!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.0 Transitional//EN"><html><head><title>A Form login authentication failure occurred</head></title><body><h1><b>A Form login authentication failure occurred</h1></b><p>Authentication may fail for one of many reasons. Some possibilities include:<ol><li>The user-id or password may be entered incorrectly; either misspelled or thewrong case was used.<li>The user-id or password does not exist, has expired, or has been disabled.</ol></p></body></html>
So whats going on (example):
1. User is trying to access
2. User get redirected to
2.1 WAS creates a cookie called WASReqURL which contains the whished path (Value: http[s]://[:Port]/app/index.jsp)
3. User types in user-id and passwort and submits the login credentials
3.1 WAS reads the WASReqURL-Cookie and redirects the the requested path (
3.2 If the credentials are wrong WAS redirects the user to
It is possible to edit the WASReqURL-Cookie to change the redirect path after a successful login.
1. Read cookie Value:
  1. String url ="";
  2. String text = "";
  3. String newurl = "";
  4. //Get all cookies
  5. Cookie[] cookies = request.getCookies();
    for (int index=0; index <= cookies.length; index++) {
  6. String cookieName = cookies[index].getName();
  7. if ("WASReqURL".equals(cookieName)) {
  8. //If WASReqURL-Cookie is found, get the value and cancel for-loop urlwithoutlogging = cookies[index].getValue();
  9. break;
  10. }
  11. }
2. Set a new WASReqURL-Cookie
  1. Cookie wasrequrlcookie = new Cookie("WASReqURL",newurl));
  2. response.addCookie(wasrequrlcookie);


Nov 11, 2008

Enable SSL (HTTPs) for IBM HTTP Server

To enable SSL on a IBM HTTP Server (Client -> IHS), you need to generate a proper certificate first.

Steps to generate self-signed-certificate for https traffic:

1. Open /<ihs-root>/bin/ikeyman

2. Select CMS as type and specify a file name and a location for the certificate file

3. When prompted for a password type in your desired password.

4. Click Create > New Self-Signed Certificate in iKeyman. Type in your desired values.

5. Exit iKeymen.

6. Verify that all needed files (3-4 files) are generated in your certificate location.

After generating a self-signed-certificate the IHS needs to be configured to use SSL.

1. Open /<ihs-root>/conf/httpd.conf

2. Add following line to load the SSL module. Add these line add the end of the Load Modules section.

LoadModule ibm_ssl_module modules/

3. Add a virtual host to enable SSL.

Link to example file

4. Save and restart the HTTPs Server (/<ihs-root>/bin/apachectl)

Troubleshooting 1:

If SSL isnt working check the Virtual Host defined in your WebSphere Server.

1. In Administrative Console go to Virtual > default host > Host Aliases and check if port 433 is defined.

To setup SSL between IHS and a WebSphere-Server see:

Troubleshooting 2:

Perhaps you need to update the default plugin key files.

1. In Administrative Console go to WebServer > <webserver-name> > Plugin properties

2. Click "Copy to Web server key store directory" to override the old default certificates.

3. Restart the IHS and try again

Oct 27, 2008

Bug in Fixpack for WebSphere Application Server

After installing the fixpack a NullPointerException occurs in some applications.
This is a know bug (PK72336).
This Bug causes:

[9/17/08 16:44:05:508 CDT] 0000003a SystemErr R Exception in thread "WebContainer : 3" java.lang.RuntimeException: java.lang.NullPointerException
[9/17/08 16:44:05:508 CDT] 0000003a SystemErr R at oop(
[9/17/08 16:44:05:508 CDT] 0000003a SystemErr R at$ .java:873)
[9/17/08 16:44:05:508 CDT] 0000003a SystemErr R at$ ava:1473)
[9/17/08 16:44:05:508 CDT] 0000003a SystemErr R Caused by: java.lang.NullPointerException
at .java:111)
at oop(
at$ .java:873)
at$ ava:1473)

[9/17/08 16:44:05:508 CDT] 0000003a SystemErr R at .java:111)
[9/17/08 16:44:05:508 CDT] 0000003a SystemErr R at
[9/17/08 16:44:05:524 CDT] 0000003a SystemErr R at oop(
[9/17/08 16:44:05:524 CDT] 0000003a SystemErr R ... 2 more

[24.10.08 12:00:47:493 CEST] 000000b5 SystemErr R Exception in thread "WebContainer : 13" java.lang.NullPointerException
[24.10.08 12:00:47:493 CEST] 000000b5 SystemErr R at
[24.10.08 12:00:47:493 CEST] 000000b5 SystemErr R at
[24.10.08 12:00:47:493 CEST] 000000b5 SystemErr R at
[24.10.08 12:00:47:493 CEST] 000000b5 SystemErr R at
[24.10.08 12:00:47:493 CEST] 000000b5 SystemErr R at$
[24.10.08 12:00:47:493 CEST] 000000b5 SystemErr R at$

To fix this exceptions see the link above or navigate to Application Servers > <your_app_server> > Web container > Custom properties > New

Value: sync

Restart your app server

Oct 13, 2008

PHP portlet in Liferay 5 running on WebSphere Application Server 6.1

Liferay supports portlets with php content. The deployment of these portlets in Tomcat is quite easy.
The deployment of a PHP portlet in Liferay 5 on a WebSphere Server is a bit more difficult.

1. Download the sample_php_portletWAS.war. Its a enhanced version of Liferays original php portlet. The WAR contains all needed files.

2. Move the portal-kernal.jar from <Liferay_root>/WebINF/lib to <WebSphere-System-Root>/lib/ext (or to any other class loading position which is higher then the Liferay 's class loader order).

3. Deploy the php portlet
3.1 In administrative console go to Applications > Enterprise Applications.
3.2 Select the Liferay 5.x App and click "Update"
3.3 Select "Replace or add a single module"
3.4. Select the sample_php_portletWAS.war and specify the context root and the module path.
Also you need to select "Show me all installation options and parameters".
3.5 Click "Next" to start the deployment process
3.6. On step 2 you need to map the server to the sample_php_portlet. Choose the server where Liferay 5.x is deployed.
3.7. On step 7 its nesessary to define the context path again
3.8. Start the deployment (Click "FINISH" and "SAVE")
4. Restart the server
5. Sign in to Liferay and add the "sample_php_portlet"

More information about the deployment of Liferay portlets in WebSphere can be found here

WebSphere Application Server 7

Oct 7, 2008

Liferay 5.1.2 with WebSphere 6.1 [Temp fix]

Liferay 5.1.2 contains a new spring version. While start up of app server an error occurs.
org.springframework.web.context.ContextLoader initWebApplicationContext Context initialization failed
java.lang.TypeNotPresentException: Type javax.annotation.Resource not present
java.lang.ClassNotFoundException: javax.annotation.Resource
To fix this error you need to download the geronimo-annotation_1.0_spec-1.1.1.jar of the Apache Geronimo project and copy it to /Web-INF/lib.
See this post for a complete tutorial of deploying Liferay in WebSphere.

In Liferay 5.1.2 contains still some crazy bugs like wrong virtual hosts and lazy db connections i do not recommend it for production (with websphere)
Change log

Update: To Fix the wrong virtual host settings go to Enterprise Admin > Settings and replace "localhost" with your virtual host (appserver).

Oct 2, 2008

How to compare 2 LDAP-Directories

The comparison of the LDAP-Directories is a bit harder as it sounds.
The biggest problem is the lack of tools to do this research.
Finally i found i tool a called ldapcmp. It seems its quite old but it works under Windows XP.

How to:
1. Download the SUN LDAP C SDK (you need to register) - Platform: Windows 95 4.0 for XP
2. Extract the zip file
3. Copy the ldapcmp.exe from \tools to \lib
4. Execute the ldapcmp.exe with your parameters

The SUN LDAP C SDK also contains the useful tool ldapsearch

The available parameters can be found here

Sep 23, 2008

Replace a SSL Certificate

After i explained how to disable the auto generation of certificates in this post, i now want to explain how to replace an certificate manually.
1. In the administrative console go to Security > SSL certificates and key management > Manage endpoint security configurations
2. Select the node where you want to repleace the ssl certificate (under Inbound)
3. Click "Manage certificates"
4. Select the default certificate and click "Create a self-signed certificate"
5. Fill out the General properties values (compare with expired certificate)
6. Click "OK" and Save the changes
6. Go to Security > SSL certificates and key management > Manage endpoint security configurations > Select the node where you want to replease the ssl certificate (under Inbound) > Manage certificates
7. Select default and click "Replace"
8. You can now choose which certificate will replace the old certificate, normally its the newly created one. Do not select "Delete old certificate after replacement" and "Delete old signers".
9. Click "OK"
10. Select the old certificate and delete it (click "Delete")
11. Click "OK" and save the changes

Sep 15, 2008

Liferay and WebSphere SSO (simplistic)

Since Liferay is providing CAS (Central Authentication Service) support its possible to access Liferay through WebSphere SSO (LTPA tokens) login credentials.
So what to do?
I can not post all of our source code because of "some security" issues :-)
1. Edit (or portal-impl.jar//
1.1 Add/Edit the CAS configuration lines
## CAS

The bold lines say Liferay where to login or logout

2. Create Java-Classes for decrypting the WebSphere LTPA-Token
Have a look at these examples

and copy them to WEB-INF/classes/<class path> (or pack them into a jar-file)

3. Add AutoLogin-Classes (Step 2) to
auto.login.hooks=<class to decrypt ltpa token>,,...

4. Add was_logout.jsp to specify the cas-logout-path (see step 1)
Content (example):
<div style="text-align: center; color: rgb(153, 153, 153);"><%@ page import="java.util.*" %>
<%@ page import="com.liferay.portal.util.*;" %>
<form method="post" action="ibm_security_logout" name="logout">
<input name="logout" value="Logout" type="submit">
<input name="logoutExitPage" value="/" type="hidden">
<%-- auto-submitted by javascript --%>
<script type="text/javascript"><!-- logout.submit(); // --></script>


5. Create new Sign in portlet or edit the delivered sign in portlet
Content of view.jsp (example):
<% if (!themeDisplay.isSignedIn()) { %>

<%-- /* <form action="<portlet:renderURL windowState=">"><portlet:param name="struts_action" value="/mnet_sso_login/sso_forward"></portlet:param>" method="post" name="<portlet:namespace>fm"> */ --%>

<table class="login-table">

<td style="padding-bottom: 10px;">
<liferay-ui:message key="login">
<input name="j_username" class="form_input" type="text">
<td style="padding-bottom: 10px;">
<liferay-ui:message key="password">
<input name="j_password" class="form_input" type="password">

<input class="form_button" name="" type="submit">submit" value="<liferay-ui:message key="sign-in">">


<% } %>

6. Add Login-config to web.xml

Thats it

User logs in > LTPA-Token cookie is created by WebSphere >
Custom AutoLogin-Class is called > Custom AutoLogin-Class reads Cookies > Custom AutoLogin-Class decrypts LTAP-Token from Cookie > Custom AutoLogin-Class returns credentials array
credentials[0] = String.valueOf(user.getUserId());
credentials[1] = user.getPassword();
credentials[2] = boolean.TRUE.toString();
> Liferay accepts login

Sep 8, 2008

Change tablespace in oracle dumps

If you downloaded an oracle dump from Liferay's download site and want you want to import this dump into your Oracle-based Liferay DB you will receive several errors if your tablespace isnt "SYSTEM". To fix the tablespace just open the dump file (.dmp) with an text editor like Notepad++, UltraEdit or Wordpad. You will see some strange symbols. This is because no text editor can display the CLOB entries in the dump. Normal SQL-statements are visible.
So you just have to repleace the string "TABLESPACE "SYSTEM"" with "TABLESPACE "<your_tablespace>"".
The import now will complete without errors.

Sep 1, 2008

IFrame Web-Application for use with Liferay

In Liferay its possible to implement several portals in one installation/deployment using (open) communities. Unfortunatly the URLs of these (open) communities are something like

http://www.<Host>.com/<context of liferay deployment>/web/140012/start

To "hide" these URL you can use a iFrame-Web-Application which is running under a more suitable context (like: "/jobs").

Download an EAR-File of an example application here.

The EAR-File contains an index.jsp. In this file you have to edit the source-declaration in the iframe-tag (src).

The IBM WebSphere configuration items

The WebSphere nomenclature is sometimes i bit confusing.
In this post i will explain the mostly used terms.

A Cell is a logical group of all nodes and there deployment manager.
A node is a group of profiles. Typically one node represents a physical server.
However its possible to install/run more than one node on a physical server (through profiles).
Node agent:
A Node agent is managing a node. The node agent is needed to access the applications.
JVM (App server):
A JVM (Java Virtual Machine) is a Java-Process containing the installed applications.
Deployment Manager (Dmgr):
A Deployment Manager manages the node agents. A Dmgr-Profile contains the configuration for the entire management domain (cell).
The Administrative console runs inside the Dmgr. If the dmgr is down the applications are still avaiable over the respective node agents.

Jul 17, 2008

Install and start an application using wsadmin

Copy the application ear-file to <WAS_PROFILE_ROOT>/installableApps

1. Open wsadmin (with jython)
1.1 Go to "WebSphere_Profile_Root"/bin
1.2 Execute -lang jython
1.3 Enter UserID/Password (if promted)

2. Define needed cell and node variables
2. Execute
e.g.: nodename=NAME_OF_NODE)

3. Install application
3.1 Execute
AdminApp.install('../installableApps/<NAME_OF_EAR_FILE>',['-appname <NAME_OF_APPLICATION>'])

4. Save changes
4.1 Execute

5. Define application manager variable
5.1 Execute
5.2 To print out variable execute
print appManager

6. Assign application to variable
6.1 Execute
6.2 To print out variable execute
print app

7. Define application name to variable
7.1 Execute
7.2 To print out variable execute
print appName

8. Start application
8.1 Execute
AdminControl.invoke(appManager, 'startApplication',appName)

It is easier to use administrative console :-)

<APP_SERVER_NAME>= Name of server (JVM) where the application is deployed
<NAME_OF_APPLICATION> = Name of the application (not the ear-files name)

Install applications [IBM]
Start applications [IBM]

Stop and uninstall an application using wsadmin

Before the application can be unsinstalled it must be stopped.

1. Open wsadmin (with jython)
1.1 Go to "WebSphere_Profile_Root"/bin
1.2 Execute -lang jython
1.3 Enter UserID/Password (if promted)

2. Define needed cell and node variables
2. Execute
e.g.: nodename=NAME_OF_NODE)

3. Define application manager variable
3.1 Execut
3.2 To print out variable execute
print appManager

4. Assign application to variable
4.1 Execute
4.2 To print out variable execute
print app

5. Define application name to variable
5.1 Execute
5.2 To print out variable execute
print appName

6. Stop application
6.1 Execute
AdminControl.invoke(appManager,'stopApplication', appName)

7. Uninstall application
7.1 Execute

8. Save changes
8.1 Execute

It is easier to use administrative console :-)

<APP_SERVER_NAME> = Name of server (JVM) where the application is deployed
<NAME_OF_APPLICATION> = Name of the application (not the ear-files name)
Stop Application [IBM]
Uninstall Application [IBM]

Jul 16, 2008

Setting up an external environment for Liferay 5.0.1 [Windows]

To setup an ext-environment (or: development environment) for Liferay 5 you will need following files:
Java JDK (1.5 and 1.6 will work)
Liferay 5.0.1 source
Liferay 5.0.1 Tomcat-Bundle

First you need to install/unpack Apache Ant, Jikes and the Java JDK.
Also you need to set the system variables ANT_HOME, JIKES_HOME, JAVA_HOME to the correct folders.
1. Create following folder for the external enviroment
1.1 ROOT (c:/ext)
1.2 EXT (c:/ext/portal)
1.3 SRC (c:/ext/src)
1.4 TOMCAT (c:/ext/tomcat)
2. Unpack the downloaded Liferay files
2.1 Unpack Liferay 5.0.1 source to SRC
2.2 Unpack Liferay 5.0.1 Tomcat-Bundle to TOMCAT

3. Create release property file
3.1 Go to SRC and create a file called
3.2 Open file and enter
(e.g: lp.ext.dir=c:/ext/portal)

4. Run ant compile to create files for EXT
4.1 Open command promt and go to SRC
4.2 Execute
ant clean start build-ext
4.3 The compiled files will be moved to EXT

5. Create appserver property file
5.1 Go to EXT and create a file called
5.2 Open file and enter
(e.g: app.server.tomcat.dir=c:/ext/tomcat)

6. Run ant deploy to deploy files in Tomcat
6.1 Open command promt and go to EXT
6.2 Execute
ant clean deploy
6.3 The deployed files will be moved to TOMCAT/"LIFERAY_ROOT"

Create Eclipse projects for external enviroment
1. Open Eclipse (workspace: ROOT)
2. Create new java project called src from existing project (path: SRC)
3. Create new java project called portal from existing project (path: EXT)
4. Open Ant-View (Window > Show View > Ant)
5. Drag & Drop build.xml from src-project into the ant view (on the right)
6. Drag & Drop build.xml from portal-project into the ant view (on the right)

Very useful link:
Liferay Wiki

Jul 15, 2008

Show all JNDI-entries

Sometimes you need to get all entries in the JNDI-namespace (JNDI=Java Naming and Directory Interface). In order to do this you can use the script (.bat).
Just execute
The script is located in the bin-folder of the profile-root.


Its possible to limit the output to a cell or a node. All avaiable parameters can be viewen here.

Jul 9, 2008

Add a portlet to Liferay (deployed via WebSphere's admin console)

Also see this post

In this post i try to descripe how to deploy a portlet in liferay's portlet container using the administrative console of a WAS 6.1 installation.
I will use the sample-jsp-portlet for demonstration.
1. Stop Liferay / Server
2. Copy portal-kernel.jar to "WebSphere_System_Root"/lib/ext/
3. Restart Liferay / Server
4. Edit the web.xml of your portlet-war-file.
4.1. Add following entries (for sample-jsp-portlet):

Link to complete Web.xml for sample-jsp-portlet

Hint: Use Winrar to edit the web.xml in the war-file.
4.2 Edit the portlet.xml
4.2.1 Edit portletName-Tag to

5. Deploy the portlet via administrative console of WebSphere.
5.1 Go to Enterprise applications > "Select your Liferay application" > Click "Update" > Select " Replace or add a single module"
5.2. Browse to the edited portlet-war-file.
5.3 Set "Specify the path beginning with the installed application archive file to the module to be replaced or added." to the portlet's name (in this case: sample-jsp-portlet).
5.3 Set the context path to a correct value (in this case i used: sample-jsp-portlet).

5.4. Click "Next" to start the deployment dialogs
5.5. Click through all deployment steps (change context path to "sample-jsp-portlet" (Step 7)).
5.6. Click "Finish" to deploy the portlet.
6. The portlet will be installed to the liferay-folder and can be added via the "Add application"-menu in Liferay (perhaps you have to restart Liferay/the server).

Download the complete sample-jsp-portlet for websphere here.

Special thanks to "Mate".
Liferay Forum Posts
IBM PK34915

Jul 4, 2008

Add an additional language to Liferay

Adding an additional language to Liferay is not so difficult as it sounds.
For demonstration i will add the "language" en_GB (English for Great Britain)
to Liferay (5).

All supported locales can be viewed here (Java EE - Standard!!).
Technical description here

Following steps have to be proceeded:
1. Add the new language Code to "LIFERAY_ROOT_PATH"/WEB-INF/classes/portal(-ext).properties
## Language

2. If you add an completly new language you need to add an language-xx.propteries (xx=new language) file to /WEB-INF/lib/portal-impl.jar//content. In this case (en_UK) it is not nessary to add a new file because english (en) is already defined.

3. Add an Language-Image to your theme (in classis-theme: /images/language/en_GB.png)

4. Restart Liferay

Jul 3, 2008

Add a portlet to Liferay 5 (deployed in Liferay's Portlet Container)

In this post i will discribe the manual deployment of portlets in WebSphere.
To get some information about the auto deployment of portlets in WebSphere, check out this post.
Manually installation of a portlet in liferays portlet container isnt an easy think but its doable.
I try to explain the procedure with an simple (self created) sample (non-struts) JSP-Portlet.

The portlet just prints out:
Hello - username - how are you?
Download it here

1. Copy the JSP-Files of the portlet to "liferay_folder"/html/portlet/welcome/
("welcome" is the portlet name)
2. Add an <portlet>-entry to WEB-INF/portlet-custom.xml
<display-name>Welcome to Liferay 5</display-name>

3. Add an entry to WEB-INF/liferay-portlet.xml

4. Add an entry to WEB-INF/liferay-display.xml
<category name="category.ownportlets">
<portlet id="welcome" />

5. Add an entry to the (located in WEB-INF/lib/portal-impl.jar)
5.1 Open portal-impl.jar//content/language-"your needed region codes".properties (Hint: use Winrar)
5.2 Add an entry for the portlet title
5.3 Add an entry fot the category name
category.ownportlets=Own portlets
5.4 Save portal-impl.jar

6. Restart server

7. After the restart it's possible to add the welcome-portlet via the "Add Application" menu

If you want to deploy a struts portlet you have to additionally edit the struts-config.xml and the tiles-def.xml.

If you downloaded a portlet form its a bit easier.
Open the downloaded war-file and take a look at the delivered xml-files.
These files just contain the additional entries needed for this portlet.
Copy these entries and paste them in the xmls located in your liferay installation.
Also extract all resources (classes,jars, jsps) to the corresponding folder.
Restart the server and thats it.
Picture (maybe it helps :-) :

Use an ext-enviroment and choose websphere as app-server


Jul 1, 2008

Deploy Liferay 5 in WebSphere Application Server 6.1

For the latest install guides click here

Several problems need to be solved before Liferay 5 works correct in WAS 6.1.
Steps for installation:
1. Add ibm-web-bnd.xmi and ibm-web-ext.xmi to the WEB-INF-folder in the Liferay 5 WAR-file. (These files determinate that WAS is compiling Liferay 5 with JRE/JDK 1.5).
2. Create the Liferay 5 datasource (jdbc/LiferayPool - take a look at this post)
3. Deploy Liferay 5 WAR-File (with dependencies)
4. Move the JAR-files icu4.jar and portlet.jar from "Liferay-Root-Path"/WEB-INF/lib/ to /"WebSphere System Root"/java/jre/lib/ext (or change class load order :)
5. Somehow the WAS JSP-Compiler doesn't accept a JSP-Print-Tag (<%=... %>)
which contains quotes or double quotes (' or "). So you need to rewrite/replace some JSP-Files.
Current list of not working JSP-files:

  • ../html/portal/layout/edit/common.jspf
  • ../html/portlet/tagged_content/display_full_content.jsp
  • ../html/portlet/enterprise_admin/edit_organization_profile.jspf
  • ../html/portlet/enterprise_admin/edit_role_permissions_resource.jsp
  • ../html/portlet/enterprise_admin/organisation_action.jsp
  • ../html/portlet/enterprise_admin/user_group_action.jsp
  • ../html/portelt/rss/configuration.jsp
  • ../html/portlet/wiki/page_iterator.jsp
  • ../html/portlet/calender/edit_event.jsp
You can download the correct JSP-Files here. This step seems not to be necessary in Liferay 5.1.2.

6. For Liferay 5.1.2 geronimo-annotation_1.0_spec-1.1.1.jar (contained in apache geronimo) needs to be added to /Web-INF/lib [Temp fix - not for production - some spring releated database errors still occure in Liferay 5.1.2]

7. Edit the jdbc data source for higher load (especially for Oracle Databases)
7.1 In administrative console go to Resources > JDBC > Data sources > jdbc/LiferayPool > Connection pool properties
7.2 Adjust the connection properties for your needs

Connection Timeout -> decrease
Maximum Connections -> increase dramatically
Minimum Connections -> 1
Reap time -> decrease
Unused timeout -> decrease dramatically
Aged timeout -> 0

8. For Liferay 5.1.2 you need to go to Enterprise Admin > Settings and adjust the virtual host value

Jun 30, 2008

Enable session failover in clusters

Sometimes its necessary to synchronize the whole session between two (or more) cluster members. Especially when some important attributes are stored in the session (search,...).
WebSphere offers an option called "Session Replication" to avoid the lost of a session because of a crashed Cluster Member.

First you need to setup a replication domain for the cluster
1.1. Go to Enviroment > Replication domains > New
1.2. Type in the name of the replication domain and click OK
1.3. Save & synchronize changes

Now its possible to setup the session replication
2.1. Go to Application servers > "ClusterMember1" > Web container > Session management > Distributed environment settings
2.2 Click Memory-to-memory replication
2.3 Select your newly created replication domain and "Both client and server" as replication mode
2.4 Click OK
2.5 Save & synchronize changes

Repeat this steps (2.1 -> 2.5) for every Cluster Member.

3. Restart all Cluster Members

Jun 25, 2008

Problems with WebSphere Update Installer

Yesterday i just wanted to update my testing enviroment to WAS
Iin order to do that i just wanted to install the Update Installer
I executed the install-script an nothings happens. Nice.
In the end i detected an error on the JDK/JRE shipped with the Update Installer.
Error message:
/opt/WebSphere/UpdateInstaller61017_install/JDK/jre.pak/repository/ cannot execute binary file
I couldnt really determinate the problem, but i managed to launch the Update Installer with another JRE.
/"WAS_SYSTEM_ROOT"/java/jre/bin/java -cp /"UPDATE_INSTALLER_PATH"/UpdateInstaller/setup.jar -Xms48m -Xms384m run -options /"UPDATE_INSTALLER_PATH"/UpdateInstaller/responsefile.updiinstaller.txt -silent

For Installation i used a responsefile and the silent install mode. Our 64bit-System doesnt support the Install-GUI of the UpdateInstaller.
To run the Update Installer i executed
/"WAS_SYSTEM_ROOT"/java/jre/bin/java -cp /"UPDATE_INSTALLER_PATH"/update.jar -Xms48m -Xms384m run

I didnt mangage to find the "problem" on the delivered JDK/JRE. Probably there is someting wrong with the CLASSPATH.

Problem conclusion:
Replace the JRE-folder ("UPDATE_INSTALLER_PATH"/java/jre) with a jre-folder of a old Update-Installer-Installation.
Here you can download a working jre-folder
Part 1
Part 2
You need Winrar to unpack.

Update 2 (new):
Seems like IBM removed the Intel Intanium 64 Bit version of the Update Installer.
Only the Linux for AMD/Intel 64 Bit version is available at the moment.

Jun 23, 2008

Increase the performance of Liferay

This is my first post considering the portal application Liferay.

How to increase performance:
1. Activate servlet-caching in WebSphere Application Server (see post below)

2. In portal(-ext).properties set

3. Disable JavaScript
If you are using Liferay as an guest user, JavaScript is not nessarly needed.
3.1 Disable Ajax-Portlets
3.1.1 Open WEB-INF/liferay-portlet.xml and and add the tag ajaxable to every portelt entry
3.1.2. Open /html/themes/"your theme"/portal-normal.vm and replace the code line
#js ($js_main_file)

#if ( $is_signed_in )

#js ($js_main_file)


3.1.3 Test it .-)

4. Have a look at

Using the same JNDI-Name for different applications

Sometimes its nessesary to install the same application twice on one application server cell (or even node).
If this applications are using the same JNDI-Name (like jdbc/LiferayPool) but another Database, you can separate these resource-declarations with the Scope-option in WebSphere.

Problem description:

The Applications are installed on different application servers (JVMs).

1. Go to Resources > JDBC > Data sources
2. Select the application server (JVM) on which for the jdbc-resource corresponding application is installed.

3. Click New to create the JDBC-Resource under this Scope.

4. Repeat this step for the other JDBC-Resource (select the application server of the other application).

Result description

This option is useful for applications like Liferay.

Jun 10, 2008

Rebuilding an application EAR-File

Sometimes its nessesary to extract an application and to (re)-build an EAR-File which can be deployed on another Application Server.
Tools needed: Eclipse WTP

1. Copy the application-folder to your local harddrive
2. Start Eclipse WTP and create an new project
2.1 Select File > New > Project... > Dynamic Web Project
2.2 Enter a project name
2.3 Select "Add project to an EAR" and click "New"
2.4 Enter a project EAR name (e.g. "original project name (2.2) + ear)
2.5 Click "Finish" in EAR-Window
2.6 Click "Finish" in Project-Window
3. Add the application files to the project
3.1 Drag an drop the files located in the WAR-folder of the application to folder "Webcontent" in the project.
3.2 The project should now look like this4. Build EAR-File
4.1 Right-Click Project > Export > Export... > EAR-File
4.2 Select destination of the EAR-File and Click "Finish"

Jun 3, 2008

Increase performance of applications with servlet caching

WebSphere Application Server (Version 5,6,6.1) provides the servlet caching option to increase the performance of applications. If servlet caching is enabled, the servlet output will be held in RAM of the physical application server. As an result clients can be served faster. In my tests i noticed a performance increase about 50 percent.
So how to enable servlet caching?
1. In administrative console go to
Application servers > "Server name" > Container services > Dynamic cache service
and set "Enable service at server startup" to true.

2. Go to
Application servers > "Server name" > Web container and enable servlet caching for this application server
3. Restart the application server

More RAM-Space is needed to cache the output.
Servlet output will be cached in RAM during first invocation of JSP/Servlet.

Re-Install Admin Console (isclite) in WebSphere Application Server

If the admin console (isclite) is broken or was accidentally uninstalled, you can re-deployment (reinstall) the console-application by executing the jython script

1. First do a clean removal of the old admin-console deployment:
"System-folder"/bin/ -lang jython -f remove
2. After that reinstall the administrative console (isclite):
"System-folder"/bin/ -lang jython -f install
3. Double check the application mapping. Take a look at:
/"profile-root"/config/cells/"cell name"/nodes/"node name"/applications/isclite.ear/deployments/isclite/deployment.xml
3.1 And check if the <deploymenttargets>-Tag points to the correct server.

4. Take a look at
/"profile root"/config/cells/"cell name"/nodes/"node name"/serverindex.xml
4.1. Check if the <deployedapplications>-Tag for the application isclite  is mapped to the correct server (server1 in base version of WebSphere).

Now the administrative console should work again.

May 30, 2008

Add an additional application server (JVM) to WAS 6.1 - Base version

In "WebSphere WAS 6.1 Base Version" only one application server is available (server1).
Via administrative console an additional server CAN NOT be created.
However there are alternative ways to do this.
1. Use wsadmin command line tool (start it with .../bin/

1.1 Use following command to define the Node which you want to add an application server
set node [$AdminConfig getid /Node:"NODE NAME"/]
1.2 Use this command to create an application server
$AdminTask createApplicationServer "NODE NAME" {-name "AppServer-Name" –templateName default}
1.3 Save changes with
$AdminConfig save

2. Hack the properties of administrativ console
2.1 Go to \profiles\config\cells\"cell name"\nodes\"node name"\
2.2 Open
Change the property from,,,,
2.4 Save file and restart servers
2.5 New ApplicationServers can now be created via administrative console

Note: Not all added menu items will work. Some background scripts aren't provided in WAS Base Version (e.g. Add Webservice gateway instance)

May 14, 2008

Startup behavior of an application

When you need to disable the auto-start option of an application go to "Enterprise Applications > Name of Application > Target specific application status", select Application Server and click "Disable Auto Start".

To adjust the startup order go to "Enterprise Applications > Name of Application > Startup behavior" and adjust to Startup order by changing the field-value.
Applications with lowest value are started first.
Applications with the same value are not startet in an specific order.

May 2, 2008

Update an WebSphere Installation

Tools needed:
IBM UpdateInstaller
Grapical User Interface (Display-variable)

In order to use the IBM UpdateInstaller a Grapical User Interface recommanded (I used Exceed. KDE, GNOME will work too)

1. Install IBM Update Installer
1.1 Download all necessary Updates on IBMs Update Site (use Update Wizard)
1.2 Copy all files to WebSphere-Server
1.3 Go to Update Installer-Directory and run install
1.4 Update Installer Installation GUI starts
1.5 Click through dialogs and install IBMs Update Installer

2. Run Update Installer
2.1 Go to install-directory of Update Installer
2.2 Run
2.3 Click through dialogs and select as directory the WebSphere System directory (not the profile directory).
2.4 Select directory of maintance packages and run installation

Apr 28, 2008

WebSphere licensing

How does IBM licence WebSphere?

Right now they are using Processor Value Units (PVUs). Which means every core of an CPU is a processor which needs to licenced. So if you have an Quad-Core-CPU you need to licence four processors.

Additionally every CPU-Type costs a different amount of PVUs, depending on the max. sockets of the underlying system.

See the following linkg for the most recent table:

Depending on the version of WebSphere Application Server (Base, Express, Network Deployment, etc.) each PVU costs different.

Use the IBM PVU Calculator.
Add a WebSphere Application Server to your shopping cart to calculate correct licence costs (without any discounts).

Strangely IBMs Power-CPUs are rated highest.
The Price for an WebSphere Application Server Network Deployment Value Unit is ~155 $.
Not a cheap amusement.

Apr 24, 2008

Add JAX-RPC-Handler to WebService (Gateway Instance)

In this post i try to explain how to add an JAX-RPC-Handler to an Webservice Gateway Instance.
As you can see in the picture i posted below an JAX-RPC-Handler is connected to an Inbound or Outbound-Port of an WSGW-Instance. JAX-RPC-Handlers are commonly used for logging a Webservice.
Note to Mediations:
Mediation is are not specified to an WebService.
Mediations are connected to message destination. This enables mediations to log the message queues.

1. In Admin-console go to Service Integration > Webservices > JAX-RPC Handlers > New
Name: Name of Handler
Classname: "Classpath of your handler class"
your handler class(es) should be stored in "Websphere System directory"/lib/ext/"your class structure"
2. Go to Service Integration > Webservices > JAX-RPC Handler List > New
Fill out the form and move your handler class to right field.
3. Add JAX-RPC-Handler to Inbound-Port of WS-Gateway Service
3.1 Go to Service Integration > Buses > "Your Bus" > Inbound Services > "your inbound service" > Inbound ports > "Your inbound port"
3.2 Select JAX-RPC-Handler List from drop-down-menu and click "OK"

Apr 23, 2008

How to create an WebService-Gateway in WebSphere Application Server 6.1

In this post i try to explain how to implement an Webservice Gateway in WebSphere Application Server 6.1.
To created and manage Webservice Gateways over administrativ console the Websphere Network Deployment Licence is needed.
The following picture shows how an Webservice Enviroment should look like in the end.

Note: JAX-RPC-Handlers and Mediations will be configured in another post (see above)

1. Installation of SDO Repository
1.1 Ensure that Server/Node is started
1.2 Locate installSdoRepository.jacl (probably in bin-directory)
1.3 Change to bin-directory of profile and execute
wsadmin -f "location of installSdoRepository.jacl" -createDb
to create the SDO-Repository (storage for WSDL-Definitions,..)
1.4 Locate sibwsInstall.jacl(probably in util-directory)
1.5 Execute
wsadmin -f "Location of sibwsInstall.jacl" INSTALL_RA -nodeName "Name of Node" -installRoot "Location of System"
to install the Resource Adapter (used to invoke Web services)
1.6 Execute
wsadmin -f "Location of sibwsInstall.jacl" INSTALL -nodeName "Name of Node" -installRoot "Location of System"
to install the SIBWS-Application (SIBWS= Service Integration Bus Web Services)
1.7 Execute
wsadmin -f "Location of sibwsInstall.jacl" INSTALL_HTTP -nodeName "Name of Node" -installRoot "Location of System"
to install the HTTP-Channel-Applications (needed for accessing an Web Service)

What we created:
We installed all necessary application (components) for creating a WebService Gateway.
In the next Steps we will associate these applications with Endpoint Listeners.

2. Create and configure SIB
2.1 In administrative console go to Integration > Buses
2.2 Create an new Bus
2.3 Add an Server/Cluster as an Bus Member to newly created Bus (Bus > Bus Member > Add)
2.4 Create End Point Listener
2.4.1 In admin console go to Servers > Application Servers > "Server which was added as Bus Member" > Additional Properties > Endpoint Listener
2.4.2 Click "New" to create Endpoint Listener
Name: SOAPHTTPChannel1
Binding: SOAP over HTTP
URL-ROOT: "URL of Bus Member Server"/wsgwsoaphttp1
WSDL servering URL: "URL of Bus Member Server"/wsgwsoaphttp1/wsdl

2.5 Connect End point listener to SIB
2.5.1 Go to newly created End point listener > Connection Properties > New
2.5.2 Select newly created Bus
2.6 Restart server(s) to start message engine
2.6.1 Perhaps an authenticate error occurs. In this case you need to create a J2C Authentication data entry an associate it to the message engine (Panel: Integration > Buses > "Bus name" > Security for bus "bus name" > Inter-engine authentication alias) . J2C data should contain the credentials of the primary Websphere admin (wasadmin).

3. Create an Webservice Gateway Instance for your WebService Application
3.1 Go to Service Integration > Buses > "Bus Name" > Web Service Gateway instances > New
Name: "name of wsgw"
Gateway namespace:"busname".wsgw1
Default Proxy WSDL URL: "URL of Bus Member"/sibws/proxywsdl/ProxyServiceTemplate.wsdl
3.2 Go to Service Integration > Buses > "Bus Name" > Web Service Gateway Instances > "name of wsgw" > Gateway services > New
This is were you need the WSDL of your Webservice application (which have to be installed first).
3.2.1 Select WSDL-defined web service provider
3.2.1 Fill out Step 1 with your Gateway Service Name
3.2.2 Fill out Step 2 with your WSDL location (URL)
3.2.3 Go through other steps (no input needed) and click "Finish"

Edited: 01.07.2008
Adapted from WAS 6.0

Export / Import LTPA-Keys for Single Sign On (SSO)

Sometimes its necessary to implement an SSO-Enviroment over different WebSphere-Cells (e.g. Production-Cell and Acceptance-Cell). To do this both cells need the same LTPA-Keys.
The synchronization of LTPA-Keys can be done over Admin-Console.

1. To Export LTPA-Keys from a Cell navigate to
Security > Secure administration, applications, and infrastructure > Authentication mechanisms and expiration.

2. Fill out the import/export-Form at the bottom of the pageand click "Export keys". The LTPA-Keys will be exported to the specified directory. (The Keys will be password protected.)

3. Copy the exported ltpa.jceks-File to other the Cell (do not override ltpa.jceks of this cell).

4. Take a look at ltpa.jceks-File of this cell and note the file-size.
File is located in /"websphere"/"dmgr"/config/cells/"cellname"/ltpa.jceks

5. To import the LTPA-Keys to other Cell navigate to
Security > Secure administration, applications, and infrastructure > Authentication mechanisms and expiration.

6. Fill out "Cross-cell Single sign on"-From and click "Import keys"

7. File size of ltpa.jceks-File of this Cell should now be increased.
Sometimes nothing happens to file size of ltpa.jceks-File and Cross-cell SSO will not work (WAS-Bug).
In this case just repeat the import.

8. Restart servers/node

Apr 22, 2008

Add an stand alone profile to Dmgr with addNode-Command

Sometimes you want to add an stand alone profile/node to an existing Deployment Manager. In order to do this use the addNode-Command.
1. Change to /bin-Directory of the profile you want to add.

2. run addNode-Command "Dmgr_Hostname" -username "dmgradmin" -password "dmgradminpassword"

3. If addNode-Command was successfull, an message like this one should appear
Node XXX has been successfull federated

Apr 21, 2008

WebSphere Rapid Deployment

Hi, now i got something special for you. Rapid Deployment in Websphere Application Servers (WRD).
WRD allows you to deploy applications automatically (like Tomcat/JBoss).
WRD is usefull in test enviroments.
I do not recommend it for Production Enviroment.

here you got an quite good IBM Education PDF:
Click [REMOVED] Sorry :-(

WRD will not work in clusters

IBM Support Toolbar

Hi i just found this. Maybe its interessting for someone:

its an Support-Toolbar for IE and Firfox.
I tried it and its OK. Not more not less.

Federate an Application Server - Profile to Dmgr

We can easily create an Application-Server-Profile and federate it directly to an Dmgr

First we need an reponse-file:
profileName="NAME OF PROFILE"
nodeName="NODE NAME"


then we can execute

manageprofiles.bat -repsponse "PATH_TO_RESPONSE_FILE"

After a few minutes the newly created Profile (Node) should appear in "System administration > Nodes" in the Dmgr-Console

How to Create an Dmgr-Profile

So, how to create an Deployment-Manager-Profile.
First of all you need an response-file like this one:
templatePath=C:/Program Files/IBM/WebSphere/AppServer/profileTemplates/dmgr
profilePath=C:/Program Files/IBM/WebSphere/AppServer/profiles/Dmgr

now you can easily create an dmgr with mangeprofiles.bat / -response "PATH_TO_RESPONSEFILE"

After this, you can start the dmgr

startManager.bat /

Thats it :-)

Apr 20, 2008

Disable auto-generation of LTPA Keys

In a sso-enviroment this option could be a source of problems.
Websphere is configured by default to automatically generate new LTPA Keys every 12 weeks.
This caused some problems in our sso-enviroment.
Here is an link to this issue:

here another one (PPT):

backup your config-directory.
LTPA-Keys are stored in this file

Apr 18, 2008

First Post

Hi there,

in this blog i want to share my experience with websphere application servers.

In addition i want to share my Liferay (an OpenSource-Portal-Software) experience.