2013-10-22 81 views
1

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

我已经安装了费利克斯的Http码头2.2.1捆绑,Felic配置管理服务1.8.0捆绑,日志服务1.0.1捆绑,1.3.2的EventAdmin捆绑和Felix的Web管理控制台4.2.0

当我尝试启动Web管理控制台,它说:

org.osgi.framework.BundleException:软件包 “org.apache.felix.webconsole_4.2.0 [29]” 无法得到解决。原因:缺少约束:导入包:org.apache.commons.fileupload;版本=“[1.2.0,2.0.0)”

我使用Java 1.6.0.26,Ubuntu 12.10!

[email protected]:/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 [email protected]: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! 

问候

+0

顺便说一句,我m不使用Eclipse。 – JonathanVila

回答

1

最后我明白了。

在空白菲利克斯安装:

g! bundlelevel -i 1 
g! mvnrepo = http://repo2.maven.org/maven2 
g! start $mvnrepo/commons-io/commons-io/1.4/commons-io-1.4.jar 
g! start $mvnrepo/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar 
g! start http://maven.ow2.org/maven2/org/json/org.ow2.chameleon.commons.json/20090911-0002/org.ow2.chameleon.commons.json-20090911-0002.jar 
g! bundlelevel -i 5 
g! start $mvnrepo/org/apache/felix/org.apache.felix.webconsole/4.2.0/org.apache.felix.webconsole-4.2.0.jar 
2

我有类似的问题,我通过清理Felix的安装解决了他们的话,我从头开始菲利克斯,这意味着,我有这样的事情上Apache的费利克斯·戈戈:

____________________________ 
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 

它会给你提供的软件包列表,所以,只认准Web控制台包名称和(在勾勾控制台上总是)运行此:

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! 

所以,现在,如果你运行磅(名单捆绑命令)

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! 

所以,现在,只是认准捆绑 “HTTP服务” 和“阿帕奇菲利克斯Web管理控制台”并启动:

g! start 10 
g! start 12 

最后,刚去的路径(默认端口为8080):

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

顺便说一句,你可以改变的配置端口的.properties(Felix的)只需添加以下参数:

org.osgi.service.http.port=28372 

希望这可以帮助别人......

+0

@JohnSaunders:您的其中一个编辑回到了这里。我不确定我是否可以因为[this](http://meta.stackoverflow.com/q/320874)而与其他用户有关 - 也许您可能会考虑处理/标记它?谢谢。 – halfer

+0

无论@John,马可在另一篇文章中对此事给予了厚爱。 – halfer

相关问题