Thursday, 15 September 2016

IBM Operational Decision Manager - Running Decision Center on WebSphere Liberty Profile on Windows

This is yet another Work-In-Progress, and reflects my current obsession with WebSphere Liberty Profile: -


So today's challenge ( well, it was yesterday but that's not important right now ) was to coach a colleague to build out an IBM ODM Decision Center environment on Windows.

This is for a local development / test environment, rather than anything more "serious".

Thus I decided to see whether I could use WebSphere Liberty Profile and, whilst I was at it, use Apache Derby as a database, instead of my usual favourite, DB2.

The answer is …. "YES I CAN"

I downloaded Liberty from here: -


and Derby from here: -


having previously installed ODM Advanced 8.7: -

"c:\IBM\Installation Manager\eclipse\tools\imcl.exe" listInstalledPackages

com.ibm.cic.agent_1.8.5000.20160506_1125
com.ibm.websphere.odm.dc.v87_8.7.0.20141114_0935


using an IBM Installation Manager response file: -

installODM4WLP.rsp

<?xml version='1.0' encoding='UTF-8'?>
<agent-input>
  <server>
    <repository location='C:\temp\odm87\DEC_CENTER_WIN_32_64_BITS_V8.7_ML\DC' 
temporary='true'/>
  </server>
  <profile id='Operational Decision Manager V8.7' installLocation='C:\Program Files\IBM\ODM87'>
    <data key='cic.selector.arch' value='x86_64'/>
    <data key='user.lic.dc' value='full'/>
  </profile>
  <install>
    <!-- Decision Center 8.7.0.0 -->
    <offering profile='Operational Decision Manager V8.7' id='com.ibm.websphere.odm.dc.v87' version='8.7.0.20141114_0935' features='jdk,base,Rule Solutions for Office,com.ibm.wdc.rules.samples.feature,Documentation,com.ibm.wbdm.dts.wlp.feature'/>
  </install>
  <preference name='com.ibm.cic.common.core.preferences.eclipseCache' value='c:\IBM\IBMIMShared
'/>
</agent-input>

having previously installed IBM Installation Manager 1.8.5 : -

installIIM185Win.rsp

<?xml version='1.0' encoding='UTF-8'?>
<agent-input>
  <server>
    <repository location='c:\temp\iim\' temporary='true'/>
  </server>
  <profile id='IBM Installation Manager' installLocation='C:\IBM\Installation Manager\eclipse' kind='self'>
    <data key='eclipseLocation' value='C:\IBM\Installation Manager\eclipse'/>
    <data key='user.import.profile' value='false'/>
    <data key='cic.selector.nl' value='de,no,fi,ru,hr,fr,hu,sk,sl,sv,ko,el,en,pt_BR,it,iw,zh,es,cs,ar,zh_HK,zh_TW,th,ja,pl,da,tr,nl'/>
    <data key='cic.selector.os' value='win32'/>
    <data key='cic.selector.arch' value='x86_64'/>
    <data key='cic.selector.ws' value='win32'/>
  </profile>
  <install modify='false'>
    <offering profile='IBM Installation Manager' id='com.ibm.cic.agent' version='1.8.5000.20160506_1125' features='agent_core,agent_jre' installFixes='none'/>
  </install>
  <preference name='com.ibm.cic.common.core.preferences.connectTimeout' value='30'/>
  <preference name='com.ibm.cic.common.core.preferences.readTimeout' value='45'/>
  <preference name='com.ibm.cic.common.core.preferences.downloadAutoRetryCount' value='0'/>
  <preference name='offering.service.repositories.areUsed' value='true'/>
  <preference name='com.ibm.cic.common.core.preferences.ssl.nonsecureMode' value='false'/>
  <preference name='com.ibm.cic.common.core.preferences.http.disablePreemptiveAuthentication' value='false'/>
  <preference name='http.ntlm.auth.kind' value='NTLM'/>
  <preference name='http.ntlm.auth.enableIntegrated.win32' value='true'/>
  <preference name='com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts' value='true'/>
  <preference name='com.ibm.cic.common.core.preferences.keepFetchedFiles' value='false'/>
  <preference name='PassportAdvantageIsEnabled' value='false'/>
  <preference name='com.ibm.cic.common.core.preferences.searchForUpdates' value='false'/>
  <preference name='com.ibm.cic.agent.ui.displayInternalVersion' value='false'/>
  <preference name='com.ibm.cic.common.sharedUI.showErrorLog' value='true'/>
  <preference name='com.ibm.cic.common.sharedUI.showWarningLog' value='true'/>
  <preference name='com.ibm.cic.common.sharedUI.showNoteLog' value='true'/>
</agent-input>


Note that I specifically focused on the element of Decision Center that's focused upon WebSphere Liberty Profile, rather than the more widely used set of binaries for WebSphere Application Server Full Profile.

Specifically, I took two WAR files: -

14/09/2016  16:10        97,006,199 decisioncenter.war
14/09/2016  16:10       101,334,161 teamserver.war


