Hi,

I'm currently migrating an OSGI application from Camel 2.25 to 3.21. I've
encountered a change in the way onException deals with the type it's asked
to handle in an OSGI environment.

In 2.25 the OnExceptionDefinition instance keeps a reference to the classes
it's asked to handle (in the exceptionClasses field).

In 3.x it just stores the names of the exception classes it should handle.
When the ProcessorReifier builds the route it then loads the required
classes named on the definition.

My issue is that my camel context is created in one OSGi bundle (with one
classloader) and the route added from a different bundle (with its own
classloader). In 2.x this worked fine. In 3.x the route can't be started
(as the context's classloader can't see the exception class).

This design is used to permit plugin modules to add their own routes to the
core application's context.

Has anyone experienced the same issue and found a solution? I don't want to
add Import-Package instructions to the bundle with the Camel Context - as
this would break the plugin module design. Using DynamicImport-Package: *
in my camel context bundle does resolve the issue but doesn't seem ideal  -
my plugin bundle should be resolving the exception class.

Thanks,
Paul

Reply via email to