我编写了一个自定义事件适配器,并将jar放置在丢弃文件夹中,但是CLI没有显示自定义日志记录,也没有显示在输出适配器中。
我阅读了4.1.0指南,但没有成功,我试着阅读了以下的源代码:
http://dist.wso2.org/maven2/org/wso2/carbon/org.wso2.carbon.event.input.adaptor.email/1.0.1/
发布于 2016-05-17 05:58:50
也许您放入下拉列表中的包还没有激活。
要检查它是否是活动的,您可以在OSGI模式下启动WSO2 CEP服务器,如下所示:转到<CEP_HOME>/bin并执行命令(假设您使用的是<CEP_HOME>/bin):
./wso2server.sh -DosgiConsole服务器启动后,您将看到OSGI提示符。
osgi>然后运行ss <bundle_name>类型
例如:
ss org.wso2.carbon.event.output.adapter.custom.websocket样本输出:
id State Bundle
285 RESOLVED org.wso2.carbon.event.output.adapter.custom.websocket_5.0.12.SNAPSHOT它将向您展示包是否处于活动状态。
如果它未处于活动状态,则可以使用其ID (例如)来诊断包。
diag 285这将显示缺少导入包的列表。
您可以参考1和2来了解OSGI控制台命令。
然后确保公开那些使用您的包pom文件。例如,请参阅pom文件的以下部分。它使用元素公开了某些包。
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Private-Package>
org.wso2.carbon.event.output.adapter.websocket.local.internal,
org.wso2.carbon.event.output.adapter.websocket.local.internal.*
</Private-Package>
<Export-Package>
!org.wso2.carbon.event.output.adapter.websocket.local.internal,
!org.wso2.carbon.event.output.adapter.websocket.local.internal.*,
org.wso2.carbon.event.output.adapter.websocket.local.*,
</Export-Package>
<Import-Package>
org.wso2.carbon.event.output.adapter.core.*,
javax.xml.namespace; version=0.0.0,
*;resolution:=optional,
</Import-Package>
<DynamicImport-Package>*</DynamicImport-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>3也可能有一些有用的信息。
参考文献
1
3
https://stackoverflow.com/questions/37260891
复制相似问题