and, having unpacked Liberty onto my Windows desktop - C:\Users\Administrator\Desktop - I copied  the DC JAR files into the apps folder of the defaultServer instance - C:\Users\Administrator\Desktop\wlp\usr\servers\defaultServer\apps.

I re-used the server.xml from the ODM on Liberty on Docker lab, edited for Decision Center only: -

<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">

<!-- Enable features -->
<featureManager>
<feature>servlet-3.1</feature>
<feature>jsp-2.3</feature>
<feature>jdbc-4.1</feature>
<feature>appSecurity-2.0</feature>
<feature>jaxrs-1.1</feature>
<feature>concurrent-1.0</feature>
<feature>jndi-1.0</feature>
<feature>ssl-1.0</feature>
</featureManager>

<httpSession cookieName="DCSESSIONID"
invalidateOnUnauthorizedSessionRequestException="true" />

<!-- To access this server from a remote client add a host attribute to 
the following element, e.g. host="*" -->
<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9080"
httpsPort="9443" />

<jdbcDriver id="DerbyEmbedded" libraryRef="DerbyLib" />
<library id="DerbyLib" filesetRef="DerbyFileset" />
<fileset id="DerbyFileset" dir="${shared.resource.dir}/derby"
includes="derby.jar" />

<!-- RTS data source -->
<dataSource id="derbyEmbedded" isolationLevel="TRANSACTION_READ_COMMITTED"
jndiName="jdbc/ilogDataSource" jdbcDriverRef="DerbyEmbedded">
<properties.derby.embedded databaseName="${shared.resource.dir}/data/rtsdb"
createDatabase="create" user="rtsdbUser" password="rtsdbUser" />
</dataSource>

<webContainer deferServletLoad="false"
enableDefaultIsElIgnoredInTag="true" enableJspMappingOverride="true" />

<!-- Web application security -->
<basicRegistry id="basic" realm="customRealm">

<!-- RTS users and groups -->
<user name="rtsAdmin" password="rtsAdmin" />
<user name="rtsConfig" password="rtsConfig" />
<user name="rtsUser1" password="rtsUser1" />
<user name="Eli" password="Eli" />
<user name="Val" password="Val" />
<group name="rtsAdministrator">
<member name="rtsAdmin" />
</group>
<group name="rtsInstaller">
<member name="rtsAdmin" />
</group>
<group name="rtsConfigManager">
<member name="rtsConfig" />
</group>
<group name="rtsUser">
<member name="rtsUser1" />
<member name="Eli" />
<member name="Val" />
</group>
<group name="Validator">
<member name="Val" />
</group>
<group name="Eligibility">
<member name="Eli" />
<member name="Val" />
</group>
</basicRegistry>

<!-- Decision Center -->
<application type="war" id="decisioncenter" name="decisioncenter"
location="${server.config.dir}/apps/decisioncenter.war">
<application-bnd>
<security-role name="rtsAdministrator">
<group name="rtsAdministrator" />
</security-role>
<security-role name="rtsInstaller">
<group name="rtsInstaller" />
</security-role>
<security-role name="rtsConfigManager">
<group name="rtsConfigManager" />
</security-role>
<security-role name="rtsUser">
<group name="rtsUser" />
</security-role>
<security-role name="Eligibility">
<group name="Eligibility" />
</security-role>
<security-role name="Validator">
<group name="Validator" />
</security-role>
</application-bnd>
</application>

<!-- Team Server -->
<application type="war" id="teamserver" name="teamserver"
location="${server.config.dir}/apps/teamserver.war">
<application-bnd>
<security-role name="rtsAdministrator">
<group name="rtsAdministrator" />
</security-role>
<security-role name="rtsInstaller">
<group name="rtsInstaller" />
</security-role>
<security-role name="rtsConfigManager">
<group name="rtsConfigManager" />
</security-role>
<security-role name="rtsUser">
<group name="rtsUser" />
</security-role>
<security-role name="Eligibility">
<group name="Eligibility" />
</security-role>
<security-role name="Validator">
<group name="Validator" />
</security-role>
</application-bnd>
</application>

<!-- Business console -->
<application type="war" id="decisioncenter" name="decisioncenter"
location="${server.config.dir}/apps/decisioncenter.war">
<classloader delegation="parentLast" />
...
</application>

<!-- Enterprise console -->
<application type="war" id="teamserver" name="teamserver"
location="${server.config.dir}/apps/teamserver.war">
<classloader delegation="parentLast" />
...
</application>

</server>

I then start the default server instance: -

c:\Users\Administrator\Desktop\wlp\bin\server start

Starting server defaultServer.
Server defaultServer started.


checked the logs: -

C:\Users\Administrator\Desktop\wlp\usr\servers\defaultServer\logs\console.log

