java.lang.NullPointerException

Stack Overflow | Kirill Rakhman | 2 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Log4j2 RollingFile with daily rotation

    Stack Overflow | 2 months ago | Kirill Rakhman
    java.lang.NullPointerException
  2. 0

    How to resolve exception(s) thrown when log4j2 rolling file appender triggers?

    Stack Overflow | 6 months ago | R Dub
    java.lang.NoClassDefFoundError: org/apache/logging/log4j/core/impl/Log4jLogEvent$Builder
  3. 0

    Log4j2-RollingFile not writing when TimeBasedTriggeringPolicy enabled

    Stack Overflow | 4 weeks ago | iBeatzPrograms
    java.lang.IllegalStateException: Pattern does not contain a date" I have put a break point in the log4j2 code and found that the reason is the frequency variable that is part of the PatternProcessor object is null. I don't know why this is null or how to set it to something other than null. If I comment out the TimeBasedTriggeringPolicy, the appender begins to work and writes the logs to my file. Here are the log4j dependencies in my POM: <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.7</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.7</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-slf4j-impl</artifactId> <version>2.7</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-web</artifactId> <version>2.6.2</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>1.7.7</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.7</version> </dependency> Here is my log4j2.xml file: <?xml version="1.0" encoding="UTF-8"?> <Configuration monitorInterval="30" status="DEBUG"> <Properties> <Property name="baseDir">/logs/oracle/domains/cim</Property> </Properties> <Appenders> <Console name="Console" target="SYSTEM_OUT"> <PatternLayout pattern="%highlight{%d{DEFAULT} [%t] %-5p %c -%m%n}"/> </Console> <RollingFile name="RollingFile" fileName="${baseDir}/cim.log" filePattern="${baseDir}/cim-%d{yyyy-MM-dd}.log" append="true"> <PatternLayout pattern="%d{DEFAULT} %-5p %c - %m%n"/> <Policies> <TimeBasedTriggeringPolicy interval="1" modulate="true"/> <SizeBasedTriggeringPolicy size="10 MB" /> </Policies> <DefaultRolloverStrategy max="31"/> </RollingFile> </Appenders> <Loggers> <Logger name="com.cim" level="debug" additivity="true"> <Appender-Ref ref="RollingFile"/> </Logger> <Root level="debug" additivity="false"> <Appender-Ref ref="Console"/> </Root> </Loggers> </Configuration>
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.apache.logging.log4j.core.appender.rolling.AbstractRolloverStrategy.getEligibleFiles()
    2. Apache Log4j Core
      Logger.logMessage
      1. org.apache.logging.log4j.core.appender.rolling.AbstractRolloverStrategy.getEligibleFiles(AbstractRolloverStrategy.java:107)
      2. org.apache.logging.log4j.core.appender.rolling.AbstractRolloverStrategy.getEligibleFiles(AbstractRolloverStrategy.java:96)
      3. org.apache.logging.log4j.core.appender.rolling.AbstractRolloverStrategy.getEligibleFiles(AbstractRolloverStrategy.java:89)
      4. org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy.purgeAscending(DefaultRolloverStrategy.java:212)
      5. org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy.purge(DefaultRolloverStrategy.java:199)
      6. org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy.rollover(DefaultRolloverStrategy.java:326)
      7. org.apache.logging.log4j.core.appender.rolling.RollingFileManager.rollover(RollingFileManager.java:310)
      8. org.apache.logging.log4j.core.appender.rolling.RollingFileManager.rollover(RollingFileManager.java:227)
      9. org.apache.logging.log4j.core.appender.rolling.RollingFileManager.checkRollover(RollingFileManager.java:207)
      10. org.apache.logging.log4j.core.appender.RollingFileAppender.append(RollingFileAppender.java:267)
      11. org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)
      12. org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)
      13. org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120)
      14. org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
      15. org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:448)
      16. org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:433)
      17. org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:417)
      18. org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:403)
      19. org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63)
      20. org.apache.logging.log4j.core.Logger.logMessage(Logger.java:146)
      20 frames
    3. Apache Log4j API
      AbstractLogger.info
      1. org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2091)
      2. org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1988)
      3. org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1960)
      4. org.apache.logging.log4j.spi.AbstractLogger.info(AbstractLogger.java:1297)
      4 frames
    4. my.package
      MainKt.main
      1. my.package.MainKt.main(Main.kt:48)
      1 frame