Skip to content

Adding additional jar for logging breaks with 16.1 #17250

Closed

Description

@MaklTa

Describe the bug

We configured GELF in our log4j.xml. For that we need to load the gelf.jar.

With infinispan 16.0 we solved the problem by adding the lib to the /opt/infinispan/server/lib folder in an own image.

FROM quay.io/infinispan/server:16.0.5

ARG GELF_LIB_URL=https://repo1.maven.org/maven2/biz/paluch/logging/logstash-gelf/1.15.1/logstash-gelf-1.15.1.jar
ARG OCI_SOURCE

LABEL org.opencontainers.image.source=$OCI_SOURCE

ADD --chown=infinispan "$GELF_LIB_URL" /opt/infinispan/server/lib/

Is there a (new) recommend way how to tackle this?

Expected behavior

The gelf logger can be found.

Actual behavior

With 16.1 this breaks when starting the server

2026-04-14T10:42:15.904937508Z main ERROR Error processing element Field (Field): CLASS_NOT_FOUND
2026-04-14T10:42:15.906104331Z main ERROR Error processing element Field (Field): CLASS_NOT_FOUND
2026-04-14T10:42:15.906205539Z main ERROR Error processing element Field (Field): CLASS_NOT_FOUND
2026-04-14T10:42:15.906323078Z main ERROR Error processing element Field (Field): CLASS_NOT_FOUND
2026-04-14T10:42:15.906390387Z main ERROR Error processing element Field (Field): CLASS_NOT_FOUND
2026-04-14T10:42:15.906446826Z main ERROR Error processing element Field (Field): CLASS_NOT_FOUND
2026-04-14T10:42:15.906519565Z main ERROR Error processing element Field (Field): CLASS_NOT_FOUND
2026-04-14T10:42:15.906599653Z main ERROR Error processing element Field (Field): CLASS_NOT_FOUND
2026-04-14T10:42:15.906656392Z main ERROR Error processing element Gelf (Gelf): CLASS_NOT_FOUND
2026-04-14T10:42:16.050325050Z main ERROR Unable to locate appender "gelf" for logger config "root"

How to Reproduce?

No response

Activity

  1. added theissue type on Apr 14, 2026
  2. sriramsri1991 commented on Apr 19, 2026

    @sriramsri1991

    +1
    I have got a similar issue upgrading from 15.2.0 final to 16.1.3
    The infinispan server image 16.1.3 /server/lib contains below jars to push logs to Elastic . This set up worked in 15.2.0 but fails in 16.1.3
    | |-server
    | | |-lib
    | | | |-README.txt
    | | | |-log4j-layout-template-json-2.25.3.jar
    | | | |-log4j-web-2.25.3.jar

    2026-04-17T13:51:26.444295445Z main ERROR Error processing element JsonTemplateLayout (JsonTemplateLayout): CLASS_NOT_FOUND
    2026-04-17T13:51:26.546523126Z main ERROR HttpAppender requires a layout to be set.
    2026-04-17T13:51:26.562831087Z main ERROR Null object returned for Http in Appenders.
    2026-04-17T13:51:26.577992940Z main ERROR No appender named HTTP was configured
    Exception in thread "main" java.lang.RuntimeException: org.apache.logging.log4j.core.config.ConfigurationException: No appenders are available for AsyncAppender ASYNC
    at org.infinispan.server.Bootstrap.runBatch(Bootstrap.java:221)
    at org.infinispan.server.Bootstrap.runInternal(Bootstrap.java:197)
    at org.infinispan.server.tool.Main.run(Main.java:102)
    at org.infinispan.server.Bootstrap.main(Bootstrap.java:87)
    Caused by: org.apache.logging.log4j.core.config.ConfigurationException: No appenders are available for AsyncAppender ASYNC
    at org.apache.logging.log4j.core.appender.AsyncAppender.start(AsyncAppender.java:123)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:344)

  3. tristantarrant commented on Apr 19, 2026

    @tristantarrant
    Member

    The classloading mechanism was reorganized to make it possible to use AOT. It's likely an issue with visibility. I'll have a look soon

  4. tristantarrant commented on Apr 19, 2026

    @tristantarrant
    Member

    can you also attach your log4j2.xml please?

  5. tristantarrant commented on Apr 19, 2026

    @tristantarrant
    Member

    I think I understand: in the new server, libraries are installed from the server process after logging has been configured. I need to restructure the order in which this happens

  6. added a commit that references this issue on Apr 19, 2026
  7. moved this from Todo to In Progress in Infinispan 16.xon Apr 19, 2026
  8. tristantarrant commented on Apr 19, 2026

    @tristantarrant
    Member

    @sriramsri1991 log4j-layout-template is already in lib. I don't think you need log4j-web

  9. sriramsri1991 commented on Apr 19, 2026

    @sriramsri1991
  10. sriramsri1991 commented on Apr 19, 2026

    @sriramsri1991

    @tristantarrant
    I have attached the log4j2.xml and the loglayout.json. The logs get shipped to a logstash endpoint.

    I dont see the log4j-layout-template jar in the image 16.1.3

    infinspan-serverlog.log

    . I downloaded the zip file for windows on version infinispan-server-16.2.0.Dev01 and kept the jars under server/lib , it works fine. Indeed log4j-web is not required, I will clean up

    The same set up doesn't work in the image 16.1.3/16.2.0.Dev01 with same jars under server/lib

  11. added 3 commits that reference this issue on Apr 21, 2026
  12. added a commit that references this issue on Apr 23, 2026
  13. moved this from In Progress to Done in Infinispan 16.xon Apr 23, 2026
  14. added a commit that references this issue on Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Fields

Priority

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions