每当我尝试在spring-xd中使用python模块时,我都会收到以下错误:
[ stream create pytest --definition "time | shell --command='python /home/Ubuntu/xd/echo2.py' --encoder=LF | log" --deploy]
[]
2016-03-21T19:23:38+0000 1.2.0.RELEASE INFO DeploymentsPathChildrenCache-0 container.DeploymentListener - Path cache event: path=/deployments/modules/allocated/ed02510e-f8b3-4f53-9848-e2268fbbade1/pytest.processor.shell.1, type=CHILD_ADDED
2016-03-21T19:23:38+0000 1.2.0.RELEASE INFO DeploymentsPathChildrenCache-0 container.DeploymentListener - Deploying module 'shell' for stream 'pytest'
2016-03-21T19:23:38+0000 1.2.0.RELEASE INFO DeploymentsPathChildrenCache-0 container.DeploymentListener - Deploying module [ModuleDescriptor@1c30c1dd moduleName = 'shell', moduleLabel = 'shell', group = 'pytest', sourceChannelName = [null], sinkChannelName = [null], index = 1, type = processor, parameters = map['command' -> 'python /home/Ubuntu/xd/echo2.py', 'encoder' -> 'LF'], children = list[[empty]]]
2016-03-21T19:23:39+0000 1.2.0.RELEASE ERROR SimpleAsyncTaskExecutor-1 process.ShellCommandProcessor - python: can't open file '/home/Ubuntu/xd/echo2.py': [Errno 2] No such file or directory
2016-03-21T19:23:39+0000 1.2.0.RELEASE INFO DeploymentsPathChildrenCache-0 container.DeploymentListener - Path cache event: path=/deployments/modules/allocated/ed02510e-f8b3-4f53-9848-e2268fbbade1/pytest.source.time.1, type=CHILD_ADDED
2016-03-21T19:23:39+0000 1.2.0.RELEASE INFO DeploymentsPathChildrenCache-0 container.DeploymentListener - Deploying module 'time' for stream 'pytest'
2016-03-21T19:23:39+0000 1.2.0.RELEASE INFO DeploymentsPathChildrenCache-0 container.DeploymentListener - Deploying module [ModuleDescriptor@5133da1 moduleName = 'time', moduleLabel = 'time', group = 'pytest', sourceChannelName = [null], sinkChannelName = [null], index = 0, type = source, parameters = map[[empty]], children = list[[empty]]]
2016-03-21T19:23:39+0000 1.2.0.RELEASE INFO DeploymentSupervisor-0 zk.ZKStreamDeploymentHandler - Deployment status for stream 'pytest': DeploymentStatus{state=deployed}
2016-03-21T19:23:39+0000 1.2.0.RELEASE ERROR task-scheduler-1 process.ShellCommandProcessor - Stream closed
java.io.IOException: Stream closed
at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:434) ~[na:1.7.0_95]
at java.io.OutputStream.write(OutputStream.java:116) ~[na:1.7.0_95]
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) ~[na:1.7.0_95]
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) ~[na:1.7.0_95]
at org.springframework.integration.ip.tcp.serializer.ByteArraySingleTerminatorSerializer.serialize(ByteArraySingleTerminatorSerializer.java:94) ~[spring-integration-ip-4.1.5.RELEASE.jar!/:na]
答案 0 :(得分:0)
根据我的经验,10次中有9次,这是由于python进程在幕后崩溃并且XD处理器没有意识到它。检查你的日志以查看python进程,以验证它是否仍在运行。