4.6.1 Deploying the Connect UI in WildFly 21

Note: These instructions assume that you are using Connect's default encryption in crypto.properties. WildFly 21 and Connect 10r57 require the use of Java 8.

$WILDFLY_HOME = \opt\wildfly-21.0.0.Final
$CONNECT_HOME = \opt\connect.install\kc
$JAVA_HOME = \opt\connect.install\java\nt

Download WildFly 21 here and unzip.

Prepare connect_auth_jboss.jar

Add connect_auth_jboss.war to brickst.war

mkdir -p WEB-INF/lib
cp webinstall/connect_auth_jboss.jar WEB-INF/lib
zip brickst.war WEB-INF/lib/connect_auth_jboss.jar

Note: Previous Connect versions installed the auth jar as a Wildfly module but this does not work anymore.

Install JDBC Driver

The correct JDBC driver needs to be added to the Wildfly configuration as a new module. In general you create a module by creating a directory under $WILDFLY_HOME/modules, copying the appropriate jar files to this directory, and creating a module.xml file that describes the module to Wildfly.

Installing Oracle JDBC Driver

  1. Create directory $WILDFLY_HOME\modules\system\layers\base\com\oracle\ojdbc8\main

  2. Copy ojdbc8-19.3.0.0.jar and orai18n-19.3.0.0.jar from $KCHOME\import to $WILDFLY_HOME\modules\system\layers\base\com\oracle\ojdbc8\main.

  3. Create a file named module.xml in this directory with the following structure:

    <?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.1" name="com.oracle.ojdbc8">
    <resources>
    <resource-root path="ojdbc8-19.3.0.0.jar"/>
    <resource-root path="orai18n-19.3.0.0.jar"/>
    </resources>
    <dependencies>
    <module name="javax.api"/>
    </dependencies>
    </module>

Installing MySQL JDBC Driver

  1. Create directory $WILDFLY_HOME\modules\system\layers\base\com\mysql\main

  2. Copy mysql-connector-java-8.0.26.jar from $KCHOME\import to $WILDFLY_HOME\modules\system\layers\base\com\mysql\main.

  3. Create a file named module.xml in this directory with the following structure:

    <module xmlns="urn:jboss:module:1.5" name="com.mysql">
    <resources>
    <resource-root path="mysql-connector-java-8.0.26.jar" />
    </resources>
    <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
    </dependencies>
    </module>

Installing MSSQL JDBC Driver

  1. Create directory $WILDFLY_HOME\modules\system\layers\base\com\mssql\main

  2. Copy mysql-connector-java-8.0.19.jar from $KCHOME\import to $WILDFLY_HOME\modules\system\layers\base\com\mssql\main.

  3. Create a file named module.xml in this directory with the following structure:

    <module xmlns="urn:jboss:module:1.5" name="com.mssql">
    <resources>
    <resource-root path="mssql-jdbc-8.2.2.jre8.jar" />
    </resources>
    <dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
    </dependencies>
    </module>


Create Data Source Definition for Connect UI

Once the JDBC driver module is defined, the next step is to define a J2EE data source that will be used by the Connect UI. In WildFly 21, data sources are defined in the $WILDFLY_HOME\standalone\configuration\standalone.xml file.

This file will contain a subsystem element that looks like this:

<subsystem xmlns="urn:jboss:domain:datasources:6.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>

You will define a new datasource element and a new driver element for the Connect UI data source. Each data source has a minimum and maximum size setting for the connection pool. For the minimum, we recommend one connection per concurrent user. For maximum, we recommend three or more connections per concurrent user.

Configure Oracle Data Source in WildFly 21

For Oracle, add the following datasource element:

<datasource jndi-name="java:/jdbc/BRICK_STREET_SOFTWARE_CONNECT_DS" pool-name="BRICK_STREET_SOFTWARE_CONNECT_DS" enabled="true">
<connection-url>jdbc:oracle:thin:@SERVER_NAME:1521:ORCL</connection-url>
<driver>oracle</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>USERNAME</user-name>
<password>PASSWORD</password>
</security>
</datasource>

Note: You can also use ENV variables:

<datasource jndi-name="java:/jdbc/BRICK_STREET_SOFTWARE_CONNECT_DS" pool-name="BRICK_STREET_SOFTWARE_CONNECT_DS" enabled="true">
<connection-url>${env.BRICKST_JDBC_URL}</connection-url>
<driver>oracle</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>${env.BRICKST_JDBC_USER}</user-name>
<password>${env.BRICKST_JDBC_PASS}</password>
</security>
</datasource>

Below the new <datasource> element and in the <drivers> element, add the following Oracle Driver element:

<driver name="oracle" module="com.oracle.ojdbc8">
<driver-class>oracle.jdbc.OracleDriver</driver-class>
</driver>


Configure MSSQL Data Source in WildFly 21

For Microsoft SQL Server, add the following datasource element:

<datasource jndi-name="java:/jdbc/BRICK_STREET_SOFTWARE_CONNECT_DS" pool-name="BRICK_STREET_SOFTWARE_CONNECT_DS" enabled="true">
<connection-url>jdbc:sqlserver://SERVER:1433;database=connect10</connection-url>
<driver>mssql</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>USERNAME</user-name>
<password>PASSWORD</password>
</security>
</datasource>

In the drivers element, define:

<driver name="mssql" module="com.mssql">
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
</driver>


Configure MYSQL Data Source in WildFly 21

For MySQL, add the following datasource element:

<datasource jndi-name="java:/jdbc/BRICK_STREET_SOFTWARE_CONNECT_DS" pool-name="BRICK_STREET_SOFTWARE_CONNECT_DS" enabled="true">
<connection-url>jdbc:mysql://SERVER:3306/connect10r571</connection-url>
<driver>mysql</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>USERNAME</user-name>
<password>PASSWORD</password>
</security>
</datasource>

