WebSphere
Prerequisites
The following sections discuss prerequisites that must be performed
before Stardust can be deployed within a WebSphere application server.
A basic understanding of WebSphere Administration, Enterprise
Application Archive (EAR), and Web Application Archive (WAR) files is required
from this point forward.
Note
We we recommend to enable 2nd-level caching for production deployments to optimize
the performance of a secure JCR deployment. For details refer to section
Clustering your Web Application with Hazelcast and to chapter
Optimizing the Performance of secure JCR Deployments accordingly.
Download and Installation
Before any activities can be done, download WebSphere from the WebSphere
Download Site. Once downloaded, install WebSphere onto the host server. The
WebSphere installation directory is referred to as %WEBSPHERE_HOME%
from this point forward.
JDBC Drivers
JDBC Drivers are configured as part of the application server setup
within WebSphere and are documented in the following sections. JDBC Drivers are
referenced using WebSphere environment variables and therefore are copied to the
directory referenced by the variables.
Clustering your Web Application with Hazelcast
We recommend to cluster your Web application with the data distribution platform
Hazelcast as described in section
Using Hazelcast on WebSphere 7.
Java Virtual Machine Setup
When running in the IBM
WebSphere Application Server, Class.getResource(String) may return a
URL with a wsjar scheme, like
wsjar:file:/C:/dev/ws/default/sample_app/xsd.resources.jar!/org/eclipse/xsd/plugin.properties. By
default, EMF will not recognize this as an archive URI and will fail to handle
it correctly. This would probably result in multiple unregistered resource
errors (e.g. java.lang.IllegalArgumentException: resolve against
non-hierarchical or relative base) and/or null pointer exceptions. To overcome
such problems, EMF's set of recognized archive schemes must be changed by
setting the property as described below:
- Login into your WebSphere administration console.
- Go to Servers > server1 > Java and Process
Management -> Process Definition > Java Virtual Machine > Custom
Properties.
- Add the following properties:
- org.eclipse.emf.common.util.URI.archiveSchemes
with wsjar wszip jar zip
In the same way change the property java.awt.HeadlessException
to value false in the Custom Properties section.
Per default this property is set to
true on WebSphere. This might result into a java.awt.HeadlessException
if a diagram should be generated in the Stardust portal. Setting the
property to false prevents this exception.
WebSphere Setup
This sections contains the following information regarding setting up the
transactional resources required by Stardust in the WebSphere server.
The following description is based on WebSphere version 7.
Set your classloader mode to Classes loaded with local classloader
first (parent last).
Audit Trail Login
The login helps in authenticating the audit trail database
- Login into WebSphere administration console.
- Navigate to Security > Global security.

- In the Global security pane,
expand Java Authentication and Authorization Service
and select J2C authentication data.

- Click New.

- Enter the following details:
Alias: carnot-auth
User ID: your database login ID (for example
carnot)
Password: your database login password (for
example carnot)

- Click OK.
JDBC Driver
- Login into WebSphere administration console.
- Navigate to Environment > WebSphere Variables.

- To select a server scope, select a node scope first.

- Click New to create a new entry.

- Enter the following properties:
- Name: DB2UNIVERSAL_JDBC_DRIVER_PATH
- Value: <db2-home>/java (e.g.
/opt/IBM/db2/V8.1/java)

- Click Apply then OK.
Data Source
- Login into WebSphere administration console.
- Navigate to Resources > JDBC > JDBC providers.

- Select server scope and click Apply.
- Click New to add a new entry.
- In the according drop down lists select the following:
- Database type: DB2
- Provider type: DB Universal JDBC Driver Provider
- Implementation type: XA data source

- Click Next. Check the driver jars are in class
path.
- Click Next. Now you see the summary, e.g.:

- Click Finish in case the summary displays correct
data.
- Select Additional properties > Data sources.

- Click New to add a new datasource.
- Enter the following basic data source information:
- Name: CarnotTxDataSource
- JNDI Name: AuditTrail.DataSource
- Click Next.
- Enter database specific properties

