ClassCastException on Camel route when the Drools version is updated from 6.x to 7.x

Solution Verified - Updated -

Issue

  • When migrating the Drools version from 6.x to 7.x, the following exception is raised
org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[???]
...
Caused by: java.lang.ClassCastException: org.drools.core.command.runtime.BatchExecutionCommandImpl cannot be cast to org.kie.api.runtime.ExecutionResults
...

Environment

  • Migration from Drools 6 libraries to Drools 7 libraries
  • The code worked flawlessly on Drools 6
  • The Camel route is pointing to a KIE engine running in the same container as the Camel code
  • Camel route "kie" component defined as:
from( "direct:start" ).to( "kie://ksession1" )

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