haoch / flink-siddhi

A CEP library to run Siddhi within Apache Flink™ Streaming Application (Not maintained)
Apache License 2.0
243 stars 96 forks source link

在Flink环境下运行,自定义函数抛出异常 “XXX is neither a function extension nor an aggregated attribute extension” #42

Closed hipotato closed 5 years ago

hipotato commented 5 years ago

自定义了一个函数geo:getGeohashCode,在纯siddhi环境中可以正常运行,在flink-siddhi环境下,按文档的要求增加了函数的注册 SiddhiCEP cep = SiddhiCEP.getSiddhiEnvironment(env); cep.registerExtension("geo:getGeohashCode", GetGeohashCode.class); 在Idea编译器中可以正常运行,执行jar包抛出异常: org.apache.flink.client.program.ProgramInvocationException: The main method caused an error: Error on '1136e420-2a7d-4f2b-82df-7f674737add3' @ Line: 3. Position: 128, near 'geo:getGeohashCode(lat, lon, 10)'. 'getGeohashCode' is neither a function extension nor an aggregated attribute extension at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:546) at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:421) at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:423) at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:813) at org.apache.flink.client.cli.CliFrontend.runProgram(CliFrontend.java:287) at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:213) at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:1050) at org.apache.flink.client.cli.CliFrontend.lambda$main$11(CliFrontend.java:1126) at org.apache.flink.runtime.security.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30) at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1126) 请问各位大牛这个问题如何解决。

hipotato commented 5 years ago

已解决,依赖问题

faf-xff commented 5 years ago

已解决,依赖问题 请问怎么解决依赖问题呢