To set up LSPS on IBM WebSphere Application Server, do the following:
- Ensure JPA2 is supported on app server (Feature Pack for OSGi Applications and JPA 2.0 is installed).
- Install WebSphere.
Create JDBC provider and JDBC XA data source with JNDI name jdbc/LSPS_DS and transaction isolation read-committed.
Example configuration for a DB2 database installed on localhost
- Go to security/Global Security/Java Authentication and Authorization Service/J2C authentication data and create new entry:
Alias: LSPS_DS_AUTH
User ID: db2admin
Password: db2admin
- Go to Resources/JDBC/JDBC providers and create JDBC provider:
DatabaseType: DB2
Provider type: DB2 Universal JDBC driver provider
Implementation type: XA Datasource
Name: DB2 Universal JDBC Driver Provider (XA) - default name
Look at classpath:
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc4.jar
${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cisuz.jar
Make sure the WAS variable DB2UNIVERSAL_JDBC_DRIVER_PATH is set correctly.
- Go to Resources/JDBC/Data sources:
- Create the JDBC data source:
Data source name: LSPS_DS
JNDI name: jdbc/LSPS_DS
JDBC provider: DB2 Universal JDBC driver provider
Driver type: 4
Database name: LSPS
Server name: localhost
Port number: 50000
Use this data source in container managed persistence (CMP): true
Authentication alias for XA recovery: LSPS_DS_AUTH
Component-managed authentication alias: LSPS_DS_AUTH
- Add custom properties:
- Test the connection.
Create a JMS queue with the JNDI name jms/LSPS_QUEUE, JMS queue connection factory with the JNDI name jms/LSPS_CF, and the corresponding JMS activation specifications with the JNDI names jms/LSPS_AS and jms/LSPS_WS_AS.
Example configuration using the default messaging provider and LSPS database to store messages
- Go to Service Integration/Buses:
- Create a new bus:
Name: LSPS_BUS
Security: NO
- In LSPS_BUS detail page, click Bus members link and create a bus member:
Server: default value
Message store: Data store
Use existing data source
Data source JNDI name: jdbc/LSPS_DS
Schema name: empty
Authentication alias: LSPS_DS_AUTH
- In LSPS_BUS detail page, click Destinations link and create the following destinations:
- queue:
Destination type: QUEUE
Identifier: LSPS_DEST
Bus member: Your local server node
- topic:
Destination type: TOPIC SPACE
Identifier: LSPS_TOPIC
Bus member: Your local server node
- Go to Resources/JMS/Connection Factories and create a connection factory:
Provider: Default messaging provider
Name: LSPS_CF
JNDI Name: jms/LSPS_CF
BUS Name: LSPS_BUS
- Go to Resources/JMS/Queues and create a queue:
Name: LSPS_QUEUE
JNDI Name: jms/LSPS_QUEUE
Bus name: LSPS_BUS
Queue name: LSPS_DEST
- Go to Resources/JMS/Topics and create a topic:
Name: LSPS_TOPIC
JNDI Name: jms/LSPS_TOPIC
Bus name: LSPS_BUS
Queue name: LSPS_TOPIC
- Go to Resources/JMS/Activation specifications and create activation specifications:
Name: LSPS_AS
JNDI Name: jms/LSPS_AS
Destination type: Queue
BUS_NAME: LSPS_BUS
Destination JNDI name: jms/LSPS_QUEUE
Name: LSPS_WS_AS
JNDI Name: jms/LSPS_WS_AS
Destination type: Topic
BUS_NAME: LSPS_BUS
Destination JNDI name: jms/LSPS_TOPIC
- Turn on and set up security. This step is required only if you want to use LSPS custom authentication. You can also use your own authentication, such as, LDAP.
- Copy lsps-security-websphere-$LSPS_VERSION.jar to $WAS_HOME/lib/ext and restart WebSphere.
- Go to Security/Global Security:
- Enable administrative security: true
- Enable application security: true
- Go to Security/Global Security and configure User account repository:
- Choose Standalone custom registry and click Set as current
- Click Configure:
- Primary administrative user name: admin
- Custom registry class name: com.whitestein.lsps.security.LSPSUserRegistry
- Create mail session with JNDI name mail/LSPS_MAIL
- Go to Resources/Mail/Mail Sessions and create mail session:
Name: LSPS_MAIL
JNDI Name: mail/LSPS_MAIL
Outgoing Mail Properties/Server: <your mail server>
Outgoing Mail Properties/Protocol: smtp/smtps
Outgoing Mail Properties/User: <username>
Outgoing Mail Properties/Password: <password>
Outgoing Mail Properties/Verify Password: <password>
Outgoing Mail Properties/Return e-mail address: <return e-mail address>
Deploy JSF 2.0 and define it in shared libraries (although WAS 8.5 contains JSF 2.0 implementation - MyFaces - for the selenium tests to work correctly, Mojarra implementation is required).
- Go to Environment/Shared libraries and add a shared library for JSF 2.0 (API and implementation JARs are needed). Provide class path according to their location.
- Select the isolated class loader option.
The LSPS application deployment then needs a shared library reference to JSF 2.0 shared library definition created above.
- Set org.apache.el.parser.COERCE_TO_ZERO property to false:
- Go to Servers/Server types/WebSphere application servers
- Select your server.
- Go to Java and Process Management/Process definition/Java Virtual Machine/Custom properties and define the property org.apache.el.parser.COERCE_TO_ZERO with the value false.
- Restart server.
- Deploy the application lsps-application-$LSPS_VERSION.ear to WebSphere.
- Open your browser and browse to url http://localhost:9081/lsps-application, user: admin, password: admin.
Memory Settings
- Minimum: -Xmx512m -XX:PermSize=128m (Usually satisfied by default application server settings)
- Optimum: -Xmx1024m -XX:PermSize=256m
The amount of memory required might increase depending on uploaded and used lsps modules.