Steven Falzon
Steven Falzon

Reputation: 77

Add external jgroups module to Wildfly (native-s3-ping)

I have set up a wildfly cluster with a sample web app (ClusterBench) using S3_PING protocol which works fine. However, now I am trying to configure NATIVE_S3_PING, which should eventually replace S3_PING (and allows the use of AWS IAM roles to control access).

I am fairly new to Wildfly, and I can't find any good documentation to explain how I can import this module.

I've downloaded the required JARs, and placed them in:

/modules/system/layers/base/org/jgroups/aws/main

and created module.xml containing:

<?xml version="1.0" encoding="UTF-8"?>
<module name="org.jgroups.aws.s3" xmlns="urn:jboss:module:1.7">

<resources>
    <resource-root path="native-s3-ping-1.0.0.Final.jar"/>
</resources>

<dependencies>
    <module name="javax.api"/>
    <module name="org.jgroups"/>
</dependencies>

However, when I try to start the server, I am getting a few errors such as:

2020-11-25 03:29:15,947 WARN  [org.jboss.modules.define] (ServerService Thread Pool -- 3) Failed to define class org.jgroups.logging.CustomLogFactory in Module "org.jgroups" version 4.2.4.Final from local module loader @490ab905 (finder: local module finder @56ac3a89 (roots: /home/oracle/wildfly/modules,/home/oracle/wildfly/modules/system/layers/base)): org.jboss.modules.ModuleLoadError: org.jgroups.aws.s3

This causes Jgroups to fail to parse the config and fail to start, meaning the server fails to start.

What is the correct process to integrate this (and any other) external Jgroups modules into Wildfly?

EDIT: Found some documentation here, which indicates a method to add custom modules. Tried this:

module add --name=org.jgroups.aws.s3 --resource-delimiter=, --resources=native-s3-ping-0.9.6.Final.jar,joda-time-2.8.1.jar,jmespath-java-1.11.368.jar,jgroups-4.1.8.Final.jar,jackson-dataformat-cbor-2.6.7.jar,jackson-databind-2.6.7.1.jar,jackson-core-2.6.7.jar,jackson-annotations-2.6.0.jar,ion-java-1.0.2.jar,httpcore-4.4.9.jar,httpclient-4.5.5.jar,commons-logging-1.1.3.jar,commons-codec-1.10.jar,aws-java-sdk-s3-1.11.368.jar,aws-java-sdk-kms-1.11.368.jar,aws-java-sdk-core-1.11.368.jar --dependencies=javax.api,org.jgroups

However, still getting this error:

2020-11-25 05:15:58,773 WARN  [org.jboss.modules.define] (ServerService Thread Pool -- 3) Failed to define class org.jgroups.logging.CustomLogFactory in Module "org.jgroups" version 4.2.5.Final from local module loader @490ab905 (finder: local module finder @56ac3a89 (roots: /home/oracle/wildfly/modules,/home/oracle/wildfly/modules/system/layers/base)): org.jboss.modules.ModuleLoadError: Error loading module from /home/oracle/wildfly/modules/org/jgroups/aws/s3/main/module.xm

I've confirmed the class it is complaining about is in fact available...

Upvotes: 0

Views: 785

Answers (1)

Steven Falzon
Steven Falzon

Reputation: 77

Figured it out.

  1. Using the API, add the module. Ensure the jgroups jar is NOT included, as it will conflict.

     module add --name=org.jgroups.aws.s3 --resource-delimiter=, --resources=httpclient-4.5.9.jar,native-s3-ping-1.0.0.Final.jar,joda-time-2.8.1.jar,jmespath-java-1.11.708.jar,jackson-dataformat-cbor-2.6.7.jar,jackson-databind-2.6.7.3.jar,jackson-core-2.6.7.jar,jackson-annotations-2.6.0.jar,ion-java-1.0.2.jar,httpcore-4.4.11.jar,commons-logging-1.1.3.jar,commons-codec-1.11.jar,aws-java-sdk-s3-1.11.708.jar,aws-java-sdk-kms-1.11.708.jar,aws-java-sdk-core-1.11.708.jar --dependencies=javax.api,org.jgroups
    
  2. In the Wildfly standalone-config.xml, ensure protocol type is correctly defined. E.g. in this case so it can find the custom protocol.

      <stack name="s3ping">
                     <transport type="TCP" socket-binding="jgroups-tcp"/>
                     <protocol type="org.jgroups.aws.s3.NATIVE_S3_PING" module="org.jgroups.aws.s3"> </stack>
    

Upvotes: 1

Related Questions