简体   繁体   English

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

[英]Not able to execute custom function extension in wso2 cep

I am using wso2cep 4.1.0 and have created custom function extension class with following package name: 我正在使用wso2cep 4.1.0并创建了具有以下包名的自定义函数扩展类:

package org.wso2.siddhi.extension.custom;

.....

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

Then I have created file : custom.siddhiext 然后我创建了文件: custom.siddhiext

An put following entry into it. 放入以下内容。

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

I have created jar including both of above files. 我创建了包含上述两个文件的jar。 I have created maven project for above. 我为上面创建了maven项目。

Then i put this jar to /repository/components/dropins folder. 然后我把这个jar放到/ repository / components / dropins文件夹中。

And restarted cep wso2server. 并重新启动cep wso2server。

Now i am executing following execution plan: 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" 验证流时的异常,异常:'mycount'既不是函数扩展,也不是执行计划“ExecutionPlan”中的聚合属性扩展

It seems like jar i put in dropin folder is not read by wso2server but i followed steps stated in [ https://docs.wso2.com/display/CEP410/Writing+a+Custom+Function+Extension] 似乎jar放入dropin文件夹中的jar不是由wso2server读取的,但是我按照[ https://docs.wso2.com/display/CEP410/Writing+a+Custom+Function+Extension]中的步骤进行了操作

anybody have face similar issues or have solution for it. 任何人都面临类似的问题或有解决方案。

During restart of wso2cepserver i get following ERROR: 在重启wso2cepserver期间,我得到以下错误:

ERROR {org.wso2.carbon.server.extensions.DropinsBundleDeployer} - Required Bundle manifest headers do not exists: /home/analytics/wso2cep-4.1 .0/repository/components/dropins/function-extension-1.0-SNAPSHOT.jar 错误{org.wso2.carbon.server.extensions.DropinsBundleDeployer} - 必需的Bundle清单头不存在:/home/analytics/wso2cep-4.1 .0 / repository / components / dropins / function-extension-1.0-SNAPSHOT.jar

I assume that you're using the maven-bundle-plugin to build the bundle. 我假设您正在使用maven-bundle-plugin来构建捆绑包。 If so, in your extension project pom file, recheck maven-bundle-plugin configurations. 如果是这样,在您的扩展项目pom文件中,重新检查maven-bundle-plugin配置。

Check whether the Bundle-SymbolicName has being provided to the plugin. 检查Bundle-SymbolicName是否已提供给插件。 You may refer to this example of another extension, being written to Siddhi . 您可以参考另一个扩展的示例,写入Siddhi

According to the source code (the source of Carbon 4.4.3 DropinsBundleDeployer which deploys the bundles we put into the dropins folder), this error could occur: 根据源代码 (Carbon 4.4.3 DropinsBundleDeployer 的源代码 ,它部署了我们放入dropins文件夹的bundle),可能会发生以下错误:

  1. when the Bundle-SymbolicName has not being given or 什么时候没有给出Bundle-SymbolicName或者
  2. when the Bundle-Version has not being given. 什么时候没有给出Bundle-Version

So in case, putting the Bundle-SymbolicName in to the config didn't make a difference, I would try adding the Bundle-Version as well. 因此,如果将Bundle-SymbolicName放入配置中并没有什么区别,我会尝试添加Bundle-Version You can find a sample config in this maven-bundle-plugin tutorial . 您可以在此maven-bundle-plugin教程中找到示例配置。

Do you have any other extension which has the same org.wso2.siddhi.extension.custom package name? 你有任何其他扩展名具有相同的org.wso2.siddhi.extension.custom包名吗? If so try renaming the package to something else. 如果是这样,请尝试将包重命名为其他内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM