java.lang.ClassCastException when returning an object in a Camel direct-vm invocation.
Issue
Running an application that connects two Camel routes using the Camel direct-vm component.
Both routes run as separate OSGi bundles.
Now, when the invocation to the direct-vm endpoint returns an object a ClassCastException is raised, similar to
13:59:11,742 | ERROR | qtp450940431-649 | DefaultErrorHandler | 130 - org.apache.camel.camel-core -
2.10.0.redhat-60024 | Failed delivery for (MessageId: ID-mac-fritz-box-57446-1391517345547-8-2 on ExchangeId:
ID-mac-fritz-box-57446-1391517345547-9-1). Exhausted after delivery attempt: 1 caught:
java.lang.ClassCastException: com.mycompany.session.management.impl.SessionImpl cannot be cast to
com.mycompany.session.management.Session
Both, the interface Session and the implemenation class SessionImpl are part of the bundle that consumes from the direct-vm endpoint.
Environment
- Fuse Mediation Router 2.10.x
- JBoss Fuse 6.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
