java.lang.IllegalArgumentException: Cannot convert Mon Feb 09 00:00:00 CET 2015 of typejava.util.Date

QOS.ch JIRA | manolo perez | 10 months ago
  1. 0

    A Exception is being thrown when configuring a RollingFileAppender inside a SiftingAppender and both %d{} and %i appears in the FileNamePattern. For example: {code} policy.setFileNamePattern(/var/logs/archived_"+discriminatingValue+"_%d{yyyy_MM_dd}_%i.log"); policy.setMaxHistory(365); policy.setCleanHistoryOnStart(true); innerpolicy.setMaxFileSize("5KB"); {code} At CleanHistoryOnStart time, It tries to resolve the date both in %d as well as in %i and it fails. I think something is missing in ch.qos.logback.core.rolling.helper.TimeBasedArchiveRemover.cleanByPeriodOffset It doesn´t honor the possible %i of a given rolled log. The logger configuration: {code} LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); SiftingAppender connectorAppender = new SiftingAppender(); connectorAppender.setContext(loggerContext); connectorAppender.setName("SIFTING_APPENDER"); MDCBasedDiscriminator discriminator = new MDCBasedDiscriminator(); discriminator.setKey("SKEY"); discriminator.setDefaultValue("DEF_KEY"); discriminator.start(); connectorAppender.setDiscriminator(discriminator); connectorAppender.setAppenderFactory(new AppenderFactory<ILoggingEvent>() { @Override public Appender<ILoggingEvent> buildAppender(Context context, String discriminatingValue) throws JoranException { RollingFileAppender<ILoggingEvent> appender = new RollingFileAppender<>(); appender.setName("ROLLING_APPENDER_"+discriminatingValue); appender.setContext(context); appender.setFile("/var/logs/active_"+discriminatingValue+".log"); TimeBasedRollingPolicy<ILoggingEvent> policy = new TimeBasedRollingPolicy<>(); policy.setContext(context); policy.setMaxHistory(365); policy.setFileNamePattern(/var/logs/archived_"+discriminatingValue+"_%d{yyyy_MM_dd}_%i.log"); policy.setParent(appender); policy.setCleanHistoryOnStart(true); policy.start(); SizeAndTimeBasedFNATP<ILoggingEvent> innerpolicy = new SizeAndTimeBasedFNATP<>(); innerpolicy.setContext(context); innerpolicy.setMaxFileSize("5KB"); innerpolicy.setTimeBasedRollingPolicy(policy); innerpolicy.start(); policy.setTimeBasedFileNamingAndTriggeringPolicy(innerpolicy); policy.start(); appender.setRollingPolicy(policy); PatternLayoutEncoder pl = new PatternLayoutEncoder(); pl.setContext(context); pl.setPattern("%d{yyyy/MM/dd'T'HH:mm:ss} %-5level - %msg\n"); pl.start(); appender.setEncoder(pl); appender.start(); return appender; } }); connectorAppender.start(); ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger)LoggerFactory.getLogger("org.test"); logger.addAppender(connectorAppender); logger.setLevel(Level.DEBUG); logger.setAdditive(false); MDC.put("SKEY", "K1"); logger.info("bla1"); MDC.clear(); MDC.put("SKEY", "K2"); logger.info("bla2"); MDC.clear(); {code} The exception: {code} 17:02:56,382 |-ERROR in ch.qos.logback.classic.sift.SiftingAppender[SIFTING_APPENDER] - Appender [SIFTING_APPENDER] failed to append. java.lang.IllegalArgumentException: Cannot convert Mon Feb 09 00:00:00 CET 2015 of typejava.util.Date at java.lang.IllegalArgumentException: Cannot convert Mon Feb 09 00:00:00 CET 2015 of typejava.util.Date at at ch.qos.logback.core.rolling.helper.IntegerTokenConverter.convert(IntegerTokenConverter.java:40) at at ch.qos.logback.core.rolling.helper.FileNamePattern.convert(FileNamePattern.java:137) at at ch.qos.logback.core.rolling.helper.TimeBasedArchiveRemover.cleanByPeriodOffset(TimeBasedArchiveRemover.java:28) at at ch.qos.logback.core.rolling.helper.DefaultArchiveRemover.clean(DefaultArchiveRemover.java:71) at at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.start(TimeBasedRollingPolicy.java:100) at at org.jga.camel.AppDispatcher$1.buildAppender(AppDispatcher.java:134) at at ch.qos.logback.core.sift.AppenderTracker.buildComponent(AppenderTracker.java:57) at at ch.qos.logback.core.sift.AppenderTracker.buildComponent(AppenderTracker.java:32) at at ch.qos.logback.core.spi.AbstractComponentTracker.getOrCreate(AbstractComponentTracker.java:124) at at ch.qos.logback.core.sift.SiftingAppenderBase.append(SiftingAppenderBase.java:105) at at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:85) at at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48) at at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:273) at at ch.qos.logback.classic.Logger.callAppenders(Logger.java:260) at at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:442) at at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:396) at at ch.qos.logback.classic.Logger.info(Logger.java:600) at at org.jga.camel.connectors.Conn1.doWork(Conn1.java:13) at at org.jga.camel.AppDispatcher.main(AppDispatcher.java:173) {code}

    QOS.ch JIRA | 10 months ago | manolo perez
    java.lang.IllegalArgumentException: Cannot convert Mon Feb 09 00:00:00 CET 2015 of typejava.util.Date
  2. 0

    A Exception is being thrown when configuring a RollingFileAppender inside a SiftingAppender and both %d{} and %i appears in the FileNamePattern. For example: {code} policy.setFileNamePattern(/var/logs/archived_"+discriminatingValue+"_%d{yyyy_MM_dd}_%i.log"); policy.setMaxHistory(365); policy.setCleanHistoryOnStart(true); innerpolicy.setMaxFileSize("5KB"); {code} At CleanHistoryOnStart time, It tries to resolve the date both in %d as well as in %i and it fails. I think something is missing in ch.qos.logback.core.rolling.helper.TimeBasedArchiveRemover.cleanByPeriodOffset It doesn´t honor the possible %i of a given rolled log. The logger configuration: {code} LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); SiftingAppender connectorAppender = new SiftingAppender(); connectorAppender.setContext(loggerContext); connectorAppender.setName("SIFTING_APPENDER"); MDCBasedDiscriminator discriminator = new MDCBasedDiscriminator(); discriminator.setKey("SKEY"); discriminator.setDefaultValue("DEF_KEY"); discriminator.start(); connectorAppender.setDiscriminator(discriminator); connectorAppender.setAppenderFactory(new AppenderFactory<ILoggingEvent>() { @Override public Appender<ILoggingEvent> buildAppender(Context context, String discriminatingValue) throws JoranException { RollingFileAppender<ILoggingEvent> appender = new RollingFileAppender<>(); appender.setName("ROLLING_APPENDER_"+discriminatingValue); appender.setContext(context); appender.setFile("/var/logs/active_"+discriminatingValue+".log"); TimeBasedRollingPolicy<ILoggingEvent> policy = new TimeBasedRollingPolicy<>(); policy.setContext(context); policy.setMaxHistory(365); policy.setFileNamePattern(/var/logs/archived_"+discriminatingValue+"_%d{yyyy_MM_dd}_%i.log"); policy.setParent(appender); policy.setCleanHistoryOnStart(true); policy.start(); SizeAndTimeBasedFNATP<ILoggingEvent> innerpolicy = new SizeAndTimeBasedFNATP<>(); innerpolicy.setContext(context); innerpolicy.setMaxFileSize("5KB"); innerpolicy.setTimeBasedRollingPolicy(policy); innerpolicy.start(); policy.setTimeBasedFileNamingAndTriggeringPolicy(innerpolicy); policy.start(); appender.setRollingPolicy(policy); PatternLayoutEncoder pl = new PatternLayoutEncoder(); pl.setContext(context); pl.setPattern("%d{yyyy/MM/dd'T'HH:mm:ss} %-5level - %msg\n"); pl.start(); appender.setEncoder(pl); appender.start(); return appender; } }); connectorAppender.start(); ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger)LoggerFactory.getLogger("org.test"); logger.addAppender(connectorAppender); logger.setLevel(Level.DEBUG); logger.setAdditive(false); MDC.put("SKEY", "K1"); logger.info("bla1"); MDC.clear(); MDC.put("SKEY", "K2"); logger.info("bla2"); MDC.clear(); {code} The exception: {code} 17:02:56,382 |-ERROR in ch.qos.logback.classic.sift.SiftingAppender[SIFTING_APPENDER] - Appender [SIFTING_APPENDER] failed to append. java.lang.IllegalArgumentException: Cannot convert Mon Feb 09 00:00:00 CET 2015 of typejava.util.Date at java.lang.IllegalArgumentException: Cannot convert Mon Feb 09 00:00:00 CET 2015 of typejava.util.Date at at ch.qos.logback.core.rolling.helper.IntegerTokenConverter.convert(IntegerTokenConverter.java:40) at at ch.qos.logback.core.rolling.helper.FileNamePattern.convert(FileNamePattern.java:137) at at ch.qos.logback.core.rolling.helper.TimeBasedArchiveRemover.cleanByPeriodOffset(TimeBasedArchiveRemover.java:28) at at ch.qos.logback.core.rolling.helper.DefaultArchiveRemover.clean(DefaultArchiveRemover.java:71) at at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.start(TimeBasedRollingPolicy.java:100) at at org.jga.camel.AppDispatcher$1.buildAppender(AppDispatcher.java:134) at at ch.qos.logback.core.sift.AppenderTracker.buildComponent(AppenderTracker.java:57) at at ch.qos.logback.core.sift.AppenderTracker.buildComponent(AppenderTracker.java:32) at at ch.qos.logback.core.spi.AbstractComponentTracker.getOrCreate(AbstractComponentTracker.java:124) at at ch.qos.logback.core.sift.SiftingAppenderBase.append(SiftingAppenderBase.java:105) at at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:85) at at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48) at at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:273) at at ch.qos.logback.classic.Logger.callAppenders(Logger.java:260) at at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:442) at at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:396) at at ch.qos.logback.classic.Logger.info(Logger.java:600) at at org.jga.camel.connectors.Conn1.doWork(Conn1.java:13) at at org.jga.camel.AppDispatcher.main(AppDispatcher.java:173) {code}

    QOS.ch JIRA | 10 months ago | manolo perez
    java.lang.IllegalArgumentException: Cannot convert Mon Feb 09 00:00:00 CET 2015 of typejava.util.Date
  3. 0

    This happens in JIRA 6.2 with version 6.18.1 of JIRA <->HipChat integration. This appeared in : https://help.hipchat.com/forums/138883-suggestions-ideas/suggestions/7762344-illegalargumentexception-when-mentioning-jira-issu The following exception is raised: {code} java.lang.IllegalArgumentException: Invalid format: "2015-04-30T07:07:09+00:00" is malformed at ":09+00:00" at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:873) at com.atlassian.jira.datetime.DateTimeISO8601DateTimeFormatter.parse(DateTimeISO8601DateTimeFormatter.java:54) at com.atlassian.jira.datetime.DateTimeFormatterImpl.parse(DateTimeFormatterImpl.java:54) at com.atlassian.jira.plugins.hipchat.mentions.service.DefaultIssueMentionService.issueMentioned(DefaultIssueMentionService.java:75) at com.atlassian.jira.plugins.hipchat.service.task.impl.ProcessIssueMentionTask.doCall(ProcessIssueMentionTask.java:30) at com.atlassian.jira.plugins.hipchat.service.task.impl.ProcessIssueMentionTask.doCall(ProcessIssueMentionTask.java:15) at com.atlassian.jira.plugins.hipchat.service.task.Task.call(Task.java:28) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) {code}

    Atlassian JIRA | 1 year ago | Carlos Khatchikian
    java.lang.IllegalArgumentException: Invalid format: "2015-04-30T07:07:09+00:00" is malformed at ":09+00:00"
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    This happens in JIRA 6.2 with version 6.18.1 of JIRA <->HipChat integration. This appeared in : https://help.hipchat.com/forums/138883-suggestions-ideas/suggestions/7762344-illegalargumentexception-when-mentioning-jira-issu The following exception is raised: {code} java.lang.IllegalArgumentException: Invalid format: "2015-04-30T07:07:09+00:00" is malformed at ":09+00:00" at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:873) at com.atlassian.jira.datetime.DateTimeISO8601DateTimeFormatter.parse(DateTimeISO8601DateTimeFormatter.java:54) at com.atlassian.jira.datetime.DateTimeFormatterImpl.parse(DateTimeFormatterImpl.java:54) at com.atlassian.jira.plugins.hipchat.mentions.service.DefaultIssueMentionService.issueMentioned(DefaultIssueMentionService.java:75) at com.atlassian.jira.plugins.hipchat.service.task.impl.ProcessIssueMentionTask.doCall(ProcessIssueMentionTask.java:30) at com.atlassian.jira.plugins.hipchat.service.task.impl.ProcessIssueMentionTask.doCall(ProcessIssueMentionTask.java:15) at com.atlassian.jira.plugins.hipchat.service.task.Task.call(Task.java:28) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) {code}

    Atlassian JIRA | 1 year ago | Carlos Khatchikian
    java.lang.IllegalArgumentException: Invalid format: "2015-04-30T07:07:09+00:00" is malformed at ":09+00:00"
  6. 0

    This happens in JIRA 6.2 with version 6.18.1 of JIRA <->HipChat integration. This appeared in : https://help.hipchat.com/forums/138883-suggestions-ideas/suggestions/7762344-illegalargumentexception-when-mentioning-jira-issu The following exception is raised: {code} java.lang.IllegalArgumentException: Invalid format: "2015-04-30T07:07:09+00:00" is malformed at ":09+00:00" at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:873) at com.atlassian.jira.datetime.DateTimeISO8601DateTimeFormatter.parse(DateTimeISO8601DateTimeFormatter.java:54) at com.atlassian.jira.datetime.DateTimeFormatterImpl.parse(DateTimeFormatterImpl.java:54) at com.atlassian.jira.plugins.hipchat.mentions.service.DefaultIssueMentionService.issueMentioned(DefaultIssueMentionService.java:75) at com.atlassian.jira.plugins.hipchat.service.task.impl.ProcessIssueMentionTask.doCall(ProcessIssueMentionTask.java:30) at com.atlassian.jira.plugins.hipchat.service.task.impl.ProcessIssueMentionTask.doCall(ProcessIssueMentionTask.java:15) at com.atlassian.jira.plugins.hipchat.service.task.Task.call(Task.java:28) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) {code}

    Atlassian JIRA | 1 year ago | Carlos Khatchikian
    java.lang.IllegalArgumentException: Invalid format: "2015-04-30T07:07:09+00:00" is malformed at ":09+00:00"

    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.IllegalArgumentException

      Cannot convert Mon Feb 09 00:00:00 CET 2015 of typejava.util.Date

      at ch.qos.logback.core.rolling.helper.IntegerTokenConverter.convert()
    2. Logback Core Module
      TimeBasedRollingPolicy.start
      1. ch.qos.logback.core.rolling.helper.IntegerTokenConverter.convert(IntegerTokenConverter.java:40)
      2. ch.qos.logback.core.rolling.helper.FileNamePattern.convert(FileNamePattern.java:137)
      3. ch.qos.logback.core.rolling.helper.TimeBasedArchiveRemover.cleanByPeriodOffset(TimeBasedArchiveRemover.java:28)
      4. ch.qos.logback.core.rolling.helper.DefaultArchiveRemover.clean(DefaultArchiveRemover.java:71)
      5. ch.qos.logback.core.rolling.TimeBasedRollingPolicy.start(TimeBasedRollingPolicy.java:100)
      5 frames
    3. org.jga.camel
      AppDispatcher$1.buildAppender
      1. org.jga.camel.AppDispatcher$1.buildAppender(AppDispatcher.java:134)
      1 frame
    4. Logback Core Module
      AppenderAttachableImpl.appendLoopOnAppenders
      1. ch.qos.logback.core.sift.AppenderTracker.buildComponent(AppenderTracker.java:57)
      2. ch.qos.logback.core.sift.AppenderTracker.buildComponent(AppenderTracker.java:32)
      3. ch.qos.logback.core.spi.AbstractComponentTracker.getOrCreate(AbstractComponentTracker.java:124)
      4. ch.qos.logback.core.sift.SiftingAppenderBase.append(SiftingAppenderBase.java:105)
      5. ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:85)
      6. ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)
      6 frames
    5. Logback Classic Module
      Logger.info
      1. ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:273)
      2. ch.qos.logback.classic.Logger.callAppenders(Logger.java:260)
      3. ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:442)
      4. ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:396)
      5. ch.qos.logback.classic.Logger.info(Logger.java:600)
      5 frames
    6. org.jga.camel
      AppDispatcher.main
      1. org.jga.camel.connectors.Conn1.doWork(Conn1.java:13)
      2. org.jga.camel.AppDispatcher.main(AppDispatcher.java:173)
      2 frames