- Enable the Use this Data Source in container
managed persistence (CMP) option.
- Use the default store helper class

- Container-managed authentication: carnot-auth

- Enter the following Data source properties:
- Driver type: 4
- Database name: e.g. carnot
- Server name: <host of db> (e.g. localhost)
- Port number: <connection port db> (run netstat
-an to find out, or nmap <ip> from remote host)

- Click OK and save.
- Navigate to datasources.

- Select created datasource and choose
TestConnection.

Transaction Isolation Level
- Navigate to Data sources > Additional Properties
> Custom properties.

- Click New and create isolation with
the following details:
- Name: webSphereDefaultIsolationLevel
- Value: 2

JMS Provider
- Navigate to Service Integration > Buses.

- Click New.
- Enter carnot-bus as name for the new bus.

- Click Next and Finish
to confirm.
- Click on carnot-bus and select Topology
> Bus members.

- Click Add to create a new entry with default
setting, without specifying a JNDI name for the bus member.
- Click Finish and save.
Restart WebSphere to check:
- Select Servers > Server Types >
WebSphere application servers

- Click on server1 .

- Select Server messaging > Messaging engines

- Now check if the carnot-bus is started.

JMS Connection Factory
- Navigate to Resources > JMS > Queue connection factories

- Select the server and click New.
- Select Default messaging provider and
click OK.

- Enter the following properties:
- Name: CarnotConnectionFactory
- JNDI Name: CarnotConnectionFactory

- Click OK.
JMS Queues
In this section we will create three jms queues used for daemon specific,
workflow and application specific messages.
- Navigate to Service Integration > Buses.
- Click carnot-bus.
- Select Destination resources > Destinations.

- Click New to create queues.
- Select type Queue.

- Use the following queue
names:
- CarnotApplicationQueue
- CarnotSystemQueue
- CarnotDaemonQueue

- Assign the queue to a bus member (server1) and click
Next.

- Click Finish to confirm the queue creation.

- Restart the WebSphere server.
- Navigate to Servers > Server Types > WebSphere Application servers.

- Select server1.

- Click Server messaging > Messaging engines

- Select the server carnot-bus.
- Select Message points > Queue points.

- Now the message points for your queues are listed.

Queue Destinations
- Navigate to Resources > JMS > JMS providers.

- Select Default messaging provider.
- Select Queues > New.
- Add three JMS queues with bus-name carnot-bus and the following
JNDI names:
- CarnotApplicationQueue
- CarnotSystemQueue
- CarnotDaemonQueue

Listener Ports
- Navigate to Servers > Server Types >
WebSphere Application servers.
- Click server1.
- Click Communications > Messaging > Message listener
service.

- Select Additional Properties > Listener Ports

- Click New to add new listener ports. Start with the
following entries:
- Name: CarnotApplicationQueue
- Destination JNDI name: CarnotApplicationQueue
- Connection factory JNDI name: CarnotConnectionFactory
- Maximum sessions: 10

- Repeat these steps for CarnotSystemQueue and CarnotDaemonQueue.
Activation Specifications
- Navigate to Resources > JMS > JMS providers.
- Click Default messaging provider.
- Select Additional Properties > Activation specifications

- Click New to create new activation specifications.
- In the Administration part, enter:
- Name: MDBCarnotApplicationQueue
- JNDI Name: eis/MDBCarnotApplicationQueue

- In the Destination part, enter:
- Destination type: Queue
- Destination JNDI name: CarnotApplicationQueue
- Bus name: carnot-bus
- Acknowledge mode: Auto-acknowledge

- In the Additional part, enter:
- Maximum batch size: 1
- Maximum concurrent MDB invocations per endpoint: 10

- Add Subscription durability: Nondurable.

