cadence-workflow / cadence-java-samples

Other
97 stars 60 forks source link

HelloException sample fails on Windows #16

Closed khaale closed 1 week ago

khaale commented 5 years ago

HelloException fails on Windows platform with the following stacktrace

Exception in thread "main" com.uber.cadence.converter.DataConverterException: when parsing:"{"workflowExecution":{"workflowId":"ba15f8ca-160d-3e37-a53a-ea0a055e874f","runId":"98124ba6-1d8b-404f-a64c-21764b345be6"},"workflowType":{"n
ame":"GreetingChild::composeGreeting"},"eventId":10,"detailMessage":"when parsing:\"{\"activityType\":{\"name\":\"G" into following types: [class com.uber.cadence.workflow.ChildWorkflowFailureException]
        at com.uber.cadence.converter.JsonDataConverter.fromData(JsonDataConverter.java:163)
        at com.uber.cadence.internal.sync.WorkflowStubImpl.mapToWorkflowFailureException(WorkflowStubImpl.java:263)
        at com.uber.cadence.internal.sync.WorkflowStubImpl.getResult(WorkflowStubImpl.java:194)
        at com.uber.cadence.internal.sync.WorkflowStubImpl.getResult(WorkflowStubImpl.java:162)
        at com.uber.cadence.internal.sync.WorkflowInvocationHandler.startWorkflow(WorkflowInvocationHandler.java:246)
        at com.uber.cadence.internal.sync.WorkflowInvocationHandler.invoke(WorkflowInvocationHandler.java:183)
        at com.sun.proxy.$Proxy3.getGreeting(Unknown Source)
        at com.uber.cadence.samples.hello.HelloException.main(HelloException.java:177)
Caused by: java.lang.NullPointerException: stackTrace[0]
        at java.base/java.lang.Throwable.setStackTrace(Unknown Source)
        at com.uber.cadence.converter.JsonDataConverter$ThrowableTypeAdapterFactory$3.read(JsonDataConverter.java:334)
        at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
        at com.google.gson.TypeAdapter.fromJsonTree(TypeAdapter.java:285)
        at com.uber.cadence.converter.JsonDataConverter$ThrowableTypeAdapterFactory$3.read(JsonDataConverter.java:333)
        at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
        at com.google.gson.TypeAdapter.fromJsonTree(TypeAdapter.java:285)
        at com.uber.cadence.converter.JsonDataConverter$ThrowableTypeAdapterFactory$3.read(JsonDataConverter.java:333)
        at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
        at com.google.gson.Gson.fromJson(Gson.java:927)
        at com.google.gson.Gson.fromJson(Gson.java:892)
        at com.google.gson.Gson.fromJson(Gson.java:841)
        at com.uber.cadence.converter.JsonDataConverter.fromData(JsonDataConverter.java:161)
        ... 7 more
khaale commented 5 years ago

It looks like the issue was caused by platform-inconsistent custom stacktrace serialization/deserialization at currently referenced 2.2.0 java client version (fixed by https://github.com/uber/cadence-java-client/pull/291) . Locally I've fixed it bumping client version to 2.5.0. Does it make sense to bump it here too?