You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2014/11/30 16:34:13 UTC

[jira] [Assigned] (CAMEL-7785) setUnitOfWork in DefaultExchange throws NPE when called from Splitter.java

     [ https://issues.apache.org/jira/browse/CAMEL-7785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-7785:
----------------------------------

    Assignee: Claus Ibsen

> setUnitOfWork in DefaultExchange throws NPE when called from Splitter.java
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-7785
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7785
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.12.2
>            Reporter: Dye357
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: easyfix
>             Fix For: 2.14.1, 2.15.0, 2.13.4
>
>
> setUnitOfWork in DefaultExchange throws NPE when called from Splitter.java, 
> Line 226 of Splitter.java is: exchange.setUnitOfWork(null);
> Line 372 of DefaultExchange.java checks if onCompletions !=null, in this case because Splitter.java initialized unitOfWork to null on line 376 unitOfWork.addSynchronization(onCompletion) will throw an NPE since unitOfWork is still null.
> Recommendation:
> Line 372 of defaultExchange.java should include a check if unitOfWork is not null:
> if(onCompletions !=null && unitOfWork != null)
> Steps to reproduce:
> 1. Include a Split EIP in a Camel Route.
> 2. Specify an onPrepareRef=<class>
> 3. Add an onCompletion step to the exchange in <class>
> 4. NPE should be thrown when processing files.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)