- Similarly create MDBCarnotDaemonQueue and MDBCarnotSystemQueue.
Deployment
The following sections provide instructions on deploying Stardust in a
WebSphere application server.
Note that the following osgi related system properties are
overwritten to make process diagrams in the Stardust portal available
with a WebSphere deployment:
- osgi.bundles*
- org.osgi.framework.bootdelegation*
- osgi.framework.extensions*
- osgi.syspath*
- osgi.parentClassloader*
Deploying the EAR file into the WebSphere Application Server
The following sections provide instructions on deploying the Stardust
components as a single Enterprise Archive. All components execute within a single
JVM process on the WebSphere application server. This deployment utilizes the
provided EJB features such as JMS queues for forking jobs, message driven bean
for controlling queuing and EJB session beans for management client / server
interaction and threading.
Predefined deployment configurations for WebSphere
To achieve the carnot.ear file or needed war files provided by Stardust,
download one of the Maven archetype templates from the Stardust artifactory
matching your requirements.
The following deployment configurations for WebSphere are provided as archetypes:
- ipp-archetype-was7-ipp-ear - prepares an EAR deployment for
WebSphere 7 and provides a console environment for EJB.
- ipp-archetype-was7-ipp-portal-war - prepares a WAR deployment
for WebSphere 7.
- ipp-archetype-was8-ipp-ear - prepares an EAR deployment for
WebSphere 8 and provides a console environment for EJB.
- ipp-archetype-was8-ipp-portal-war - prepares a WAR deployment
for WebSphere 8.
Refer to chapter
Creating a Stardust Runtime Environment with Apache Maven
in the
Stardust Installation Guide for details.
Stardust provides predefined deployment configurations for WebSphere
including a prepared ear file. Please refer to the Stardust support
for details.
Configuration
Add the following jar files, residing in %WAS_HOME%/runtimes
to the classpath.
List for jar files for WebSphere 7:
- com.ibm.ws.admin.client_7.0.0.jar
- com.ibm.ws.ejb.thinclient_7.0.0.jar
- com.ibm.ws.orb_7.0.0.jar
List of jar files for WebSphere 8:
- com.ibm.ws.admin.client_8.0.0.jar
- com.ibm.ws.ejb.thinclient_8.0.0.jar
- com.ibm.ws.orb_8.0.0.jar
Set your
classloader mode to classloader with local classes loader
first (parent last) .
- Login to the Administration Console.
- Select Applications > New Application.

- Select New Enterprise Application.

- Browse to carnot.ear.

- Click Next.
- Select Detailed as setting on how to
install the application and select
Next.
- In the Select installation options part,
choose the following options:
- Enable Distribute application.
- Enable Deploy enterprise beans.
- Application name: CARNOT

- Select Next.
- In the Map modules to servers part,
review options to perform the EJB deploy and select Next.

- Continue by accepting default settings until you get to
Bind listeners for message-driven beans.
- In the Bind listeners for message-driven beans part,
choose the following activation specifications target resource
JNDI names:
- MessageListener : eis/MDBCarnotSystemQueue
- DaemonListener : eis/MDBCarnotDaemonQueue
- ResponseHandler : eis/MDBCarnotApplicationQueue

- Select Next.
- Enter the following JNDI names for the EJB:
- DocumentManagementService : org.eclipse.stardust.engine.api.runtime.DocumentManagementService
- WorkflowService : org.eclipse.stardust.engine.api.runtime.WorkflowService
- AdministrationService : org.eclipse.stardust.engine.api.runtime.AdministrationService
- UserService : org.eclipse.stardust.engine.api.runtime.UserService
- QueryService : org.eclipse.stardust.engine.api.runtime.QueryService
- ForkingService : org.eclipse.stardust.engine.api.runtime.ForkingService

