最近,我下载了1.7.0版本,并尝试部署以下内容
stream create amqp-to-hdfs --definition "mqtt-source-rabbit
--username=admin --password=pwd --url=/path/to/host--topics=dmj/ccs/sms/stream |
scriptable-transform --language=python --script='return \"payload\"' |
hdfs --fs-uri=hdfs://path/to/hdfs:9000 --directory=/path/to/recording --file-name=ingest"但是,由于以下问题,此操作无法启动:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.stream.app.scriptable.transform.processor.ScriptableTransformProcessorConfiguration':
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transformer' defined in
org.springframework.cloud.stream.app.scriptable.transform.processor.ScriptableTransformProcessorConfiguration:
Invocation of init method failed; nested exception is
java.lang.IllegalArgumentException: javax.script.ScriptEngineManager is
unable to create a script engine for language 'python'这很奇怪,因为我确实安装了python,如果我将语言和脚本值更改为基于ruby的代码,一切都会正常工作。但是,我需要使用Python来完成此任务。
有什么想法吗?
发布于 2019-01-31 02:24:33
可脚本化转换器将要求您声明函数,您将在函数定义的末尾调用该函数
def myFunction(firstVar, lastVar):
return firstVar +" some addition "+ lastVar;
myFunction("First ", " Second ")https://stackoverflow.com/questions/52979193
复制相似问题