【发布时间】:2018-09-11 12:15:15
【问题描述】:
我正在按照toturial 开发基于 OSGi 的 TornadoFX 桌面应用程序。在开始编码之前,我想准备 OSGi 环境。为此,我安装了 Apache Felix 5.6.10 和所需的包。
Felix 和所有必需的包都可以正常工作,如下所示(lb 命令的输出):
ID|State |Level|Name
0|Active | 0|System Bundle (5.6.10)|5.6.10
1|Active | 1|Apache Commons Logging (1.2.0)|1.2.0
2|Active | 1|Apache Apache HttpClient OSGi bundle (4.5.5)|4.5.5
3|Active | 1|Apache Apache HttpCore OSGi bundle (4.4.9)|4.4.9
4|Active | 1|jansi (1.16.0)|1.16.0
5|Resolved | 1|JavaFX 8 OSGi extension bundle (8.0.1)|8.0.1
7|Active | 1|JLine Bundle (3.5.1)|3.5.1
8|Active | 1|kotlin-osgi-bundle (1.2.31)|1.2.31
9|Active | 1|Apache Felix Bundle Repository (2.0.10)|2.0.10
10|Active | 1|Apache Felix Configuration Admin Service (1.8.16)|1.8.16
11|Active | 1|Apache Felix Gogo Command (1.0.2)|1.0.2
12|Active | 1|Apache Felix Gogo JLine Shell (1.0.10)|1.0.10
13|Active | 1|Apache Felix Gogo Runtime (1.0.10)|1.0.10
18|Active | 1|Apache Felix Gogo Shell (1.0.0)|1.0.0
22|Active | 1|JSR 353 (JSON Processing) Default Provider (1.0.0)|1.0.0
但是,我无法启动 TornadoFX 捆绑包!我用install tornadofx-1.7.15.jar安装了tornadofx-1.7.15.jar,没问题,但是当我尝试start它时,抛出了以下异常:
我在命令行上使用java -jar bin/felix.jar 来启动Felix。所有感兴趣的包都在 Felix 根文件夹下的 bundle 文件夹中。另外,我试图让它在 IntelliJ 下工作,但这可以是一个独立的线程。
org.osgi.framework.BundleException: Unable to resolve no.tornado.tornadofx [26](R 26.0):
missing requirement [no.tornado.tornadofx [26](R 26.0)] osgi.wiring.package; (osgi.wiring.package=com.sun.glass.ui) Unresolved requirements:
[[no.tornado.tornadofx [26](R 26.0)] osgi.wiring.package; (osgi.wiring.package=com.sun.glass.ui)]
现在的问题是,我怎样才能让它发挥作用?我应该事先安装任何其他捆绑包吗? com.sun.glass.ui 是什么以及如何将其添加到包或类路径中?
【问题讨论】:
-
我使用的安装命令是
install bundle/tornadofx-1.7.15.jar,而命令提示符位于Felix的根目录。
标签: osgi apache-felix tornadofx