Satyam
Satyam

Reputation: 361

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:

package org.wso2.siddhi.extension.custom;

.....

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

Then I have created file : custom.siddhiext

An put following entry into it.

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

I have created jar including both of above files. I have created maven project for above.

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

And restarted 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"

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]

anybody have face similar issues or have solution for it.

During restart of wso2cepserver i get following ERROR:

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

Upvotes: 4

Views: 1193

Answers (2)

Grainier
Grainier

Reputation: 1654

Do you have any other extension which has the same org.wso2.siddhi.extension.custom package name? If so try renaming the package to something else.

Upvotes: 0

Dilini
Dilini

Reputation: 787

I assume that you're using the maven-bundle-plugin to build the bundle. If so, in your extension project pom file, recheck maven-bundle-plugin configurations.

Check whether the Bundle-SymbolicName has being provided to the plugin. You may refer to this example of another extension, being written to 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:

  1. when the Bundle-SymbolicName has not being given or
  2. when the Bundle-Version has not being given.

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. You can find a sample config in this maven-bundle-plugin tutorial.

Upvotes: 1

Related Questions