Installing and running Web Management Console in Apache Felix OSGI

偶尔善良 提交于 2019-12-01 02:20:45
Marco Vargas

I had similar issues, I resolved them by clearing up the Felix installation, then I started the Felix from scratch, this means, I had something like this on the 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! 

So, on the console, just add the following command

list -v

It will give you the list of available packages, so, just look for the Webconsole package name and run this (always on the Gogo console):

g! deploy org.apache.felix.webconsole

This will download the required libraries, and print the following on the Console:

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! 

So, now, if you run lb (list bundles command)

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!

So, now, just look for the bundles "HTTP Service" and "Apache Felix Web Management Console" and start them:

g! start 10
g! start 12

And finally, just go the the path (default port is 8080):

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

By the way, you can change the port on the config.properties (in Felix) by just adding the following parameter:

org.osgi.service.http.port=28372

Hope this may help somebody else...

Finally I get it.

In a blank Felix installation:

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
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!