Error "ClassCastException: java.util.LinkedHashMap cannot be cast to ..." while calling kie-server REST API

Solution Unverified - Updated -

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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content