Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-6362

NPE in Log4J2Logger

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1
    • 2.4
    • general
    • None

    Description

      When I start a node with Log4J2Logger configured and verbose mode (-DIGNITE_QUIET=false, it fails with NPE:

      Caused by: java.lang.NullPointerException
      	at org.apache.logging.log4j.core.config.LoggerConfig.<init>(LoggerConfig.java:145)
      	at org.apache.logging.log4j.core.config.LoggerConfig.createLogger(LoggerConfig.java:523)
      	at org.apache.ignite.logger.log4j2.Log4J2Logger.createConsoleLogger(Log4J2Logger.java:380)
      	at org.apache.ignite.logger.log4j2.Log4J2Logger.addConsoleAppenderIfNeeded(Log4J2Logger.java:338)
      	at org.apache.ignite.logger.log4j2.Log4J2Logger.<init>(Log4J2Logger.java:145)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
      	... 34 more
      

      This is caused by the fact that Log4J2Logger#createConsoleLogger method invokes LoggerConfig.createLogger providing null as Configuration object, which unconditionally causes NPE. Need to provide some default configuration instead.

      Attachments

        Activity

          People

            alexey.tank2 Alexey Popov
            vkulichenko Valentin Kulichenko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: