log4j:ERROR Error occured while converting date

故事扮演 提交于 2019-12-05 06:36:19
JBert

It seems this is a very rare situation. Googling for the error turned up the following discussion from 2006, something to do with class un-loading:
http://comments.gmane.org/gmane.comp.jakarta.log4j.user/13835

I did look at the code in question. If lastTimeString was somehow
not initialized on class reload, then there could be a NPE on the
call to getChars(). However, short of a some failure in the VM or a
class reloading hack, I don't see how lastTimeString could be null.

EDIT: See question above for a solution:

I've added an explicit conversion pattern: %d{yyyy-MM-dd HH:mm:ss} [%t] %p %c - %m%n

This also seemed to work for the following question: NPE with Perf4j and Log4j.

Ilja Zverev

I've just stumbled upon this exception, and it was solved by removing log4j.jar from the portlet (or servlet, whatever) folder.

I know it's an old thread, but I fixed this problem by restarting the server. Yeah, cliche answer, but worth a try

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!