camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-2692) Multithreading bug: getBody sporadically returns null
Date Thu, 06 May 2010 08:58:42 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-2692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59219#action_59219
] 

Claus Ibsen commented on CAMEL-2692:
------------------------------------

I have tested it on both Mac OS and Windows
{code}
C:\workspace\camel\camel-core>mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_18
Java home: C:\jdk1.6.0_18\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
{code}

And I cannot reproduce it. I do not have a Windows 7 machine with 64bit JDK.

> Multithreading bug: getBody sporadically returns null
> -----------------------------------------------------
>
>                 Key: CAMEL-2692
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2692
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.3.0
>         Environment: Windows 7 64 bit, JDK 1.6.0_20
>            Reporter: Roland Knight
>            Assignee: Claus Ibsen
>         Attachments: news_20100502000001.zip
>
>
> Note that the only workaround for this bug is to remove the parallelProcessing() call
in the builder.
> I have a simple route that processes a file by splitting on a tag and processing the
DOM of each split message. The problem is that getBody is randomly returning null but ONLY
when using the parallelProcessing feature of split. For some runs of the same XML file, the
error does not occur at all (the file is about 2MB of data), others it will happen once or
twice. I am currently using the latest 2.3-SNAPSHOT. 
> Also note, that after detecting the null, I tried calling getBody(String.class) - this
also may return null. Sometimes it does return the proper XML. 
> Route configuration that reproduces the problem (my input XML is about 2MB with about
500 article tags): 
>         public void configure() throws Exception { 
>           from("file:D:/inbox") 
>             .split(new XPathBuilder("//article")) 
>               .parallelProcessing()                     // remove this line getBody below
never returns null 
>               .process(new Processor() { 
>                 public void process(Exchange exchange) throws Exception { 
>                   Message inMessage = exchange.getIn(); 
>                   org.w3c.dom.Document domDocument = inMessage.getBody(org.w3c.dom.Document.class);

>                   if (domDocument == null) { 
>                     log("Null body"); 
>                   } else { 
>                     // process DOM here 
>                   } 
>                 } 
>               }) 
>             .end() 
>         } 
>       }); 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message