You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:889)
at com.github.valfirst.slf4jtest.LoggingEvent.<init>(LoggingEvent.java:409)
at com.github.valfirst.slf4jtest.TestLogger.addLoggingEvent(TestLogger.java:448)
at com.github.valfirst.slf4jtest.TestLogger.log(TestLogger.java:432)
at com.github.valfirst.slf4jtest.TestLogger.log(TestLogger.java:409)
at com.github.valfirst.slf4jtest.TestLogger.debug(TestLogger.java:170)
at org.testcontainers.images.builder.ImageFromDockerfile$1.onNext(ImageFromDockerfile.java:106)
at org.testcontainers.images.builder.ImageFromDockerfile$1.onNext(ImageFromDockerfile.java:98)
at org.testcontainers.shaded.com.github.dockerjava.core.exec.AbstrAsyncDockerCmdExec$1.onNext(AbstrAsyncDockerCmdExec.java:41)
at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder$JsonSink.accept(DefaultInvocationBuilder.java:315)
at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder$JsonSink.accept(DefaultInvocationBuilder.java:298)
at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.lambda$executeAndStream$1(DefaultInvocationBuilder.java:275)
at java.base/java.lang.Thread.run(Thread.java:833)
When I remove slf4j-test as a dependency the container starts up as expected.
Since I would expect the presence of slf4j-test not to have any impact on the general flow of a program I think this might be a bug in slf4j-test rather than testcontainers but you can judge this better than me 😅 .
The text was updated successfully, but these errors were encountered:
import org.slf4j.LoggerFactory;
public class LogNullTest {
public static void main(String[] args) {
LoggerFactory.getLogger(LogNullTest.class).info(null);
}
}
with slf4j-test causes:
java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:878)
at com.github.valfirst.slf4jtest.LoggingEvent.<init>(LoggingEvent.java:409)
whereas (e.g.) slf4j-simple logs:
[main] INFO LogNullTest - null
This seems like a bug in testcontainers, but other implementations accept it, and the SLF4J documentation for Logger doesn't specify whether or not null can be passed.
When trying to setup testcontainers in a project I ran into a problem with
slf4j-test
.It seems that while testcontainers starts a container it creates a log event with the
message
beingnull
.This causes the check in line 409
slf4j-test/src/main/java/com/github/valfirst/slf4jtest/LoggingEvent.java
Lines 395 to 409 in 9eeddda
to fail with the following stacktrace:
When I remove
slf4j-test
as a dependency the container starts up as expected.Since I would expect the presence of
slf4j-test
not to have any impact on the general flow of a program I think this might be a bug inslf4j-test
rather thantestcontainers
but you can judge this better than me 😅 .The text was updated successfully, but these errors were encountered: