This post provides some experiences from making a simple Java app (well, the actual app does something this is just a demo) that connects to Bitfinex to  get the funding rates run as a GraalVM native image.

xChange is one of the most famous Java libraries for integrating with a large number of crypto exchanges. It provides a simple API that Continue reading

When using Infinispan (or any other jBoss library for that matter)  and Logback in the same project you may end up getting this warning when running the project:

ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console

Maybe you log to a persistent storage and you may miss important error messages, because they are logged to the console.

Solution 1: Start the application with specific parameter

One solution is to add the following parameter when starting the application:

-Dorg.jboss.logging.provider=slf4j

The relevant code is in org.jboss.logging.LoggerProviders which looks for the “org.jboss.logging.provider” environment variable.

 

Solution 2: Exclude log4j libraries from classpath

Another solution is to exclude all logging related classes from the classpath, as in org.jboss.logging.LoggerProviders it looking for various logging related classes and it looks for the logabck related classes at the very end!

When using gradle it is enough to add the following into build.gradle

configurations {
all*.exclude group: ‘org.apache.logging.log4j’
all*.exclude group: ‘org.apache.log4j’
all*.exclude group: ‘org.jboss.logmanager’
}