In the drivers element, define:

<driver name="mysql" module="com.mysql">
<driver-class>com.mysql.jdbc.Driver</driver-class>
</driver>

Add Legacy Login Module to standalone.xml

The old Jboss Login Module is what Wildfly calls a Legacy Security Domain.

  1. Locate the file $WILDFLY_HOME\standalone\configuration\standalone.xml.

  2. Locate the following subsystem element:

    <subsystem xmlns="urn:jboss:domain:security:2.0">
    <security-domains>
  3. Add this security-domain:

    <security-domain name="connect-auth" cache-type="default">
    <authentication>
    <login-module code="com.kana.connect.auth.jboss.ConnectLoginModule" flag="required"/>
    </authentication>
    </security-domain>
  4. Add this elytron-integration element after the security-domains element. Place it before the end of the subsystem </subsystem>.

    <elytron-integration>
    <security-realms>
    <elytron-realm name="connect-auth" legacy-jaas-config="connect-auth"/>
    </security-realms>
    </elytron-integration>

Add Elytron Security Domain to standalone.xml

  1. Locate the file $WILDFLY_HOME\standalone\configuration\standalone.xml.

  2. Locate the following subsystem element:

    <subsystem xmlns="urn:wildfly:elytron:11.0" final-providers="combined-providers" disallowed-providers="OracleUcrypto">
  3. In the security-domains element, add this security-domain:

    <security-domain name="connect-auth" default-realm="connect-auth" permission-mapper="default-permission-mapper">
    <realm name="connect-auth" role-mapper="connect-auth-role-mapper"/>
    </security-domain>
  4. In the mappers element, add this add-prefix-role-mapper:

    <add-prefix-role-mapper name="connect-auth-role-mapper" prefix="ROLE_"/>
  5. In the http element, add the following http-authentication-factory element:

    <http-authentication-factory name="connect-auth-http" security-domain="connect-auth" http-server-mechanism-factory="global">
    <mechanism-configuration>
    <mechanism mechanism-name="FORM"/>
    </mechanism-configuration>
    </http-authentication-factory>

Add undertow application-security-domain to standalone.xml

  1. Locate the following subsystem:

  2. Add this application-security-domain:

    <application-security-domains>
    <application-security-domain name="connect-auth" http-authentication-factory="connect-auth-http"/>
    </application-security-domains>

    Note: It should come at the end of the subsystem element.

Deploy brickst.war to the WildFly 21 Server
To deploy the Connect UI:

  1. Copy brickst.war from $CONNECT_HOME\kc to the WildFly deployment directory $WILDFLY_HOME\standalone\deployments.

Running WildFly 21

  1. Run WildFly by executing the standalone.sh script located in $WILDFLY_HOME\bin.

    This will run WildFly 21 but will bind to 127.0.0.1 only. You can now access the UI in your browser by visiting the following URL http://localhost:8080/brickst.

  2. To bind WildFly 21 to all available network addresses run standalone.sh -b 0.0.0.0 .

    Now you can access the UI from local and remote clients.

  3. You can change standalone.xml to force WildFly 21 to always bind to all network addresses. In standalone.xml there is an element that looks like the following:

    <interface name="public">
    <inet-address value="${jboss.bind.address:127.0.0.1}"/>
    </interface>

    Replace 127.0.0.1 with 0.0.0.0 and restart WildFly.

Alternative: installWildfly.sh script

You can use the installWildfly script located in kc/webinstall/wildfly/:

./webinstall/wildfly/installWildfly.sh $kchome $wildfly_home $dbtype

Example:

./webinstall/wildfly/installWildfly.sh /opt/brickst/kc /opt/jboss/wildfly oracle

This script will perform the steps described above. There are XSLT files in kc/webinstall/wildfly/modules that will update the standalone.xml file automatically


Installing WildFly 21 as a RedHat/Centos Service

  1. Copy the file wildfly-init-redhat.sh from $WILDFLY_HOME/docs/contrib/scripts/init.d to /etc/init.d

    • cp wildfly-init-redhat.sh /etc/init.d/wildfly

  2. Create a new directory in /etc called wildfly

    • mkdir /etc/wildfly

  3. Copy the file wildfly.conf from $WILDFLY_HOME/docs/contrib/scripts/ to /etc/wildfly

  4. Edit wildfly.conf and uncomment and populate the following lines.

    • JAVA_HOME = $JAVA_HOME (replace with proper java home)

    • JBOSS_USER = brickst_usr (replace with the user you wish to run WildFly with)

    • JBOSS_HOME = $WILDFLY_HOME (replace with the WildFly_Home path)

    • JBOSS_MODE = standalone

    • JBOSS_CONFIG = standalone.xml

    • JBOSS_OPTS = "-b 0.0.0.0" (to bind to all network adapters)

Troubleshooting

Logging:

  • WildFly logging is located in: $WILDFLY_HOME\standalone\log

  • Connect logging is located in: $WILDFLY_HOME\bin\logs\Connect-UI.log

Error:

  • JBAS015052: Did not receive a response to the deployment operation within the allowed timeout periodSolution: WildFly 21 expects brickst.war to be deployed within 60 seconds. If the deployment does not succeed, WildFly assumes the deployment has failed and terminates the deployment. If you see the following message in the WildFly log, you need to increase the deployment timeout.

    1. ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period [60 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment.

    2. To increase the timeout, edit this entry in the standalone.xml file:

      <subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
      <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
      </subsystem>

    3. Add a deployment-timeout attribute to the deployment-scanner element. The attribute controls how many seconds WildFly will wait for the deployment operation to complete. The default value is 60. Increase this value until WildFly has sufficient time to deploy the Connect UI.