我正在迁移到bndtools一些我创建并在标准 Eclipse 环境中工作的 osgi 插件。我添加了Felix Web Console和Jetty HTTP Service ,并用Felix等价物 替换了一些Equinox捆绑包。
当我运行一个需要org.restlet.jar的特定包时,该包会解析但不会激活。控制台输出是:
____________________________ 欢迎使用 Apache Felix Gogo
G!2015-05-25 00:06:33.471:INFO:oejs.Server:jetty-7.xy-SNAPSHOT 2015-05-25 00:06:33.545:INFO:oejsh.ContextHandler:started oejsServletContextHandler{/,null} 2015- 05-25 00:06:33.620:INFO:oejs.AbstractConnector:开始 SelectChannelConnector@0.0.0.0:8080 !无法启动捆绑包 org.restlet-2.3.2.v20150501-1520,异常激活器错误 com/sun/net/httpserver/HttpHandler 来自:org.restlet.engine.Engine:registerDefaultConnectors#839
我已经尝试过基于其他问题的解决方案,即这个建议设置运行属性org.osgi.framework.system.packages.extra = com.sun.net.httpserver
(大概在我的 bndtools .bnd 文件中)的解决方案,以及另一个建议使用框架侦听器激活Restlet应用程序的解决方案——但这些不适用于我,和控制台输出是一样的。
我仍在学习,我将不胜感激任何导致解决方案的帮助,或者关于bndtools或Eclipse可能提供的任何方法或功能的提示,以帮助我追踪其原因。
顺便说一句,Felix Web Console正在工作,作为同一个插件的必需捆绑包。
这是我的 bndtools 配置:
Bundle-Version: 0.0.0.${tstamp}
Service-Component: \
*
-runfw: org.apache.felix.framework;version='[4,5)'
-runee: JavaSE-1.7
-runsystemcapabilities: ${native_capability}
-resolve.effective: active;skip:="osgi.service"
-buildpath: \
osgi.core,\
osgi.cmpn,\
biz.aQute.bnd.annotation,\
org.apache.felix.log,\
com.fiscio.api;version=latest,\
osgi.enterprise,\
org.restlet,\
org.restlet.ext.json,\
org.json
-runbundles: \
com.fiscio.api;version=latest,\
org.apache.felix.configadmin;version='[1.8.0,1.8.1)',\
org.apache.felix.gogo.command;version='[0.14.0,0.14.1)',\
org.apache.felix.gogo.runtime;version='[0.16.2,0.16.3)',\
org.apache.felix.gogo.shell;version='[0.10.0,0.10.1)',\
org.apache.felix.http.jetty;version='[2.2.2,2.2.3)',\
org.apache.felix.log;version='[1.0.1,1.0.2)',\
org.apache.felix.metatype;version='[1.0.10,1.0.11)',\
org.apache.felix.scr;version='[1.8.2,1.8.3)',\
org.apache.felix.webconsole;version='[4.2.2,4.2.3)',\
org.json;version='[1.0.0,1.0.1)',\
org.restlet;version='[2.3.2,2.3.3)',\
org.restlet.ext.json;version='[2.3.2,2.3.3)',\
osgi.cmpn;version='[5.0.0,5.0.1)',\
osgi.enterprise;version='[4.2.0,4.2.1)'
-runrequires: \
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.command)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.webconsole)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.configadmin)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.metatype)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.log)',\
osgi.identity;filter:='(&(osgi.identity=osgi.cmpn)(version>=4.2))',\
osgi.identity;filter:='(&(osgi.identity=org.apache.felix.scr)(version>=1.6.0))',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.http.jetty)',\
osgi.identity;filter:='(osgi.identity=com.fiscio.api)',\
osgi.identity;filter:='(osgi.identity=org.json)',\
osgi.identity;filter:='(osgi.identity=org.restlet.ext.json)',\
osgi.identity;filter:='(osgi.identity=org.restlet)'
## Uncomment if you need to change the HTTP port
-runproperties: org.osgi.framework.system.packages.extra = com.sun.net.httpserver
Private-Package: \
com.fiscio.rest,\
com.fiscio.rest.resources