Bug 44748 - java.lang.ArrayIndexOutOfBoundsException
Summary: java.lang.ArrayIndexOutOfBoundsException
Status: RESOLVED DUPLICATE of bug 38483
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Connector:Coyote (show other bugs)
Version: 5.5.17
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-03 08:52 UTC by Tony
Modified: 2008-04-03 09:33 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tony 2008-04-03 08:52:16 UTC
Tomcat version info:
Server version: Apache Tomcat/5.5.17
Server built:   Apr 14 2006 02:08:29
Server number:  5.5.17.0
OS Name:        Linux
OS Version:     2.6.9-42.ELsmp
Architecture:   i386
JVM Version:    1.5.0_13-b05
JVM Vendor:     Sun Microsystems Inc.

===============

Got below exceptions when the tomcat is running on the Linux server, error trace as below:

Mar 20, 2008 9:01:29 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080

.
.
.
.
.

Mar 20, 2008 9:01:30 PM org.apache.catalina.connector.CoyoteAdapter service
SEVERE: An exception or error occurred in the container during the request processing
java.lang.ArrayIndexOutOfBoundsException: 959
 at sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(BaseCalendar.java:436)
 at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2081)
 at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:1996)
 at java.util.Calendar.setTimeInMillis(Calendar.java:1066)
 at java.util.Calendar.setTime(Calendar.java:1032)
 at java.text.SimpleDateFormat.format(SimpleDateFormat.java:785)
 at java.text.SimpleDateFormat.format(SimpleDateFormat.java:778)
 at java.text.DateFormat.format(DateFormat.java:314)
 at org.apache.catalina.valves.AccessLogValve.replace(AccessLogValve.java:874)
 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:658)
 at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:392)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
 at java.lang.Thread.run(Thread.java:595)



I searched web, said "it looks like a tomcat bug because the Calendar methods are called by multiple threads through a SimpleDateFormat, which corrupted cache data and caused the exception. As stated in the SimpleDateFormat documentation, SimpleDateFormat isn't thread-safe, so the caller method org.apache.catalina.valves.AccessLogValve.replace should use synchronisation to share a SimpleDateFormat by thread, but it doesn't. "

Any thoughts.

Thanks in advance.


/Tony
Comment 1 Mark Thomas 2008-04-03 09:33:22 UTC

*** This bug has been marked as a duplicate of bug 38483 ***