首页 文章

无法在wso2 cep中执行自定义函数扩展

提问于
浏览
4

我正在使用 wso2cep 4.1.0 并使用以下包名创建了自定义函数扩展类:

package org.wso2.siddhi.extension.custom;

.....

public class MyFunction extends FunctionExecutor {
.....
}

然后我创建了文件: custom.siddhiext

放入以下内容 .

mycount=org.wso2.siddhi.extension.custom.MyFunction

我创建了包含上述两个文件的jar . 我为上面创建了maven项目 .

Then i put this jar to /repository/components/dropins folder.

并重新启动cep wso2server .

现在我正在执行以下执行计划: My execution plan:

from inputstream#window.timeBatch( 1 sec )

select custom:mycount(param1) as outparam
insert into outputstream;

On creating outputsteam i get following exception:

Exception when validating the stream, exception : 'mycount' is neither a function extension nor an aggregated attribute extension in execution plan "ExecutionPlan"

看起来像我放在dropin文件夹中的jar不是由wso2server读取的,但我按照[https://docs.wso2.com/display/CEP410/Writing+a+Custom+Function+Extension]中所述的步骤

任何人都面临类似的问题或有解决方案 .

在重启wso2cepserver期间,我得到以下错误:

ERROR - 必需的Bundle清单头不存在:/home/analytics/wso2cep-4.1 .0 / repository / components / dropins / function-extension-1.0-SNAPSHOT.jar

2 回答

  • 1

    我假设您使用maven-bundle-plugin来构建捆绑包 . 如果是这样,在您的扩展项目pom文件中,重新检查maven-bundle-plugin配置 .

    检查 Bundle-SymbolicName 是否已提供给插件 . 你可以参考this example of another extension, being written to Siddhi .

    According to the source code(Carbon 4.4.3 DropinsBundleDeployer的源代码,它部署了我们放入dropins文件夹的包),可能会发生以下错误:

    • 何时没有给出 Bundle-SymbolicName

    • 何时没有给出 Bundle-Version .

    因此,如果将 Bundle-SymbolicName 放入配置中并没有什么区别,我会尝试添加 Bundle-Version . 您可以在此maven-bundle-plugin tutorial中找到示例配置 .

  • 0

    您是否有任何其他具有相同 org.wso2.siddhi.extension.custom 包名称的扩展名?如果是这样,请尝试将包重命名为其他内容 .

相关问题