NullPointerException when catching exceptions
---------------------------------------------

                 Key: CAMEL-4326
                 URL: https://issues.apache.org/jira/browse/CAMEL-4326
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.8.0, 2.7.0, 2.6.0
         Environment: ServiceMix 4.x (OSGI environment), Blueprint route 
definition.
            Reporter: Cedric de Launois
            Priority: Minor


The following (blueprint) route produces a NullPointerException :

{code:xml}
<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>
{code}

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() :
{code}
Class<Exception> type = CastUtils.cast(ObjectHelper.loadClass(name, 
getClass().getClassLoader()));
{code}
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.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to