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] Resolved: (CAMEL-2687) exec component fails after receiving empty output
Date Thu, 06 May 2010 15:30:52 GMT

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

Claus Ibsen resolved CAMEL-2687.
--------------------------------

    Fix Version/s: 2.3.0
       Resolution: Fixed

Thanks Chuck for reporting and testing.

Yeah the goal of Camel is being very flexible and useable in any kind of business. 
And the lovely is that the community is kicking ass and adding components to Camel.

> exec component fails after receiving empty output
> -------------------------------------------------
>
>                 Key: CAMEL-2687
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2687
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.3.0
>         Environment: windows XP, jdk 1.6
>            Reporter: Chuck Adams
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> I have a simple route here:
> {quote}
> public void configure() {
>     from("timer://foo?period=5000")
>     .to("C:/apps/putty/PLINK.EXE?args=cadams@labmachine  -i C:/apps/putty/priv/chuck.ppk
\"ls /tmp/foo\"")
>     .to("log:experiments.cameltest");
> }
> {quote}
> This just runs a dummy command on a remote machine every five seconds.  Normally it has
no problems as long as /tmp/foo has contents.  For example, I create 'bar' and 'baz' files,
and the log reflects this:
> {quote}
> [                          main] DefaultCamelContext            INFO  Apache Camel 2.3-SNAPSHOT
(CamelContext: camelContext) started in 734 millis
> [                           foo] ExecProducer                   INFO  Executing ExecCommand
[args=[cadams@labmachine, -i, C:/apps/putty/priv/chuck.ppk, ls /tmp/foo], executable=C:/apps/putty/PLINK.EXE,
timeout=9223372036854775807, outFile=null, workingDir=null]
> [                           foo] ExecProducer                   INFO  The command ExecCommand
[args=[cadams@labmachine, -i, C:/apps/putty/priv/chuck.ppk, ls /tmp/foo], executable=C:/apps/putty/PLINK.EXE,
timeout=9223372036854775807, outFile=null, workingDir=null] had exit value 0
> [                           foo] cameltest                      INFO  Exchange[ExchangePattern:InOnly,
BodyType:org.apache.camel.component.exec.ExecResult, Body:bar
> baz
> blah
> ]
> [                           foo] ExecProducer                   INFO  Executing ExecCommand
[args=[cadams@spamlab-bizintel-corpus01.eng.symantec.com, -i, C:/apps/putty/priv/chuck.ppk,
ls /tmp/foo], executable=C:/apps/putty/PLINK.EXE, timeout=9223372036854775807, outFile=null,
workingDir=null]
> [                           foo] ExecProducer                   INFO  The command ExecCommand
[args=[cadams@spamlab-bizintel-corpus01.eng.symantec.com, -i, C:/apps/putty/priv/chuck.ppk,
ls /tmp/foo], executable=C:/apps/putty/PLINK.EXE, timeout=9223372036854775807, outFile=null,
workingDir=null] had exit value 0
> [                           foo] cameltest                      INFO  Exchange[ExchangePattern:InOnly,
BodyType:org.apache.camel.component.exec.ExecResult, Body:bar
> baz
> blah
> ]
> {quote}
> And so on....  But if I delete both files, this is what happens:
> {quote}
> [                           foo] ExecProducer                   INFO  Executing ExecCommand
[args=[cadams@labmachine, -i, C:/apps/putty/priv/chuck.ppk, ls /tmp/foo], executable=C:/apps/putty/PLINK.EXE,
timeout=9223372036854775807, outFile=null, workingDir=null]
> [                           foo] ExecProducer                   INFO  The command ExecCommand
[args=[cadams@labmachine, -i, C:/apps/putty/priv/chuck.ppk, ls /tmp/foo], executable=C:/apps/putty/PLINK.EXE,
timeout=9223372036854775807, outFile=null, workingDir=null] had exit value 0
> [                           foo] ExecResultConverter            WARN  Received null stdout
of the ExecResult for conversion!
> [                           foo] DefaultTypeConverter           WARN  Overriding type
converter from: StaticMethodTypeConverter: public static java.lang.String org.apache.camel.component.exec.ExecResultConverter.convertToString(org.apache.camel.component.exec.ExecResult,org.apache.camel.Exchange)
throws java.io.FileNotFoundException to: org.apache.camel.impl.converter.ToStringTypeConverter@1e3d24a
> [                           foo] cameltest                      INFO  Exchange[ExchangePattern:InOnly,
BodyType:org.apache.camel.component.exec.ExecResult, Body:org.apache.camel.component.exec.ExecResult@d767dc]
> {quote}
> And from that point on, even if I add files to the directory again, I get nothing back,
just the following log section over and over.  It seems that the behavior of suddenly switching
the converter to ToStringTypeConverter had the effect of suppressing all output for good.
 
> {quote}
> [                           foo] ExecProducer                   INFO  Executing ExecCommand
[args=[cadams@labmachine, -i, C:/apps/putty/priv/chuck.ppk, ls /tmp/foo], executable=C:/apps/putty/PLINK.EXE,
timeout=9223372036854775807, outFile=null, workingDir=null]
> [                           foo] ExecProducer                   INFO  The command ExecCommand
[args=[cadams@labmachine, -i, C:/apps/putty/priv/chuck.ppk, ls /tmp/foo], executable=C:/apps/putty/PLINK.EXE,
timeout=9223372036854775807, outFile=null, workingDir=null] had exit value 0
> [                           foo] cameltest                      INFO  Exchange[ExchangePattern:InOnly,
BodyType:org.apache.camel.component.exec.ExecResult, Body:org.apache.camel.component.exec.ExecResult@3aacb4]
> {quote}
> This behavior is certainly unexpected and undesireable.  I've been working around this
by making my remote script always produce some dummy output when they otherwise have nothing
to return, but any workaround I could use on the Camel side pending a more permanent fix would
be very much appreciated.

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