Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.6.0, 2.7.0, 2.8.0
-
None
-
ServiceMix 4.x (OSGI environment), Blueprint route definition.
-
Unknown
Description
The following (blueprint) route produces a NullPointerException :
<route id="restproxy"> <from uri="restlet:http://localhost:9080/oe/ws/offre/{id}"/> <doTry> <to uri="restlet:http://bla.dot.com:8080/oe/ws/offre/{id}"/> <doCatch> <exception>org.apache.camel.component.restlet.RestletOperationException</exception> </doCatch> </doTry> </route>
This happens for when catching any exception classes that does not belong to camel-core or to the classpath (in a OSGI environment).
The NullPointerException is caused by the following statement in class org.apache.camel.model.CatchDefinition, method createExceptionClasses() :
Class<Exception> type = CastUtils.cast(ObjectHelper.loadClass(name, getClass().getClassLoader()));
i.e. the class is not found by the class loader.
A work-around is to activate dev:dynamic-import on the camel-core bundle.