jboss在apache camel日期格式上抛出错误now:yyyymmddhhmmsssss

mbskvtky  于 2021-06-27  发布在  Java
关注(0)|答案(0)|浏览(313)

每当我试图向文件夹发送消息时,jboss(version7.1.0.ga)server.log中就会出现以下错误。在tomcat中没有错误。即使抛出错误,功能也可以正常工作。
在使用apachecamel写入文件夹时,我使用以下格式打印所需的文件名${in.header.filename}_${date:now:yyyymmddhhmmssss}根据camel docs,这种格式是正确的,但是由于某些原因jboss的“now”有问题。
你知道怎么解决这个问题吗?

Log4j2-TF-7-AsyncLoggerConfig-2 ERROR Invalid date format: [now:yyyyMMddHHmmssSSS], 
using default java.lang.IllegalArgumentException: Illegal pattern character 'n'
    at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:826)
    at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:634)
    at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:605)
    at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:580)
    at org.apache.logging.log4j.core.lookup.DateLookup.formatDate(DateLookup.java:64)
    at org.apache.logging.log4j.core.lookup.DateLookup.lookup(DateLookup.java:57)
    at org.apache.logging.log4j.core.lookup.Interpolator.lookup(Interpolator.java:223)
    at org.apache.logging.log4j.core.lookup.StrSubstitutor.resolveVariable(StrSubstitutor.java:1116)
    at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:1038)
    at org.apache.logging.log4j.core.lookup.StrSubstitutor.substitute(StrSubstitutor.java:912)
    at org.apache.logging.log4j.core.lookup.StrSubstitutor.replace(StrSubstitutor.java:467)
    at org.apache.logging.log4j.core.pattern.MessagePatternConverter.format(MessagePatternConverter.java:132)
    at org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:38)
    at org.apache.logging.log4j.core.layout.PatternLayout$PatternSerializer.toSerializable(PatternLayout.java:345)
    at org.apache.logging.log4j.core.layout.PatternLayout.toText(PatternLayout.java:244)
    at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:229)
    at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:59)
    at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.directEncodeEvent(AbstractOutputStreamAppender.java:197)
    at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:190)
    at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:181)
    at org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender.append(RollingRandomAccessFileAppender.java:252)
    at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)
    at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)
    at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120)
    at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
    at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:543)
    at org.apache.logging.log4j.core.async.AsyncLoggerConfig.callAppenders(AsyncLoggerConfig.java:127)
    at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:502)
    at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:485)
    at org.apache.logging.log4j.core.async.AsyncLoggerConfig.log(AsyncLoggerConfig.java:121)
    at org.apache.logging.log4j.core.async.AsyncLoggerConfig.logToAsyncLoggerConfigsOnCurrentThread(AsyncLoggerConfig.java:169)
    at org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigDisruptor.java:111)
    at org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigDisruptor.java:97)
    at com.lmax.disruptor.BatchEventProcessor.processEvents(BatchEventProcessor.java:168)
    at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:125)
    at java.lang.Thread.run(Thread.java:745)

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题