Appendix A - Deployment in IBM WebSphere Liberty Application server

Appendix A - Deployment in IBM WebSphere Liberty Application server

Required knowledge #

This is not an introduction to IBM WebSphere Liberty administration, the user must as a minimum know how to:

  • Open and log into the Admin Center.
  • Create a JDBC data source and install JDBC drivers
  • Create JDBC login credentials
  • Install an Enterprise Application

Refer to official IBM WebSphere Liberty documentation and support for assistance.

WAS Liberty Memory Parameters #

Default JVM memory parameters must be changed. This can be done by creating a file named jvm.options in the following directory:
<installation folder of WebSphere Liberty>/usr/servers/<profile name>/

Content of file jvm.options:

-Xmx1024m 
-Xms1024m

Drop Zone installation #

IBM WebSphere Liberty support “Drop Zone” deployment of web applications. When a Drop Zone is configured in WebSphere Liberty, WAR files dropped in a specified folder will be automatically picked up and deployed. This deployment method is ONLY recommended to use when the WAR file to be installed is ready to go live (not requiring any modifications).

“Exploded” WAR file installation #

If you need to change configurations (in web.xml, etc.), the preferred way of deployment is to install the WAR file in “exploded” mode (unpacked) under <Liberty server profile root>/apps/

Note:
To unpack a WAR file the following command can be used:

jar xvf <WAR-filename>

After extraction, the root folder (which can be installed as an application on WebSphere Liberty) is the one that contains the WEB-INF folder as a direct subfolder.

The WebSphere Liberty Admin Center web application allows easy modification of the profile’s configuration file, server.xml. Select Configure from the Admin Center’s left menu bar.

When a web application is deployed manually (non-drop zone), please add the following configuration line in server.xml:

<WebApplication location="<name-of-war file_or_exploded-root-folder>"/>

For example, if the name of the exploded root folder is SicsServer, the configuration line would be like this:

<WebApplication location="SicsServer"/>
  • Carry out the configuration steps described in section 7 “Configure the SICS API Server environment”. Modifications to web.xml and other files must be carried out in the SicsServer.war file directly. All file path references in the instructions should therefore be read as the files within SicsServer.war.
  • Log in to the WebSphere Liberty Admin Center, and go to Configure server.xml.
  • Create a JDBC datasource for SICS, including JDBC provider if required.
  • Example setup for Oracle:
<dataSource id="sics_oracle" jndiName="jdbc/sics" type="javax.sql.DataSource">
   <jdbcDriver libraryRef="ojdbc_lib"/>
   <properties.oracle URL="jdbc:oracle:thin:@<DATABASE_SERVER_HOST>:1521:<DATABASE>" user="<USERNAME>" password="<PASSWORD>" />
</dataSource>
<library id="ojdbc_lib">
   <fileset dir="${shared.resource.dir}/database_drivers/oracle" includes="ojdbc*.jar"/>
</library>

This sample setup, require Oracle database drivers to be installed at:
${shared.resource.dir}/database_drivers/oracle

  • Install SicsServer.war as an exploded WAR file; make sure to set up the resource reference for the JDBC data source. Or, if the WAR file is pre-configured, it can be dropped directly into drop zone area.
  • Start the Application

After SICS API Server is started, carry out the verification steps described in section “Verify Correct Startup of SICS API Server”.

NB:
If the entry for JNDI in sics-database-sources.xml is set up to use parameterized SQL then statement cache size should be set to 0. Statement cache size should instead be set up in WebSphere. Furthermore if the data source is an Oracle data source in combination with parameterized SQL, then the custom property, connectionProperties must be added and set to fixedString=true, for the Oracle data source.

Deploy Procedure with Application Managed Database Connection #

  • Carry out the configuration steps described in section 7 “Configure the SICS API Server environment” and 10.1 “Application managed database connection”. The JDBC driver jars and modifications should be added/updated directly in SicsServer.war. All file path references in the instructions should therefore be read as the files within SicsServer.war.
  • Log in to the WebSphere Integrated Solutions Console
  • Install SicsServer.war as an exploded application. Or, if the WAR file is pre-configured, it can be dropped directly into drop zone area.
  • Start the Application

After SICS API Server is started, carry out the verification steps described in section “Verify Correct Startup of SICS API Server”.