2016-05-16 142 views

回答

0

也许你投入的dropins捆还没有被激活。

要检查它是否是积极的,可以按如下方式开始OSGI控制台模式WSO2 CEP服务器: 转到<CEP_HOME>/bin和执行命令(假设你使用Linux):

./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文件的以下部分。它使用Export-Package元素暴露了某些包。

<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] http://movingaheadblog.blogspot.com/2014/01/how-to-debug-wso2-carbon-products-using.html

[2] https://isurues.wordpress.com/2009/01/01/useful-equinox-osgi-commands

[3] http://wso2.com/library/articles/getting-started-wso2-carbon/