tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Serodio <dsero...@pucsp.br>
Subject Re: NPE in log4j while reloading webapp
Date Mon, 14 Aug 2006 15:49:03 GMT
Andrew Stepanenko wrote:
> hello,
> 
> this issue has already been discussed before. Pls, search the archives.
> AFAIK, you need to put log4j JAR to $CATALINA_HOME/common/lib dir in
> addition to your WEB-INF/lib.

Adding log4j JAR to $CATALINA_HOME/common/lib just changed the error to
IllegalStateException:

INFO: Illegal access: this web application instance has been stopped
already.  Could not load org.apache.log4j.spi.VectorWriter.  The eventu
al following stack trace is caused by an error thrown for debugging
purposes as well as to attempt to terminate the thread which caused the
illegal access, and has no functional impact.
java.lang.IllegalStateException
    at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238)
    at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
    at
java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.lang.Class;(Unknown
Source)
    at org.apache.log4j.spi.LoggingEvent.<init>(LoggingEvent.java:154)
    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.error(Log4JLogger.java:193)
    at
org.apache.catalina.core.ApplicationContext.log(ApplicationContext.java:667)
    at
org.apache.catalina.core.ApplicationContextFacade.log(ApplicationContextFacade.java:269)
    at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1141)
    at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757)
    at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:641)
    at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
    at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
    at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
    at
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
    at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:43)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
    at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:120)
    at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

> 
> On 8/14/06, Daniel Serodio <dserodio@pucsp.br> wrote:
>> 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