Chapter 34. KIE Server ZIP file installation and configuration
You can install KIE Server using the rhdm-7.9.1-kie-server-jws.zip file available from the Red Hat Decision Manager 7.9.1 Add Ons (rhdm-7.9.1-add-ons.zip) file on the Customer Portal .
34.1. Installing KIE Server from ZIP files Copy linkLink copied to clipboard!
KIE Server provides the runtime environment for business assets and accesses the data stored in the assets repository (knowledge store). You can use ZIP files to install KIE Server on an existing Red Hat JBoss Web Server 5.3.0 server instance.
To use the installer JAR file to install KIE Server, see Chapter 33, Using the Red Hat Decision Manager installer.
-
The Red Hat Decision Manager 7.9.1 Add Ons (
rhdm-7.9.1-add-ons.zip) file has been downloaded, as described in Chapter 32, Downloading the Red Hat Decision Manager installation files. -
A backed-up Red Hat JBoss Web Server 5.3.0 server installation is available. The base directory of the Red Hat JBoss Web Server installation is referred to as
JWS_HOME. - Sufficient user permissions to complete the installation are granted.
Procedure
-
Unzip the
rhdm-7.9.1-add-ons.zipfile. From the unzipped
rhdm-7.9.1-add-ons.zipfile, extract the following files:-
rhdm-7.9.1-kie-server-jws.zip -
rhdm-7.9.1-decision-engine.zip
In the following instructions, the directory that contains the extracted
rhdm-7.9.1-kie-server-jws.zipfile is calledJWS_TEMP_DIRand the directory that contains the extractedrhdm-7.9.1-decision-engine.zipfile is calledENGINE_TEMP_DIR.-
Copy the
JWS_TEMP_DIR/rhdm-7.9.1-kie-server-jws/kie-server.wardirectory to theJWS_HOME/tomcat/webappsdirectory.NoteEnsure the names of the Red Hat Decision Manager deployments you copy do not conflict with your existing deployments in the Red Hat JBoss Web Server instance.
-
Remove the
.warextensions from thekie-server.warfolder. -
Move the
kie-tomcat-integration-7.44.0.Final-redhat-00006.jarfile from theENGINE_TEMP_DIRdirectory to theJWS_HOME/tomcat/libdirectory. -
Move the
jboss-jacc-api-<VERSION>.jar,slf4j-api-<VERSION>.jar, andslf4j-jdk14-<VERSION>.jarfiles from theENGINE_TEMP_DIR/libdirectory to theJWS_HOME/tomcat/libdirectory, where<VERSION>is the version artifact file name, in thelibdirectory. Add the following line to the
<host>element in theJWS_HOME/tomcat/conf/server.xmlfile after the last Valve definition:<Valve className="org.kie.integration.tomcat.JACCValve" />
<Valve className="org.kie.integration.tomcat.JACCValve" />Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Open the
JWS_HOME/tomcat/conf/tomcat-users.xmlfile in a text editor. Add users and roles to the
JWS_HOME/tomcat/conf/tomcat-users.xmlfile. In the following example,<ROLE_NAME>is a role supported by Red Hat Decision Manager.<USER_NAME>and<USER_PWD>are the user name and password of your choice:<role rolename="<ROLE_NAME>"/> <user username="<USER_NAME>" password="<USER_PWD>" roles="<ROLE_NAME>"/>
<role rolename="<ROLE_NAME>"/> <user username="<USER_NAME>" password="<USER_PWD>" roles="<ROLE_NAME>"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow If a user has more than one role, as shown in the following example, separate the roles with a comma:
<role rolename="admin"/> <role rolename="kie-server"/> <user username="rhdmUser" password="user1234" roles="admin,kie-server"/>
<role rolename="admin"/> <role rolename="kie-server"/> <user username="rhdmUser" password="user1234" roles="admin,kie-server"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Complete one of the following steps in the
JWS_HOME/tomcat/bindirectory:On Linux or UNIX, create the
setenv.shfile with the following content:CATALINA_OPTS="-Xmx1024m -Dorg.jboss.logging.provider=jdk -Dorg.jbpm.server.ext.disabled=true -Dorg.jbpm.ui.server.ext.disabled=true -Dorg.jbpm.case.server.ext.disabled=true"
CATALINA_OPTS="-Xmx1024m -Dorg.jboss.logging.provider=jdk -Dorg.jbpm.server.ext.disabled=true -Dorg.jbpm.ui.server.ext.disabled=true -Dorg.jbpm.case.server.ext.disabled=true"Copy to Clipboard Copied! Toggle word wrap Toggle overflow On Windows, add the following content to the
setenv.batfile:set CATALINA_OPTS="-Xmx1024m -Dorg.jboss.logging.provider=jdk -Dorg.jbpm.server.ext.disabled=true -Dorg.jbpm.ui.server.ext.disabled=true -Dorg.jbpm.case.server.ext.disabled=true
set CATALINA_OPTS="-Xmx1024m -Dorg.jboss.logging.provider=jdk -Dorg.jbpm.server.ext.disabled=true -Dorg.jbpm.ui.server.ext.disabled=true -Dorg.jbpm.case.server.ext.disabled=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow
34.2. Configuring JDBC Web Server data sources Copy linkLink copied to clipboard!
Java Database Connectivity (JDBC) is an API specification that is used to connect programs written in Java to the data in popular databases. A data source is an object that enables a JDBC client, such as an application server, to establish a connection with a database. Applications look up the data source on the Java Naming and Directory Interface (JNDI) tree or in the local application context and request a database connection to retrieve data. You must configure data sources for KIE Server to ensure proper data exchange between the servers and the designated database.
Prerequisites
- Red Hat Decision Manager is installed on Red Hat JBoss Web Server.
-
The Red Hat Decision Manager 7.9.x Maven Repository (
rhdm-7.9.1-maven-repository.zip) and the Red Hat Decision Manager 7.9.x Add-Ons (rhdm-7.9.1-add-ons.zip) files have been downloaded, as described in Chapter 32, Downloading the Red Hat Decision Manager installation files. You want to configure one of the following supported databases and Hibernate dialects:
-
DB2:
org.hibernate.dialect.DB2Dialect -
MSSQL:
org.hibernate.dialect.SQLServer2012Dialect -
MySQL:
org.hibernate.dialect.MySQL5InnoDBDialect -
MariaDB:
org.hibernate.dialect.MySQL5InnoDBDialect -
Oracle:
org.hibernate.dialect.Oracle10gDialect -
PostgreSQL:
org.hibernate.dialect.PostgreSQL82Dialect -
PostgreSQL plus:
org.hibernate.dialect.PostgresPlusDialect -
Sybase:
org.hibernate.dialect.SybaseASE157Dialect
-
DB2:
Procedure
Complete the following steps to prepare your database:
-
Extract
rhdm-7.9.1-add-ons.zipin a temporary directory, for exampleTEMP_DIR. -
Extract
TEMP_DIR/rhdm-7.9.1-migration-tool.zip. -
Change your current directory to the
TEMP_DIR/rhdm-7.9.1-migration-tool/ddl-scriptsdirectory. This directory contains DDL scripts for several database types. Import the DDL script for your database type into the database that you want to use, for example:
psql jbpm < /ddl-scripts/postgresql/postgresql-jbpm-schema.sql
psql jbpm < /ddl-scripts/postgresql/postgresql-jbpm-schema.sqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you are using PostgreSQL or Oracle in conjunction with Spring Boot, you must import the respective Spring Boot DDL script, for example
/ddl-scripts/oracle/oracle-springboot-jbpm-schema.sqlor/ddl-scripts/postgresql/postgresql-springboot-jbpm-schema.sql.
-
Extract
-
Extract the
rhdm-7.9.1-maven-repository.zipoffline Maven repository file. Copy the following libraries from the extracted offline Maven repository to the
JWS_HOME/tomcat/libfolder whereVERSIONis the version of that library:org/jboss/spec/javax/transaction/jboss-transaction-api_1.2_spec/{VERSION}/jboss-transaction-api_1.2_spec-{VERSION}.jar org/jboss/integration/narayana-tomcat/{VERSION}/narayana-tomcat-{VERSION}.jar org/jboss/narayana/jta/narayana-jta/{VERSION}/narayana-jta-{VERSION}.jar org/jboss/jboss-transaction-spi/{VERSION}/jboss-transaction-spi-{VERSION}.jarorg/jboss/spec/javax/transaction/jboss-transaction-api_1.2_spec/{VERSION}/jboss-transaction-api_1.2_spec-{VERSION}.jar org/jboss/integration/narayana-tomcat/{VERSION}/narayana-tomcat-{VERSION}.jar org/jboss/narayana/jta/narayana-jta/{VERSION}/narayana-jta-{VERSION}.jar org/jboss/jboss-transaction-spi/{VERSION}/jboss-transaction-spi-{VERSION}.jarCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Copy your database JDBC driver to the
JWS_HOME/tomcat/libfolder. Configure the pooling XA data source in the
JWS_HOME/tomcat/conf/context.xmlfile:NoteSome of the properties in the following examples might not apply to your database server. Check the documentation for your JDBC driver to determine which properties to set.
Configure an XA data source without pooling capabilities. This XA data source is used to create new connections to the target database. In the following example, the XA datasource is
xadsand the variables are defined in Table 34.1, “XA data source variables”:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Expand Table 34.1. XA data source variables Variable Description <datasource.dbName>The name of the database.
<datasource.port>The port number of the database.
<datasource.hostname>The name of the database host.
<datasource.class>XADataSourceclass of JDBC driver.<datasource.url>The JDBC database connection URL. With some databases, the URL property is
urland with other databases (for example H2 databases) this property isURL.<datasource.username>User name for the database connection.
<datasource.password>Password for the database connection.
<datasource.schema>The database schema.
Configure a pooling data source that relies on the XA data source for creating new connections. In this example, the data source is
poolingXaDs,<datasource.username>is the user name for the database connection, and<datasource.password>is the password for the database connection:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The data source is now available under the
java:comp/env/poolingXaDsJNDI name and passes it to the KIE Server through theorg.kie.server.persistence.dssystem property as described in the next steps.NoteThe pooling data source configuration relies on additional resources that have been previously configured in
context.xmlfile inkie-serverapplication, specificallyTransactionManagerandTransactionSynchronizationRegistry.
Configure KIE Server to use the data source:
Open one of the following scripts in a text editor:
NoteThe
setenv.shorsetenv.batscript should already exist. However, if it does not, create it.For Linux or Unix:
JWS_HOME/tomcat/bin/setenv.sh
JWS_HOME/tomcat/bin/setenv.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Windows:
JWS_HOME/tomcat/bin/setenv.bat
JWS_HOME/tomcat/bin/setenv.batCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Add the following properties to
CATALINA_OPSwhere<hibernate.dialect>is the Hibernate dialect for your database:CATALINA_OPTS="-Xmx1024m -Dorg.jboss.logging.provider=jdk -Dorg.kie.server.persistence.ds=java:comp/env/poolingXaDs -Dorg.kie.server.persistence.tm=JBossTS -Dorg.kie.server.persistence.dialect=${<hibernate.dialect>}"CATALINA_OPTS="-Xmx1024m -Dorg.jboss.logging.provider=jdk -Dorg.kie.server.persistence.ds=java:comp/env/poolingXaDs -Dorg.kie.server.persistence.tm=JBossTS -Dorg.kie.server.persistence.dialect=${<hibernate.dialect>}"Copy to Clipboard Copied! Toggle word wrap Toggle overflow