Error "ClassCastException: java.util.LinkedHashMap cannot be cast to ..." while calling kie-server REST API
Issue
When trying to write an HTTP client to call REST API / endpoints on kie-server and pass in a custom POJO/business object, we get errors like below:
13:17:15,449 ERROR [org.kie.server.remote.rest.jbpm.ProcessResource] (default task-49) Unexpected error during processing [my-process:9 - My Task:6] -- java.util.LinkedHashMap cannot be cast to com.example.custom.pojo.Employee: org.jbpm.workflow.instance.WorkflowRuntimeException: [my-process:9 - My Task:6] -- java.util.LinkedHashMap cannot be cast to com.example.custom.pojo.Employee
......
Caused by: java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.example.custom.pojo.Employee
Environment
- Red Hat Process Automation Manager (RHPAM)
- 7.x
- Red Hat Decision Manager (RHDM)
- 7.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.