- Click Next.
- Fill in the JNDI names for the EJB references:
- org.eclipse.stardust.engine.api.ejb2.beans.LocalForkingService
: org.eclipse.stardust.engine.api.runtime.ForkingService
- org.eclipse.stardust.engine.api.ejb2.RemoteWorkflowService
: org.eclipse.stardust.engine.api.runtime.WorkflowService
- org.eclipse.stardust.engine.api.ejb2.RemoteAdministrationService
: org.eclipse.stardust.engine.api.runtime.AdministrationService
- org.eclipse.stardust.engine.api.ejb2.RemoteUserService
: org.eclipse.stardust.engine.api.runtime.UserService
- org.eclipse.stardust.engine.api.ejb2.RemoteQueryService
: org.eclipse.stardust.engine.api.runtime.QueryService
- org.eclipse.stardust.engine.api.ejb2.RemoteDocumentManagementService
: org.eclipse.stardust.engine.api.runtime.DocumentManagementService

- Select Next.
- Map Resource References to resources:
- Map all jcr/ContentRepository references to the according
jndi name, e.g. jcr/jackrabbit.

- Map all jms/CarnotXAConnectionFactory references to CarnotConnectionFactory.

- Map all jdbc/AuditTrail.DataSource references to AuditTrail.DataSource.

- Click Next.
- Map Resource Environment Entry References to Resources:
- Map all jms/CarnotSystemQueue references to CarnotSystemQueue.
- Map all jms/CarnotApplicationQueue references to CarnotApplicationQueue.
- Map all jms/CarnotDaemonQueue references to CarnotDaemonQueue.

- Click Next.
- Map virtual hosts for Web modules

Choose a server to deploy and select Next.
- Leave option Uncheck as option for
Ensure all unprotected 2.x methods have the correct level of
protection and select Next.
- Now you can check the Summary of
your installation.

- Select Finish.

- Save your configuration.

Running a WebSphere 7 deployment on WebSphere 8
To be able to run a WebSphere 7 deployment on WebSphere 8 the following additional
steps are required:
- If not already done, remove the
org/w3c folder from xmlbeans-2.3.0.jar to have a proper
classpath. This folder contains the Java package org.w3c.dom, which
is already included in the JRE.
- Deploy the Jackrabbit RAR:
If you have deployed the resource adapter you have to validate if the
checkbox Isolate this resource provider is enabled. You
can find this option at
Resources > Resources Adapters > Resource adapters > <your-jackrabbit-deployment>.
If you click on <your-jackrabbit-deployment> you see the option in the
lower part of the panel.
- Create a Maven project on basis of the archetypes mentioned in section
Predefined deployment configurations for WebSphere. You
can do that as follows:
mvn archetype:generate -DarchetypeGroupId=com.infinity.bpm.archetypes
-DarchetypeArtifactId=ipp-archetype-was7-ipp-ear -DarchetypeVersion=<version>
-DgroupId=com.infinity.qa -DartifactId=was8-ipp-ear -Dversion=1.0-SNAPSHOT -DinteractiveMode=false
Please note that the command mentioned above is using the archetype in
version determined via <version> and is creating an EAR deployment.
- For ipp-archetype-was7-ipp-ear you have to do modify the
console pom.xml. Open ipp-archetype-was8-ipp-ear/console/pom.xml in an
editor and change each occurrence of 7.0.0 in the dependencies section
to 8.0.0.
- Create the deployment:
mvn package -Dwasclient.dir=<path-which-contains-the-client-JARs>
Hereby, <path-which-contains-the-client-JARs> should contain
the following libraries:
- com.ibm.ws.admin.client_8.0.0.jar
- com.ibm.ws.ejb.thinclient_8.0.0.jar
- com.ibm.ws.orb_8.0.0.jar
- Deploy the archive exactly in the same way as for WebSphere 7. You can
find the deployment in ipp-archetype-was8-ipp-ear/ear/target for the
EAR deployment and ipp-archetype-was8-ipp-portal-war/target respectively
for WAR deployment.
SecurityExceptions or AccessControlExceptions during Deployment
In some cases, a SecurityException or AccessControlException occurs
during the deployment using diagram runtime components.
To avoid these exceptions:
- Add the following entries to the web.xml file:
- Optionally add the URL of the actual login page, in case
you use your custom login page:
<context-param>
<param-name>carnot.LOGIN_PAGE</param-name>
<param-value>/plugins/common/login.iface</param-value>
</context-param>
- Add the servlet containing the landing page code:
<servlet>
<servlet-name>ippLandingPage</servlet-name>
<servlet-class>com.infinity.bpm.portal.umb.LandingPage</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
- Add the according URL mapping for index_jsp and logout.jsp:
<servlet-mapping>
<servlet-name>ippLandingPage</servlet-name>
<url-pattern>/index.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ippLandingPage</servlet-name>
<url-pattern>/ipp/common/ippPortalLogout.jsp</url-pattern>
</servlet-mapping>
- Replace the listener entry:
<listener>
<listener-class>org.eclipse.stardust.engine.api.web.jsf.common.SessionContextListener</listener-class>
</listener>
with the following entry:
<listener>
<listener-class>org.eclipse.stardust.ui.web.common.listener.SessionContextListener</listener-class>
</listener>
With these entries, the exceptions mentioned above will be avoided, as
the servlet will be executed in the regular security context.
Jackrabbit Deployment
To prepare a Jackrabbit deployment, set the WebSphere custom property
com.ibm.ws.webcontainer.invokefilterscompatibility
in your to true, e.g. by performing the following steps:
- Expand Servers > Application Servers > <server> >
Web Container Settings > Web Container > Custom Properties.
- Select New and then enter com.ibm.ws.webcontainer.invokefilterscompatibility
as the property name and true as the value.
- Save the update and restart the server.
Include the jcr-2.0.jar in the server classpath.
Download the Jackrabbit rar file from
http://archive.apache.org/dist/jackrabbit/2.6.1/jackrabbit-jca-2.6.1.rar
and copy the file to your deploy folder.
Note:
For Websphere 7 and 8, once you download the jackrabbit-jca-2.6.1.rar file, remove the
org/w3c folder from xmlbeans-2.3.0.jar to have a proper classpath. This folder contains the
Java package org.w3c.dom, which is already included in the JRE.
Furthermore it is required to remove the geronimo-stax-api_1.0_spec-1.0.1.jar to make
Web services available.
To deploy the
resource archive, perform the following steps:
- Click Resources > Resource Adapters.
- Click Install RAR and select jackrabbit-jca-2.6.1.rar.
- Click Next and leave all the boxes empty on the next page. For Websphere 7 and 8, you need to
select the Isolate this resource provider checkbox.
- Click OK.
Note:
You can store the repository.xml file in the jackrabbit-jca-2.6.1.rar file. If you include it in the rar file, then
you must set the ConfigFile property to classpath:repository.xml.
Also, include users.properties and roles.properties within the rar file.
However, note that there are
many ways of packaging repository.xml.
In case an exception is thrown during those steps, then retry
with the following steps for Jackrabbit installation:
- Go back to Resources > Resource Adapters.
- Click New.
- Give your new resource a name (e.g. Jackrabbit JCR Adapter).
- Select jackrabbit-jca-2.6.1.rar from the archive path drop-down list.
- Click Apply.
Now continue:
- Scroll down and click J2C Connection Factories.
- Click New.
- Give your factory a name (e.g. JackrabbitConnectionFactory).
- Type the jndi name (e.g. jcr/jackrabbit).
- Use component-managed authentication alias. Please note that you
have to create it before with the credentials, which are identical to the
users.properties.
- Set mapping-configuration alias to DefaultPrincipalMapping.
- Click Apply.
- Scroll down and click Custom Properties.
- Set the values of HomeDir and ConfigFile (use
classpath:repository.xml) to appropriate values.
- Save your changes to the master configuration.
Note:
In case the current environment requires the Websphere
Deployment Manager (DMgr) on the same or separate server, the jcr-2.0.jar
file needs to be present in the Deployment Manager's classpath and target
server's classpath.
Setting the JCR Connection Factory
You need to verify the JCR connection factory settings.
- In the Resource Adapters, click Apache Jackrabbit JCR Adapter
- Click View Deployment Descriptor
- Check that XA Transaction is specified in <transaction-support>

