Uploaded image for project: 'VPMS Web Application'
  1. OVPMS-1995

GMT timezones cause Internal Server Errors in Smart Flow Sheet

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects versions: 1.9
    • Fix versions: 2.0
    • Components: Smart Flow Sheet
    • Labels:
      None
    • Sprint:

      Description

      If the timezone returned by TimeZone.getDefault() is a GMT offest (e.g. GMT+10:00), calls to create hospitalizations in SFS fail with an http 500 status (Internal Server Error), with the error message 'An error has occurred'.

      This is because SFS doesn't support GMT timezones.

      E.g.:

      1 > POST https://www.smartflowsheet.com/api/v3/hospitalization
      1 > Accept: application/json
      1 > clinicApiKey: somekey
      1 > Content-Type: application/json
      1 > emrApiKey: somekey
      1 > timezoneName: GMT+10:00
      ....
      01 Jan 2018 16:32:59,419 ERROR DialogErrorHandler,http-bio-8080-exec-1862:69 - DHW - An error has occurred.
      org.openvpms.smartflow.client.FlowSheetException: SFS-0101: Failed to create Flow Sheet for Fido
      ....
      Caused by: javax.ws.rs.InternalServerErrorException: An error has occurred.
          at org.openvpms.smartflow.client.ErrorResponseFilter.filter(ErrorResponseFilter.java:91)
          at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:140)
          at org.glassfish.jersey.client.ClientFilteringStages$ResponseFilterStage.apply(ClientFilteringStages.java:128)
          at org.glassfish.jersey.process.internal.Stages.process(Stages.java:171)
          at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:260)
          at org.glassfish.jersey.client.JerseyInvocation$3.call(JerseyInvocation.java:722)
          at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
          at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
          at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
          at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
          at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:718)
          at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:459)
          at org.glassfish.jersey.client.proxy.WebResourceFactory.invoke(WebResourceFactory.java:343)
          at com.sun.proxy.$Proxy40.add(Unknown Source)
          at org.openvpms.smartflow.client.HospitalizationService.add(HospitalizationService.java:196)
          ... 80 more
      

      The timezone submitted in the timezoneName header comes from TimeZone.getDefault().getID().
      If this is a GMT offset, it probably indicates a misconfiguration of the server.
      If it cannot be corrected, the workaround is to set the correct timezone by passing -Duser.timezone to the tomcat command line e.g.:

      -Duser.timezone=Australia/Melbourne
      

        Attachments

          Activity

            People

            • Assignee:
              tanderson Tim Anderson
              Reporter:
              tanderson Tim Anderson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h
                2h

                  Who's Looking?