quarkus: When overridding logging handlers for a specific category we get NullPointerException in native mode only

Describe the bug Whenever we configure specific handlers that we link to a category we get a NullPointerException.

2020-01-30 12:10:53 Mounting /private/var/folders/xk/xtn2b68s2c33qryl26pvzfv40000gn/T/tmpt7c35ugv as /var/task:ro,delegated inside runtime container
Exception in thread "main" java.lang.RuntimeException: Failed to start quarkus
at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:138)
at io.quarkus.runtime.Application.start(Application.java:87)
at io.quarkus.runtime.Application.run(Application.java:210)
at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:41)
Caused by: java.lang.NullPointerException
at org.jboss.logmanager.AtomicArray.add(AtomicArray.java:114)
at org.jboss.logmanager.LoggerNode.addHandler(LoggerNode.java:295)
at org.jboss.logmanager.Logger.addHandler(Logger.java:217)
at io.quarkus.runtime.logging.LoggingSetupRecorder.addNamedHandlersToCategory(LoggingSetupRecorder.java:169)
at io.quarkus.runtime.logging.LoggingSetupRecorder.initializeLogging(LoggingSetupRecorder.java:116)
at io.quarkus.deployment.steps.LoggingResourceProcessor$setupLoggingRuntimeInit180.deploy_0(LoggingResourceProcessor$setupLoggingRuntimeInit180.zig:103)
at io.quarkus.deployment.steps.LoggingResourceProcessor$setupLoggingRuntimeInit180.deploy(LoggingResourceProcessor$setupLoggingRuntimeInit180.zig:122)
at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:60)
... 3 more

Expected behavior The behaviour should be the same as when running in JVM and attach the extra handlers to the Logger that belongs to a category.

To Reproduce Steps to reproduce the behavior:

  1. Configure named handlers and link to category
  2. Build native image
  3. During initialisation the exception occurs

Configuration

quarkus.log.handler.console."STRUCTURED_LOGGING".format=%m%n

quarkus.log.category."com.xyz.DocumentEventLogger".level=DEBUG
quarkus.log.category."com.xyz.DocumentEventLogger".handlers=STRUCTURED_LOGGING

Environment (please complete the following information):

  • Output of uname -a or ver: Darwin APRXJGH6D5D5F9 18.7.0 Darwin Kernel Version 18.7.0: Thu Jan 23 06:52:12 PST 2020; root:xnu-4903.278.25~1/RELEASE_X86_64 x86_64
  • Output of java -version: 1.8.0_211
  • GraalVM version (if different from Java): quay.io/quarkus/ubi-quarkus-native-image:19.2.1
  • Quarkus version or git rev: 1.2.0.Final

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 15 (13 by maintainers)

Commits related to this issue

Most upvoted comments

This issue is solved in 1.13.0.Final by @dmlloyd

Hello all, for me I have the same problem, but even if @schulzp 's idea, it not working … however I have the same version for quarkus.platform.version and quarkus-plugin.version I dispair because it was for a POC in my company in order to switch from Spring Boot to Quarkus, but even if my leader team’s vision may not be able to convince the technical director plugin log dependency stacktrace

But for me the NPE was generated in the “org.jboss.logmanager.AtomicArray.add(AtomicArray.java:114)” Maybe I forgotten anything in configuration ? Anyone have another idea by any chance plz ? Do you think I can pull the source code for debugging ?

Thank you all