安装Apache Felix OSGI Framework小记

本文详细介绍了如何下载、安装并配置Apache Felix服务框架。包括如何启动felix,列出并操作bundle,以及安装并配置HTTP服务和felix控制台bundle。通过本地访问localhost:8080/system/console即可进入felix的控制台。

    Felix是apache的开源OSGI服务框架,到 http://felix.apache.org/downloads.cgi 可以下载到最新的版本。

    解压后目录结构如下:

    felix-framework-4.2.1

        -bin

        -bundle

        -conf

        -doc

    bin目录下是felix.jar

    bundle下面的bundle会在启动时自动安装

    conf下面是配置文件

    1. 启动felix

         启动命令行,并定位到安装目录,

         执行 java -jar ./bin/felix.jar 这会使用默认的配置,如果需指定另一个配置文件,则要

         执行java -Dfelix.config.properties=file:./conf/config.properties -jar ./bin/felix.jar

         执行成功,我们会看到felix的 gogo已经可以使用,这是felix的shell.

     2.  执行lb可以列出当前的bundle的状态

          install file:./bundle/***.jar

          start bundleID

          这样就可以安装和启动一个bundle了

     3. 安装http服务和felix控制台bundle

          http://felix.apache.org/documentation/subprojects/apache-felix-http-service.html#installing   这是http的详细介绍

 

  • org.apache.felix.http.jetty - HTTP Service implementation that is embedding Jetty server.
  • org.apache.felix.http.whiteboard - Whiteboard implementation that uses any HTTP Service implementation.
  • org.apache.felix.http.bridge - HTTP Service implementation that uses the host applicaiton server (bridged mode). Must be used with proxy.
  • org.apache.felix.http.bundle - All in one bundle that includes all of the above.
  • org.apache.felix.http.proxy - Proxy that is needed inside WAR when deployed inside an application server.
       这里说只要org.apache.felix.http.bundle就可以了,我试了下,发现只安装这个仍然不行,还是要安装org.apache.felix.http.jetty
       安装了jetty后,localhost:8080才能访问
       在下载页面下载Web Console (all-in-one bundle) 并安装这个bundle,之后通过
       localhost:8080/system/console 就可以访问felix的控制台了。

 

 


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值