apache-felix - 在 Apache Felix OSGI 中安装并运行 Web 管理控制台

标签 apache-felix

我尝试在 Apache Felix 4.2.1 中安装并运行 Apache Felix Web 管理控制台 (4.2.0),但它不起作用。

我已经安装了 Felix Http Jetty 2.2.1 bundle 、Felic Configuration Admin Service 1.8.0 bundle 、Log Service 1.0.1 bundle 、EventAdmin 1.3.2 bundle 和 Felix Web Management Console 4.2.0

当我尝试启动 Web 管理控制台时,它显示:

org.osgi.framework.BundleException: The bundle "org.apache.felix.webconsole_4.2.0 [29]" could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.commons.fileupload; version="[1.2.0,2.0.0)"

我使用的是 Java 1.6.0.26,Ubuntu 12.10!

jonathan@JONATHAN:/datos/jonathan/Programas/apache-felix-framework-4.2.1$ java -jar bin/felix.jar 

2013-10-22 16:38:37.389:INFO:oejs.Server:jetty-7.x.y-SNAPSHOT
2013-10-22 16:38:37.412:INFO:oejsh.ContextHandler:started o.e.j.s.ServletContextHandler{/,null}

____________________________
Welcome to Apache Felix Gogo

g! 2013-10-22 16:38:37.434:INFO:oejs.AbstractConnector:Started <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e4b78188818790a78c858a8a8188a78b8a8a8187908b96a4d4cad4cad4cad4" rel="noreferrer noopener nofollow">[email protected]</a>:8888

lb

START LEVEL 1
ID|State      |Level|Name
0|Active     |    0|OSGi System Bundle (3.7.2.v20120110-1415)
1|Active     |    1|Apache Felix Bundle Repository (1.6.6)
2|Active     |    1|Apache Felix Gogo Command (0.12.0)
3|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
4|Active     |    1|Apache Felix Gogo Shell (0.10.0)
23|Active     |    1|Apache Felix Configuration Admin Service (1.8.0)
24|Active     |    1|Apache Felix Log Service (1.0.1)
26|Active     |    1|Apache Felix Http Jetty (2.2.1)
27|Active     |    1|Apache Felix EventAdmin (1.3.2)
29|Installed  |    1|Apache Felix Web Management Console (4.2.0)
g! start 29

org.osgi.framework.BundleException: The bundle "org.apache.felix.webconsole_4.2.0 [29]" >could not be resolved. Reason: Missing Constraint: Import-Package:     org.apache.commons.fileupload; version="[1.2.0,2.0.0)"

g!

问候

最佳答案

我遇到了类似的问题,我通过清理 Felix 安装解决了这些问题,然后我从头开始了 Felix,这意味着,我在 Apache Felix Gogo 上遇到了类似的问题:

____________________________
Welcome to Apache Felix Gogo

g! lb
START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (4.6.0)
    1|Active     |    1|Apache Felix Bundle Repository (2.0.2)
    2|Active     |    1|Apache Felix Gogo Command (0.14.0)
    3|Active     |    1|Apache Felix Gogo Runtime (0.12.1)
    4|Active     |    1|Apache Felix Gogo Shell (0.10.0)
g! 

所以,在控制台上,只需添加以下命令

list -v

它将为您提供可用软件包的列表,因此,只需查找 Webconsole 软件包名称并运行它(始终在 Gogo 控制台上):

g! deploy org.apache.felix.webconsole

这将下载所需的库,并在控制台上打印以下内容:

Target resource(s):
-------------------
   Apache Felix Web Management Console (3.1.2)

Required resource(s):
---------------------
   Apache Felix Configuration Admin Service (1.2.4)
   Apache Felix Http Bundle (2.0.4)
   Apache Felix Log Service (1.0.0)
   Apache Felix HTTP Service Jetty (1.0.0)

Optional resource(s):
---------------------
   OSGi R4 Compendium Bundle (4.0.0)
   Apache Felix Declarative Services (1.6.0)
   Apache Felix iPOJO (1.8.0)
   Apache Felix iPOJO WebConsole Plugins (1.6.0)
   Apache Felix Shell Service (1.4.2)

Deploying...
done.
g! 

现在,如果您运行 lb(列出 bundle 命令)

g! lb
START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (4.6.0)
    1|Active     |    1|Apache Felix Bundle Repository (2.0.2)
    2|Active     |    1|Apache Felix Gogo Command (0.14.0)
    3|Active     |    1|Apache Felix Gogo Runtime (0.12.1)
    4|Active     |    1|Apache Felix Gogo Shell (0.10.0)
    5|Installed  |    1|Apache Felix Configuration Admin Service (1.2.4)
    6|Installed  |    1|Apache Felix Http Bundle (2.0.4)
    7|Installed  |    1|Apache Felix Log Service (1.0.0)
    8|Installed  |    1|OSGi R4 Compendium Bundle (4.0.0)
    9|Installed  |    1|Apache Felix Declarative Services (1.6.0)
   10|Installed  |    1|HTTP Service (1.0.0)
   11|Installed  |    1|Apache Felix iPOJO (1.8.0)
   12|Installed  |    1|Apache Felix Web Management Console (3.1.2)
   13|Installed  |    1|Apache Felix iPOJO WebConsole Plugins (1.6.0)
   14|Installed  |    1|Apache Felix Shell Service (1.4.2)
g!

现在,只需查找 bundle “HTTP Service”和“Apache Felix Web Management Console”并启动它们:

g! start 10
g! start 12

最后,只需转到路径(默认端口为 8080):

http://localhost:28372/system/console/bundles

顺便说一句,您只需添加以下参数即可更改 config.properties(在 Felix 中)上的端口:

org.osgi.service.http.port=28372

希望这对其他人有帮助......

关于apache-felix - 在 Apache Felix OSGI 中安装并运行 Web 管理控制台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19521622/

相关文章:

java - 如何管理嵌入式 OSGi 应用程序中的 bundle /依赖项?

java - Weld-osgi-bundle-2.2.10.Final 无法解析 sun.misc

java - 如何在 apache felix 上实现异步处理?

java - 如何让 OSGi ScriptEngineManager 运行

maven - 在其他服务之前激活 OSGI LogListener?

java - 在 OSGi 环境中开始使用捆绑 DI

java - 无法解析 1.0 : missing requirement [1. 0] osgi.wiring.package; (&(osgi.wiring.package=

java - 使用嵌入式 OSGi 容器

java - Apache Felix DOSGI 单一包和 Zookeeper

java - Apache Felix SCR @Reference 速查表