- If not specified, you need to stop the server, edit the Deployment Descriptor and start the server again.
Jackrabbit Deployment on Oracle JRockit
Note that deployment on Oracle JRockit is not possible for Jackrabbit version prior to 2.0.
You need to use version 2.6.1.
Download
the Jackrabbit rar file from
http://archive.apache.org/dist/jackrabbit/2.6.1/jackrabbit-jca-2.6.1.rar.
To deploy, follow the steps provided in the section Jackrabbit Deployment.
But note that you need to include the jcr-2.0.jar in the server classpath instead of jcr-1.0.jar.
Setting up additional Jackrabbit VFS Repositories
To set up additional Jackrabbit VFS repositories in WebSphere, you need to
configure a new connection factory on the server using a different repository
home and JNDI name.
This resource can then be bound using the DocumentManagementService#bindRepository
API. Please refer to chapter
Managing Document Repositories
of the
Programming Guide for details.
Classloading for Portals and Engine Deployment
To make deployment possible for the Stardust Portals and the engine, some
classloading settings are necessary. The following example describes steps to enable the
deployment of the Stardust Portal. Note that the steps for the classloading settings
of other WAR files are similar. Perform the following steps:
- Go to Applications > Application Types > WebSphere enterprise
applications.
- In the Enterprise Applications section,
select carnot.ear:

- In Detail Properties click on
Class loading and updating detection.

- In the General Properties part:
- Specify the application class loader order: choose
Classes loaded with local classloader first (parent last).
- Specify the application War class loader policy:
choose Class loader for each WAR file in application.

- Select OK.
- Go back to Enterprise Applications > carnot.ear
and click Manage Modules in the Modules
part:

- In the Enterprise Applications > carnot.ear
> Manage Modules pane select SunGard CSA LLC -
Stardust Portal.

- In the Enterprise Applications > carnot.ear >
Manage Modules > ipp-portal.war section,
select Classes loaded with local class loader first (parent last)
as Class loader order:

Using Hazelcast on WebSphere 7
Hazelcast is a clustering and scalable data distribution platform.
For the second level caching functionality Stardust
leverages Hazelcast's distributed Map capabilities.
Please refer to
http://www.hazelcast.com/product.jsp
for detailed information on Hazelcast.
For details on tuning via an in-memory cache in Stardust refer to chapter
Retrieving Entities from In-Memory Cache in the
Developer Handbook.
Example Use Case - Hazelcast RAR inside EAR deployment
The in-memory cache is turned on by default with the property below in
your server-side carnot.properties file.
Infinity.Engine.Caching = true
If not, set this property explicitly.
To deploy the Hazelcast resource adapter inside your EAR,
perform the following steps:
- Download the hazelcast-2.4-stardust01.jar from the repository:
https://infinity.sungard.com/repository/ipp-3rd-party/com/hazelcast/hazelcast/2.4-stardust01/hazelcast-2.4-stardust01.jar
into the lib folder of your application server.
- Download the hazelcast-ra-2.4-stardust01.rar file from the repository:
https://infinity.sungard.com/repository/ipp-3rd-party/com/hazelcast/hazelcast-ra/2.4-stardust01/hazelcast-ra-2.4-stardust01.rar
- Put this RAR file into the root folder of your EAR.
- Adapt your EAR file in the following way:
- The following lines need to be added to the application.xml
of the EAR:
[...]
<application [...]>
[...]
<module>
<connector>hazelcast-ra-2.4-stardust01.rar</connector>
</module>
[...]
</application>
- Deploy your EAR
- The JNDI name of the Hazelcast resource adapter can be configured
afterwards under
Enterprise Applications > application name > Manage Modules > HazelcastRA > Resource Adapter > J2C connection factories
in the WebSphere Administration Console.
- Optional: Put an appropriate hazelcast.xml on the classpath of
your EAR (or a default configuration will be taken from com.hazelcast:hazelcast:2.4).
A default hazelcast.xml
can be found here: hazelcast.xml.