>Number:         3674
>Category:       mod_jserv
>Synopsis:       Use of SimpleDateFormat constructor
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jserv
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Jan 15 02:10:03 PST 1999
>Last-Modified:
>Originator:     [EMAIL PROTECTED]
>Organization:
apache
>Release:        1.3.3/Apache JServ 1.0b1
>Environment:
RH Linux 5.2/Blackdown JDK 1.1.7v1a (running on a i386)
>Description:
>From time to time I'm getting this exception:

> java.lang.IllegalArgumentException: Thu, 01 Jan 1970 00:00:00 GMT
>   at
org.apache.jserv.JServConnection.getDateHeader(JServConnection.java:1242)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:493)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
>   at org.apache.jserv.JServConnection.run(JServConnection.java:359)
>   at java.lang.Thread.run(Thread.java)

Looking at the code I think I've nailed the problem. Both the
"setDateHeader()" and "getDateHeader()" methods use the default 
SimpleDateFormat constructor which in turn uses the default locale.
This results in ApJServ writing or looking for localized
Day/Month abbreviations (the rest is fine) while the HTTP
Date headers use only English.
>How-To-Repeat:

>Fix:
The locale used in SimpleDateFormat() should be specified explicitly:

> new SimpleDateFormat(<whatever>, Locale.US)
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[EMAIL PROTECTED]> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request ]
[from a developer.                                      ]
[Reply only with text; DO NOT SEND ATTACHMENTS!         ]



Reply via email to