fdk-java icon indicating copy to clipboard operation
fdk-java copied to clipboard

Insufficient detail in message when flow invocations cannot be cast to receiever types

Open zootalures opened this issue 8 years ago • 0 comments

This shouldn't happen (tm) but there are a few places where it's technically possible for types to get mixed up (including around updates etc).

When datum object can't be assigned to the receiver type you get something like the error below.

This should be clearer as it's very hard to work out where this is coming from and why.

(this is compounded by #91)

java.lang.ClassCastException: com.fnproject.fn.runtime.flow.SerUtils$2 cannot be cast to java.base/java.lang.String
com.fnproject.fn.api.flow.FlowCompletionException: java.lang.ClassCastException: com.fnproject.fn.runtime.flow.SerUtils$2 cannot be cast to java.base/java.lang.String
	at com.fnproject.fn.runtime.flow.RemoteCompleterApiClient.waitForCompletion(RemoteCompleterApiClient.java:245)
	at com.fnproject.fn.runtime.flow.RemoteCompleterApiClient.waitForCompletion(RemoteCompleterApiClient.java:264)
	at com.fnproject.fn.runtime.flow.RemoteFlow$RemoteFlowFuture.get(RemoteFlow.java:148)
	at com.fnproject.fn.integration.ExerciseEverything.handleRequest(ExerciseEverything.java:440)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.fnproject.fn.runtime.MethodFunctionInvoker.tryInvoke(MethodFunctionInvoker.java:41)
	at com.fnproject.fn.runtime.EntryPoint.run(EntryPoint.java:87)
	at com.fnproject.fn.runtime.EntryPoint.main(EntryPoint.java:27)
Caused by: java.lang.ClassCastException: com.fnproject.fn.runtime.flow.SerUtils$2 cannot be cast to java.base/java.lang.String
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.fnproject.fn.runtime.flow.FlowContinuationInvoker.invokeContinuation(FlowContinuationInvoker.java:184)
	at com.fnproject.fn.runtime.flow.FlowContinuationInvoker.lambda$tryInvoke$1(FlowContinuationInvoker.java:133)
	at com.fnproject.fn.runtime.ReadOnceInputEvent.consumeBody(ReadOnceInputEvent.java:56)
	at com.fnproject.fn.runtime.flow.FlowContinuationInvoker.tryInvoke(FlowContinuationInvoker.java:99)

zootalures avatar Nov 14 '17 19:11 zootalures