Launching defaultServer (WebSphere Application Server 16.0.0.2/wlp-1.0.13.cl160220160526-2258) on Java HotSpot(TM) Client VM, version 1.8.0_91-b15 (en_GB)
[AUDIT   ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT   ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/16.0.0.2/lafiles/en.html
[ERROR   ] CWWKF0042E: A feature definition cannot  be found for the  concurrent-1.0 feature.  Try running the command, bin/installUtility install concurrent-1.0,  to install the feature. Alternatively, you can run the command, bin/installUtility install defaultServer,  to install all features that are referenced by this configuration.
[ERROR   ] CWWKF0042E: A feature definition cannot  be found for the  jaxrs-1.1 feature.  Try running the command, bin/installUtility install jaxrs-1.1,  to install the feature. Alternatively, you can run the command, bin/installUtility install defaultServer,  to install all features that are referenced by this configuration.
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications. 
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://w2k8.uk.ibm.com:9080/teamserver/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://w2k8.uk.ibm.com:9080/decisioncenter/
[WARNING ] Locale name in faces-config.xml null or empty, setting locale to default locale : en_GB
[AUDIT   ] CWWKZ0001I: Application teamserver started in 29.162 seconds.
[AUDIT   ] CWWKF0012I: The server installed the following features: [jsp-2.3, servlet-3.1, ssl-1.0, jndi-1.0, distributedMap-1.0, appSecurity-2.0, jdbc-4.1, el-3.0].
[AUDIT   ] CWWKF0011I: The server defaultServer is ready to run a smarter planet.
[WARNING ] [dc] Solr index directory 'c:\temp\solr.data3444738204048276327.dir\index' doesn't exist. Creating new index...
[AUDIT   ] CWWKZ0022W: Application decisioncenter has not started in 30.150 seconds.
[AUDIT   ] CWWKZ0001I: Application decisioncenter started in 33.371 seconds.
[WARNING ] The database does not contain a project. Import a project or contact your administrator.


C:\Users\Administrator\Desktop\wlp\usr\servers\defaultServer\logs\messages.log

********************************************************************************
product = WebSphere Application Server 16.0.0.2 (wlp-1.0.13.cl160220160526-2258)
wlp.install.dir = C:/Users/Administrator/Desktop/wlp/
java.home = C:\Program Files (x86)\Java\jre1.8.0_91
java.version = 1.8.0_91
java.runtime = Java(TM) SE Runtime Environment (1.8.0_91-b15)
os = Windows Server 2008 R2 (6.1; x86) (en_GB)
process = 2832@w2k8
...
[15/09/16 14:29:41:998 BST] 00000020 com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [decisioncenter] [/decisioncenter] [dispatcher]: Initialization successful.
[15/09/16 14:29:42:050 BST] 00000020 com.ibm.ws.app.manager.AppMessageHelper                      A CWWKZ0001I: Application decisioncenter started in 33.371 seconds.
[15/09/16 14:30:27:852 BST] 00000024 com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [teamserver] [/teamserver] [/login.jsp]: Initialization successful.
[15/09/16 14:31:12:299 BST] 00000034 com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [teamserver] [/teamserver] [/index.jsp]: Initialization successful.
[15/09/16 14:31:42:097 BST] 0000004f com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [decisioncenter] [/decisioncenter] [/WEB-INF/views/login.jsp]: Initialization successful.
[15/09/16 14:31:52:506 BST] 00000024 com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [teamserver] [/teamserver] [ConnectServlet]: Initialization successful.
[15/09/16 14:31:53:001 BST] 00000038 com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl              I CWRLS0010I: Performing recovery processing for local WebSphere server (defaultServer).
[15/09/16 14:31:53:044 BST] 00000038 com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl              I CWRLS0012I: All persistent services have been directed to perform recovery processing for this WebSphere server (defaultServer).
[15/09/16 14:31:53:067 BST] 00000038 com.ibm.ws.jca.cm.ConnectorService                           I J2CA8050I: An authentication alias should be used instead of defining a user name and password on dataSource[derbyEmbedded].
[15/09/16 14:31:53:168 BST] 00000052 com.ibm.tx.jta.impl.RecoveryManager                          I WTRN0135I: Transaction service recovering no transactions.
[15/09/16 14:31:54:386 BST] 00000038 com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper      I DSRA8203I: Database product name : Apache Derby
[15/09/16 14:31:54:390 BST] 00000038 com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper      I DSRA8204I: Database product version : 10.12.1.1 - (1704137)
[15/09/16 14:31:54:391 BST] 00000038 com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper      I DSRA8205I: JDBC driver name  : Apache Derby Embedded JDBC Driver
[15/09/16 14:31:54:391 BST] 00000038 com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper      I DSRA8206I: JDBC driver version  : 10.12.1.1 - (1704137)
[15/09/16 14:31:56:314 BST] 00000038 org.springframework.web.method.HandlerMethod                 W The database does not contain a project. Import a project or contact your administrator.
[15/09/16 14:31:56:441 BST] 00000038 com.ibm.ws.webcontainer.servlet                              I SRVE0242I: [decisioncenter] [/decisioncenter] [/WEB-INF/views/error.jsp]: Initialization successful.


and confirmed that I could log into Team Server and: -


and Decision Center: -

Now off to author some rules in Rule Designer and connect to Decision Center …..

No comments:

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...