Replacement of EAP 7 image jars

Solution Verified - Updated

Environment

  • Red Hat Enterprise Application Platform
    • 7.x
  • Red hat OpenShift Container Platform (OCP)
    • 4.x

Issue

  • Replacement of jar in EAP 7 builder image on buildconfig is not taking into consideration
  • Builder EAP 7 image module.xml does uses maven build jars

Resolution

Unless done as a requirement for a Red Hat fix, this process deems the image unsupported.

As explained on the solution JBoss EAP 7 thin image the jar Jars from local maven repository are used on the EAP 7 builder image.
Meaning the installed server is a thin server, no jar are installed under the modules dir, they are loaded from the local maven repository.
JBoss Modules does a resolution of artifacts in the local maven (galleon) repository and load the jars on their module.xml
This means the jar will be used from the maven (m2) local repository on the image set as $GALLEON_LOCAL_MAVEN_REPO

Usually located in /opt/jboss/container/wildfly/s2i/galleon/galleon-m2-repository.

This is noted by the module.xml by artifact name (meaning provided by maven) instead of resource-root path (found on this location) see below:

<resource-root path="wildfly-clustering-web-hotrod-7.4.12.GA-redhat-00003.jar"/>
VS
<artifact name="org.jboss.eap:wildfly-clustering-web-hotrod:7.4.12.GA-redhat-00003"/> 

Example:

EAP 7.4.12 builder image:

cat /opt/eap/modules/system/layers/base/org/wildfly/clustering/web/hotrod/main/module.xml 
<?xml version="1.0" encoding="UTF-8"?>
...
<module name="org.wildfly.clustering.web.hotrod" xmlns="urn:jboss:module:1.9">
    <resources>
        <resource-root path="wildfly-clustering-web-hotrod-7.4.12.GA-redhat-00003.jar"/>
    </resources>

This is using the below jars:

cd $GALLEON_LOCAL_MAVEN_REPO/
galleon-m2-repository/org/jboss/eap/wildfly-clustering-ee-hotrod/7.4.12.GA-redhat-00003/wildfly-clustering-ee-hotrod-7.4.12.GA-redhat-00003.pom
sh-4.4$ cd org/jboss/eap/wildfly-clustering-web-hotrod/
sh-4.4$ ls
7.4.12.GA-redhat-00003  maven-metadata.xml
sh-4.4$ ls -r
maven-metadata.xml  7.4.12.GA-redhat-00003
sh-4.4$ cd 7.4.12.GA-redhat-00003/
sh-4.4$ ls
wildfly-clustering-web-hotrod-7.4.12.GA-redhat-00003.jar      wildfly-clustering-web-hotrod-7.4.12.GA-redhat-00003.jar.sha1  wildfly-clustering-web-hotrod-7.4.12.GA-redhat-00003.pom.md5
wildfly-clustering-web-hotrod-7.4.12.GA-redhat-00003.jar.md5  wildfly-clustering-web-hotrod-7.4.12.GA-redhat-00003.pom       wildfly-clustering-web-hotrod-7.4.12.GA-redhat-00003.pom.sha1

Root Cause

The EAP 7 Builder image (aka intermediate image), the subsystems jars are in fact located on the Galleon local repository that can be found on the environment variable GALLEON_LOCAL_MAVEN_REPO.
The artifact name means it is provided by maven whereas resource-root path denotes it is found in a certain specific location.

In contrast to the EAP 7 runtime images, which doesn't have local maven repository. The environment variable GALLEON_LOCAL_MAVEN_REPO is not set:

Example EAP 7 runtime-image:

sh-4.4$ cat /opt/eap/modules/system/layers/base/org/wildfly/client/config/main/module.xml 
<module name="org.wildfly.client.config" xmlns="urn:jboss:module:1.9">
...
    <resources>
        <resource-root path="wildfly-client-config-1.0.1.Final-redhat-00001.jar"/>
    </resources>
...
</module>
sh-4.4$ echo $GALLEON_LOCAL_MAVEN_REPO 
<---- empty

Comparing image

ImageEnv variablemodule.xmljar location
Builder image$GALLEON_LOCAL_MAVEN_REPO is setmodule.xml brings artifact nameJars are inside the maven repository
Runtime image$GALLEON_LOCAL_MAVEN_REPO is not setmodule.xml brings resource-root pathJars are inside the module itself

Diagnostic Steps

  1. Verify the module.xml to confirm the jar is found local or from the local maven repository.
  2. Verify the type of image used on the buildconfig or the deployment.yaml/deploymentconfig.yaml
Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.