You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[2022-09-27T13:04:49.852Z] Exception: ClassCastException: com.microsoft.azure.functions.worker.binding.ExecutionContextDataSource cannot be cast to java.lang.String
[2022-09-27T13:04:49.852Z] Stack: java.lang.ClassCastException: com.microsoft.azure.functions.worker.binding.ExecutionContextDataSource cannot be cast to java.lang.String
[2022-09-27T13:04:49.852Z] at com.microsoft.azure.functions.worker.binding.DataOperations.apply(DataOperations.java:99)
[2022-09-27T13:04:49.852Z] at com.microsoft.azure.functions.worker.binding.DataSource.computeByType(DataSource.java:56)
[2022-09-27T13:04:49.852Z] at com.microsoft.azure.functions.worker.binding.BindingDataStore.getDataByType(BindingDataStore.java:70)
[2022-09-27T13:04:49.852Z] at com.microsoft.azure.functions.worker.broker.ParameterResolver.resolve(ParameterResolver.java:65)
[2022-09-27T13:04:49.852Z] at com.microsoft.azure.functions.worker.broker.ParameterResolver.resolve(ParameterResolver.java:42)
[2022-09-27T13:04:49.852Z] at com.microsoft.azure.functions.worker.broker.JavaMethodExecutorImpl.execute(JavaMethodExecutorImpl.java:51)
[2022-09-27T13:04:49.852Z] at com.microsoft.azure.functions.worker.broker.JavaFunctionBroker.invokeMethod(JavaFunctionBroker.java:61)
[2022-09-27T13:04:49.852Z] at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:33)
[2022-09-27T13:04:49.852Z] at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:10)
[2022-09-27T13:04:49.852Z] at com.microsoft.azure.functions.worker.handler.MessageHandler.handle(MessageHandler.java:45)
[2022-09-27T13:04:49.852Z] at com.microsoft.azure.functions.worker.JavaWorkerClient$StreamingMessagePeer.lambda$onNext$0(JavaWorkerClient.java:92)
[2022-09-27T13:04:49.852Z] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[2022-09-27T13:04:49.852Z] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2022-09-27T13:04:49.852Z] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2022-09-27T13:04:49.852Z] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2022-09-27T13:04:49.852Z] at java.lang.Thread.run(Thread.java:750)
This seems to be happening because at runtime, ParameterResolver in the java worker library cannot find the @RabbitMQTrigger annotation to get the parameter name to map the inputMessage to a function parameter. I created my own @CustomTrigger annotation (below) and it started to work fine.
abaratham-nlok
changed the title
Classcast Exception - ExecutionContextDataSource cannot be cast to java.lang.String
ClassCast Exception - ExecutionContextDataSource cannot be cast to java.lang.String
Sep 27, 2022
Hello,
I am getting a ClassCastException when running a RabbitMQTriggered Java function
Core Tools Version: 4.0.4785 Commit hash: N/A (64-bit)
Function Runtime Version: 4.10.4.19213
Gradle dependency versions and azurefunctions plugin config:
I have also tried downgrading the core tools and java runtime worker to version ~3, and azure-functions-java-library to 1.4.2.
Function definition:
The error:
This seems to be happening because at runtime, ParameterResolver in the java worker library cannot find the @RabbitMQTrigger annotation to get the parameter name to map the inputMessage to a function parameter. I created my own @CustomTrigger annotation (below) and it started to work fine.
The text was updated successfully, but these errors were encountered: