Reputation: 11
I am trying to Add Asynchronous Logger to Infinispan Server using helm. We follow this guide https://logging.apache.org/log4j/log4j-2.3/manual/async.html to do this. But unfortunately we got the following error.
main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.async.AsyncLoggerConfig for element AsyncLogger: java.lang.NoClassDefFoundError: com/lmax/disruptor/EventHandler java.lang.reflect.InvocationTargetException
...
Caused by: java.lang.ClassNotFoundException: com.lmax.disruptor.EventHandler
I found a solution here https://mkyong.com/logging/log4j-2-java-lang-noclassdeffounderror-com-lmax-disruptor-eventtranslatorvararg/
But I am using helm https://github.com/openshift-helm-charts/charts/tree/main/charts/redhat/redhat/data-grid/8.3.1 to deploy the Server.
The question is "How I can add a dependency to our Server using Helm template. It is possible?"
Thanks for your time
Alexis.
Upvotes: 0
Views: 323
Reputation: 406
The Infinispan server image allows dependencies to be resolved on startup via http/ftp/maven by specifying the SERVER_LIBS
env variable with space separated artifacts. More details here
It's possible to modify the templates/statefulset.yaml
to include the following env var SERVER_LIBS=com.lmax:disruptor:3.4.2
in the "infinispan" container. This will result in the artifact being downloaded to each of the StatefulSet pods.
Upvotes: 0