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

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 6.1.0.17.
Iin order to do that i just wanted to install the Update Installer 6.1.0.17.
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/package.java.jre/java/jre/bin/java: 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.

Update:
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

javascript.fast.load=true
theme.css.fast.load=true
velocity.engine.resource.manager.cache.enabled=true

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
<portlet>
<portlet-name>1</portlet-name>
<icon>/html/portlet/mail/icon.png</icon>
<struts-path>mail</struts-path>
<preferences-unique-per-layout>false</preferences-unique-per-layout>
<preferences-owned-by-group>false</preferences-owned-by-group>
<use-default-template>false</use-default-template>
<restore-current-view>false</restore-current-view>
<maximize-edit>true</maximize-edit>
<private-request-attributes>false</private-request-attributes>
<private-session-attributes>false</private-session-attributes>
<render-weight>0</render-weight>
<ajaxable>false</ajaxable>
<header-portlet-javascript>/html/portlet/mail/packed.js</header-portlet-javascript>
<css-class-wrapper>portlet-mail</css-class-wrapper>
</portlet>
3.1.2. Open /html/themes/"your theme"/portal-normal.vm and replace the code line
#js ($js_main_file)

with
#if ( $is_signed_in )

#js ($js_main_file)

#end

3.1.3 Test it .-)

4. Have a look at
http://wiki.liferay.com/index.php/Performance

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:

Assumption:
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

Note:
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 deployConsole.py

1. First do a clean removal of the old admin-console deployment:
"System-folder"/bin/wsadmin.sh -lang jython -f deployConsole.py remove
2. After that reinstall the administrative console (isclite):
"System-folder"/bin/wsadmin.sh -lang jython -f deployConsole.py 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.