camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-7785) setUnitOfWork in DefaultExchange throws NPE when called from Splitter.java
Date Sun, 30 Nov 2014 15:52:12 GMT

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

Claus Ibsen resolved CAMEL-7785.
--------------------------------
    Resolution: Fixed

> 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)

Mime
View raw message