Daniel Serodio | 8 Aug 15:09 2006
Picon

log4j-caused NullPointerException

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)
(Continue reading)

James Stauffer | 8 Aug 15:35 2006
Picon

Re: log4j-caused NullPointerException

There is probably a problem with your config.

On 8/8/06, Daniel Serodio <dserodio <at> 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
(Continue reading)

Curt Arnold | 8 Aug 16:35 2006
Picon

Re: log4j-caused NullPointerException


On Aug 8, 2006, at 8:09 AM, Daniel Serodio 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
>

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  
(Continue reading)


Gmane