Locale problems with wrap-file-info

10 views
Skip to first unread message

Oleg

unread,
Jun 30, 2010, 6:25:17 AM6/30/10
to Compojure, ring-c...@googlegroups.com
Hello!

Here's my stacktrace:

2010-06-30 14:08:26.879::WARN: EXCEPTION
java.text.ParseException: Unparseable date: "??, 20 ??? 2010 08:02:13
+0000"
at java.text.DateFormat.parse(DateFormat.java:337)
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:90)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
at ring.middleware.file_info
$not_modified_since_QMARK_.invoke(file_info.clj:86)
at ring.middleware.file_info$wrap_file_info
$fn__4809.invoke(file_info.clj:108)

My locale command results:

LANG="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_CTYPE="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_ALL=

Java information:

java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode)

Operational system: Mac OS X Snow Leopard 10.6.4

- Oleg

James Reeves

unread,
Jun 30, 2010, 9:31:36 AM6/30/10
to ring-c...@googlegroups.com
That's odd. As far as I'm aware, HTTP date formats are not localised.

Perhaps java.text.DateFormat object is locale-aware, and it's trying
to parse the date for the ru_RU locale.

Could you perhaps provide a dump of all of the HTTP headers in the request?

- James

Allen Rohner

unread,
Jul 2, 2010, 3:25:10 PM7/2/10
to Ring
I had a similar error the other day. I discovered that
SimpleDateFormat is not re-entrant, but wrap-file-info attempts to use
a single instance for all threads.

I wrote a patch for this and made a pull request for James, but he
probably hasn't had time to get to it yet.

Allen

On Jun 30, 8:31 am, James Reeves <jree...@weavejester.com> wrote:
> That's odd. As far as I'm aware, HTTP date formats are not localised.
>
> Perhaps java.text.DateFormat object is locale-aware, and it's trying
> to parse the date for the ru_RU locale.
>
> Could you perhaps provide a dump of all of the HTTP headers in the request?
>
> - James
>

James Reeves

unread,
Jul 2, 2010, 5:49:56 PM7/2/10
to ring-c...@googlegroups.com
Yes, sorry; I was in an NYC hotel all this week, so not much time to
look at patches :)

- James

Reply all
Reply to author
Forward
0 new messages