tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Serodio <dsero...@pucsp.br>
Subject NPE in log4j while reloading webapp
Date Mon, 14 Aug 2006 15:18:50 GMT
When I try to reload an application in Tomcat, I get the following error:

log4j:ERROR Error occured while converting date.
java.lang.NullPointerException: null array passed into arraycopy
    at
java.lang.System.arraycopy(Ljava.lang.Object;ILjava.lang.Object;II)V(Unknown
Source)
    at
java.lang.AbstractStringBuilder.getChars(AbstractStringBuilder.java:331)
    at java.lang.StringBuffer.getChars(StringBuffer.java:202)
    at
org.apache.log4j.helpers.ISO8601DateFormat.format(ISO8601DateFormat.java:128)
    at java.text.DateFormat.format(DateFormat.java:314)
    at
org.apache.log4j.helpers.PatternParser$DatePatternConverter.convert(PatternParser.java:444)
    at
org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:64)
    at org.apache.log4j.PatternLayout.format(PatternLayout.java:503)
    at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:301)
    at org.apache.log4j.WriterAppender.append(WriterAppender.java:159)
    at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
    at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)
    at org.apache.log4j.Category.callAppenders(Category.java:203)
    at org.apache.log4j.Category.forcedLog(Category.java:388)
    at org.apache.log4j.Category.log(Category.java:853)
    at
org.apache.commons.logging.impl.Log4JLogger.info(Log4JLogger.java:133)
    at
org.apache.catalina.core.ApplicationContext.log(ApplicationContext.java:638)
    at
org.apache.catalina.core.ApplicationContextFacade.log(ApplicationContextFacade.java:249)
    at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:176)
    at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
    at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3727)
    at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4162)
    at
org.apache.catalina.core.StandardContext.reload(StandardContext.java:2988)
    at
org.jstripe.tomcat.probe.controllers.ReloadContextController.executeAction(ReloadContextController.java:25)
    at
org.jstripe.tomcat.probe.controllers.NoSelfContextHandlerController.handleContext(NoSelfContextHandlerController.java:34)
    at
org.jstripe.tomcat.probe.controllers.ContextHandlerController.handleRequestInternal(ContextHandlerController.java:39)
    at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
    at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
    at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:723)
    at
org.jstripe.tomcat.probe.ProbeServlet.doDispatch(ProbeServlet.java:48)
    at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:663)

This stacktrace is from a specific webapp (Lambda Probe), but I get
similar errors with any webapp I try to reload via Tomcat Manager.

What can I do to fix this problem? I asked in the log4j list, and got
the following answer from Curt Arnold:

> Might try asking on the tomcat-user list.  I've seen some surprising
> behavior during class reloading and it isn't an area that I have any
> experience with.  If you do get an analysis, I would appreciate your
> giving us a heads up by posting the resolution back here.

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

> When you post to the tomcat list, please identify the version of
> log4j, tomcat and the Java VM and platform.

The webapp has log4j.properties in WEB-INF/classes and log4j-1.2.13.jar
in WEB-INF/lib
I'm running Tomcat 5.5.15 on Linux with JRockit 1.5.0_06-b05, but I see
the same behaviour on Windows and/or with the Sun VM, so I dont't think
it'a VM-related problem.

Thanks in advance,
Daniel Serodio


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message