Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-3206

REST endpoint returns Expiry header in default locale for the server

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 5.3.0.CR2, 5.3.0.Final
    • 5.2.6.Final, 5.3.0.CR1
    • None
    • None

    Description

      Rest endpoint uses RESTEasy to generate responses and uses .expires(date) method of the respective response builder. However, the currently used RESTEasy version (org.jboss.resteasy:resteasy-jaxrs:jar:2.3.2.Final) uses the server's default locale (in my case it was cs_CZ) which caused the Expiry header to have the following format: Čt, 06 VI 2013 19:24:02 CEST (also see RESTEASY-887). OTOH, the 2.3.2 version of RESTEasy generates Last-Modified always in US locale.

      It is also causing some tests to fail on different locales than US, e.g.:

      testHotRodEmbeddedPutRestGetExpiry(org.infinispan.it.compatibility.EmbeddedRestHotRodTest) Time elapsed: 0.023 sec <<< FAILURE!
      java.text.ParseException: Unparseable date: "?t, 06 VI 2013 16:32:04 CEST"
      at java.text.DateFormat.parse(DateFormat.java:357)
      at org.infinispan.it.compatibility.EmbeddedRestHotRodTest.assertDate(EmbeddedRestHotRodTest.java:291)
      at org.infinispan.it.compatibility.EmbeddedRestHotRodTest.testHotRodEmbeddedPutRestGetExpiry(EmbeddedRestHotRodTest.java:256)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
      at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
      at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
      at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
      at org.testng.TestRunner.privateRun(TestRunner.java:767)
      at org.testng.TestRunner.run(TestRunner.java:617)
      at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
      at org.testng.SuiteRunner.access$000(SuiteRunner.java:37)
      at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:368)
      at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:722)
      

      We should ensure that the Expiry header is returned in US locale as well and not to be server specific.

      Attachments

        Activity

          People

            mgencur Martin Gencur
            mgencur Martin Gencur
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: