<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why Message Object does not represent file content? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Why-Message-Object-does-not-represent-file-content/m-p/2355467#M121209</link>
    <description>&lt;P&gt;Hi gjeremy,&lt;/P&gt;&lt;P&gt;Unfortunately I get an error with your code. Find below the error !![&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;ERROR]: org.apache.camel.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID-LAPTOP-FDV0N478-1626698516345-0-2 on ExchangeId: ID-LAPTOP-FDV0N478-1626698516345-0-1). Exhausted after delivery attempt: 1 caught: java.lang.ClassCastException: org.apache.camel.component.file.GenericFile cannot be cast to [B&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Message History&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;---------------------------------------------------------------------------------------------------------------------------------------&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;RouteId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ProcessorId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Processor&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Elapsed (ms)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;[Lab4_route1_cFile_] [Lab4_route1_cFile_] [file://C:/rep1?autoCreate=true&amp;amp;bufferSize=128&amp;amp;flatten=true&amp;amp;noop=false&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;] [&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8]&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;[Lab4_route1_cFile_] [Lab4_route1_cProce] [Processor@0x6ebaaba3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;] [&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3]&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Stacktrace&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;---------------------------------------------------------------------------------------------------------------------------------------&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;java.lang.ClassCastException: org.apache.camel.component.file.GenericFile cannot be cast to [B&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at demoesb.lab4_route1_0_1.Lab4_route1$1.process(Lab4_route1.java:145)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:110)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at demoesb.lab4_route1_0_1.Lab4_route1$2$1$1.process(Lab4_route1.java:224)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:110)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.Pipeline.process(Pipeline.java:138)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:452)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:219)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:183)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.util.concurrent.FutureTask.runAndReset(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.lang.Thread.run(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jul 2021 12:49:32 GMT</pubDate>
    <dc:creator>taslimanka</dc:creator>
    <dc:date>2021-07-19T12:49:32Z</dc:date>
    <item>
      <title>Why Message Object does not represent file content?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Why-Message-Object-does-not-represent-file-content/m-p/2355465#M121207</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am a newbie on talend ESB.&lt;/P&gt;&lt;P&gt;I'm trying to get the content of files put in the source folder. And for that, I typed in the following expression.&lt;/P&gt;&lt;P&gt;&lt;B&gt;System.out.println("File content: "+exchange.getIn().getBody());&amp;nbsp;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000GiB4zAAF.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145865iB3FBF32A27B79ACD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000GiB4zAAF.png" alt="0695b00000GiB4zAAF.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Unfortunately it doesn't print the file I put content's.&lt;/P&gt;&lt;P&gt;&lt;U&gt;Example:&lt;/U&gt; when I put a text file containing "lorem ipsum" , I am expecting to print that content to the output console but instead I get printed to the console GenericFile[C:\rep1\Finish.log] (see image below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000GiB6vAAF.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/153254iAC7002432007F6B7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000GiB6vAAF.png" alt="0695b00000GiB6vAAF.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I want to figure out why Message object doesn't represent the file content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:56:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Why-Message-Object-does-not-represent-file-content/m-p/2355465#M121207</guid>
      <dc:creator>taslimanka</dc:creator>
      <dc:date>2024-11-15T23:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why Message Object does not represent file content?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Why-Message-Object-does-not-represent-file-content/m-p/2355466#M121208</link>
      <description>&lt;P&gt;Hi ,@mohamed sylla​&amp;nbsp;, &lt;/P&gt;&lt;P&gt;maybe you can try : &lt;/P&gt;&lt;P&gt;&lt;B&gt;System.out.println("File content: "+ new String(&lt;/B&gt;(byte[]) exchange.&lt;A href="https://www.tabnine.com/code/java/methods/org.apache.camel.Exchange/getIn" alt="https://www.tabnine.com/code/java/methods/org.apache.camel.Exchange/getIn" target="_blank"&gt;getIn&lt;/A&gt;().&lt;A href="https://www.tabnine.com/code/java/methods/org.apache.camel.Message/getBody" alt="https://www.tabnine.com/code/java/methods/org.apache.camel.Message/getBody" target="_blank"&gt;getBody&lt;/A&gt;()&lt;B&gt;));&amp;nbsp;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;let me know if it's working.&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Send me love and Kudos&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 08:15:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Why-Message-Object-does-not-represent-file-content/m-p/2355466#M121208</guid>
      <dc:creator>gjeremy1617088143</dc:creator>
      <dc:date>2021-07-19T08:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why Message Object does not represent file content?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Why-Message-Object-does-not-represent-file-content/m-p/2355467#M121209</link>
      <description>&lt;P&gt;Hi gjeremy,&lt;/P&gt;&lt;P&gt;Unfortunately I get an error with your code. Find below the error !![&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;ERROR]: org.apache.camel.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID-LAPTOP-FDV0N478-1626698516345-0-2 on ExchangeId: ID-LAPTOP-FDV0N478-1626698516345-0-1). Exhausted after delivery attempt: 1 caught: java.lang.ClassCastException: org.apache.camel.component.file.GenericFile cannot be cast to [B&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Message History&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;---------------------------------------------------------------------------------------------------------------------------------------&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;RouteId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ProcessorId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Processor&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Elapsed (ms)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;[Lab4_route1_cFile_] [Lab4_route1_cFile_] [file://C:/rep1?autoCreate=true&amp;amp;bufferSize=128&amp;amp;flatten=true&amp;amp;noop=false&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;] [&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8]&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;[Lab4_route1_cFile_] [Lab4_route1_cProce] [Processor@0x6ebaaba3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;] [&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3]&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Stacktrace&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;---------------------------------------------------------------------------------------------------------------------------------------&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;java.lang.ClassCastException: org.apache.camel.component.file.GenericFile cannot be cast to [B&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at demoesb.lab4_route1_0_1.Lab4_route1$1.process(Lab4_route1.java:145)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:110)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at demoesb.lab4_route1_0_1.Lab4_route1$2$1$1.process(Lab4_route1.java:224)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:110)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.Pipeline.process(Pipeline.java:138)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:452)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:219)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:183)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.util.concurrent.FutureTask.runAndReset(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;	at java.lang.Thread.run(Unknown Source)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 12:49:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Why-Message-Object-does-not-represent-file-content/m-p/2355467#M121209</guid>
      <dc:creator>taslimanka</dc:creator>
      <dc:date>2021-07-19T12:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why Message Object does not represent file content?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Why-Message-Object-does-not-represent-file-content/m-p/2355468#M121210</link>
      <description>&lt;P&gt;it seem you can use the getFile()method of &lt;B&gt;org.apache.camel.component.file.GenericFile to get the file,&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;then you have to read his content&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;with common io package for example&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;String data = FileUtils.readFileToString(your file, "UTF-8");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 13:00:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Why-Message-Object-does-not-represent-file-content/m-p/2355468#M121210</guid>
      <dc:creator>gjeremy1617088143</dc:creator>
      <dc:date>2021-07-19T13:00:47Z</dc:date>
    </item>
  </channel>
</rss>

