We're updating the issue view to help you get more done. 

GMT timezones cause Internal Server Errors in Smart Flow Sheet

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 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 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.:

1 -Duser.timezone=Australia/Melbourne

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Components

Fix versions

Affects versions

1.9

Priority

Minor