`
freewxy
  • 浏览: 342671 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

OSGi框架环境搭建(Equinox)

    博客分类:
  • osgi
 
阅读更多


 1、启动eclipse,打开Run Configurations对话框

   Run-->Run Configuratios

 

2、创建OSGi Framework类型的新的运行配置

 

3、显示所有的Bundles

 

4、取消对Bundles的选择

 

5、选择org.eclipse.osgi这个Bundle

 

6、运行。点击Run按钮,如果Console中出现“osgi>”并且没有错误信息,说明环境已经正常了。我们可以在osig>提示符后输入ss,然后回车。如图:

 输入ss:

 

环境搭建完成!
 
 

 

 

  • 大小: 91.2 KB
  • 大小: 41.2 KB
  • 大小: 160 KB
  • 大小: 89.5 KB
  • 大小: 82.7 KB
  • 大小: 23 KB
  • 大小: 31.4 KB
0
3
分享到:
评论
3 楼 fhzdzq 2014-11-15  
2楼报了很多错 console没有显示ss> 这是什么原因 难道eclipse缺少插件。多谢
2 楼 fhzdzq 2014-11-15  
!SESSION 2014-11-15 22:25:25.399 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_05
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=zh_CN
Command-line arguments:  -dev file:E:/workspace/.metadata/.plugins/org.eclipse.pde.core/osgi/dev.properties -os win32 -ws win32 -arch x86 -consoleLog -console

!ENTRY org.eclipse.equinox.console 4 0 2014-11-15 22:25:26.038
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.console_1.0.100.v20130429-0953 [2]" could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.felix.service.command; version="0.8.0"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.eclipse.osgi 4 0 2014-11-15 22:25:26.046
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.equinox.console_1.0.100.v20130429-0953.jar was not resolved.

!ENTRY org.eclipse.osgi 4 0 2014-11-15 22:25:26.050
!MESSAGE Could not start bundle: org.eclipse.equinox.console
!STACK 0
org.osgi.framework.BundleException: Could not start bundle: org.eclipse.equinox.console
at org.eclipse.osgi.framework.internal.core.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:217)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:298)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.console_1.0.100.v20130429-0953 [2]" could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.felix.service.command; version="0.8.0"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
at org.eclipse.osgi.framework.internal.core.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:215)
... 10 more
Root exception:
org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.console_1.0.100.v20130429-0953 [2]" could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.felix.service.command; version="0.8.0"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
at org.eclipse.osgi.framework.internal.core.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:215)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:298)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

!ENTRY org.eclipse.osgi 2 0 2014-11-15 22:25:26.065
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2014-11-15 22:25:26.065
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.equinox.console_1.0.100.v20130429-0953.jar was not resolved.
!SUBENTRY 2 org.eclipse.equinox.console 2 0 2014-11-15 22:25:26.066
!MESSAGE Missing imported package org.apache.felix.service.command_0.8.0.

!ENTRY org.eclipse.osgi 2 0 2014-11-15 22:25:26.070
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2014-11-15 22:25:26.070
!MESSAGE Bundle org.eclipse.equinox.console_1.0.100.v20130429-0953 [2] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.console 2 0 2014-11-15 22:25:26.070
!MESSAGE Missing imported package org.apache.felix.service.command_0.8.0.
!SUBENTRY 2 org.eclipse.equinox.console 2 0 2014-11-15 22:25:26.071
!MESSAGE Missing optionally imported package org.osgi.service.cm_0.0.0.
1 楼 di1984HIT 2014-05-21  
谢谢,简单易用

相关推荐

    OSGI环境搭建以及简单使用

    OSGI 环境搭建和简单使用需要通过下载 Equinox SDK,安装到 Eclipse 中,然后创建不同的 plug-in project,注册和卸载服务,最终调用服务。OSGI 环境提供了一个动态的、可扩展的框架,允许开发者创建、部署和管理...

    OSGi开发环境建立和Hello World

    Equinox的核心实际上是一个jar包,这个jar包不仅具有作为标准Java包执行的能力,还是一个bundle,这意味着它包含了OSGi bundle特有的元数据,可以被OSGi框架识别和管理。 搭建OSGi开发环境包括几个步骤: 1. 下载...

    Equinox OSGi应用嵌入Jersey框架搭建REST服务

    在本文中,我们将讨论如何在Equinox OSGi环境中嵌入Jersey框架来构建RESTful Web服务。Jersey是JAX-RS(Java API for RESTful Web Services)规范的参考实现,它提供了一种创建高效、高质量REST服务的方法。 首先,...

    使用Equinox开发OSGI应用程序工程及源码

    2. **Equinox环境搭建**:首先,需要安装Eclipse IDE,然后通过Eclipse的插件管理器安装OSGi开发所需的Equinox SDK。这样,我们就可以在Eclipse中创建和管理OSGi Bundle项目。 3. **创建OSGi Bundle**:在Eclipse中...

    osgi基础demo-搭建servlet

    在这个“osgi基础demo-搭建servlet”项目中,我们将探讨如何在OSGi环境中创建并运行一个简单的Servlet应用程序。 首先,我们需要理解OSGi的核心概念。OSGi基于服务导向架构,每个模块称为一个Bundle,每个Bundle...

    OSGi Web示例工程

    在OSGi框架中,Equinox是Eclipse基金会提供的一个实现,它是OSGi规范的主要实现之一,广泛应用于服务器端开发。Equinox提供了一个强大的、可扩展的运行时环境,支持动态模块加载和卸载,使得开发者可以灵活地更新和...

    osgi gemini blueprint环境

    3. **环境搭建**:包括安装和配置OSGi运行时环境(如Equinox或Felix),以及添加Gemini Blueprint相关的库和依赖。 4. **服务组件定义**:描述如何使用XML或注解定义Blueprint服务组件,包括服务接口、实现类和元...

    spring-dm-osgi整合jar包

    3. OSGi框架库:如`org.eclipse.osgi`,这是实现OSGi规范的实现,例如Equinox或Felix。 4. 依赖的第三方库:如`log4j`, `slf4j`等日志框架,以及可能的网络或数据库连接库。 整合Spring DM和OSGi的过程通常包括以下...

    OSGI进阶.pdf

    - **环境准备**:搭建OSGi框架环境,例如使用Apache Felix或Equinox作为容器。 - **MVC框架模块**:实现一个简单的MVC框架,用于处理请求、显示视图以及管理模型数据。 - **留言列表模块**:实现留言的展示逻辑,...

    OSGI study

    1. **选择OSGi框架**:目前主流的OSGi框架有Apache Felix、Equinox等。根据具体需求选择合适的框架。 2. **安装OSGi框架**:下载并安装所选框架,例如Apache Felix或Eclipse Equinox。安装过程可能包括配置环境变量...

    osgi-webservice教程

    1. **环境搭建**:首先,你需要一个支持OSGi的运行时环境,如Apache Felix或Eclipse Equinox。然后,将Axis相关的库导入到OSGi环境中,确保它们正确地被解析和加载。 2. **创建服务**:编写你的业务逻辑,将其封装...

    Spring OSGI 快速入门中文教程

    - **选择OSGi实现**:如Apache Felix、Equinox等,它们提供了运行时环境。 - **集成Spring**:引入Spring OSGi相关的库,如spring-osgi-core、spring-osgi-io等。 - **配置Bundle**:创建Manifest.MF文件,声明...

    Getting Started with OSGi_ Part1

    在这篇文章中,读者将学会如何搭建OSGi开发环境,并通过基本命令来管理OSGi框架,这是深入学习OSGi开发之前的必要准备工作。文章通过一个简单的例子,展示了OSGi模块化的基本概念和开发的便捷性。它也向读者传达了一...

    关于OSGI的详细资料

    6. **测试部署**:在Equinox环境中安装并启动创建的bundle,进行测试。 #### 示例代码简述 下面展示了一个简单的`HelloServlet`类,该类继承自`HttpServlet`,并重写了`doGet`和`doPost`方法: ```java public ...

    OSGi传说beta1.1.pdf

    这通常涉及到安装OSGi框架(如Equinox)、部署Bundle以及配置必要的环境参数。 **步骤**: 1. 安装OSGi框架。 2. 配置Bundle。 3. 运行自定义的Bundle。 #### 六、使用Declarative Services (DS)管理服务 ...

    OSGi学习资料包教程.zip

    2. **环境搭建**:指导如何设置开发环境,包括选择和安装合适的OSGi框架,配置IDE支持等。 3. **Bundle创建**:教授如何编写和打包Bundle,包括定义MANIFEST.MF文件,声明导出和导入包,以及编写启动类。 4. **服务...

    osgi文档

    在实践中,开发者可以利用Apache Felix、Equinox等开源实现来搭建OSGi环境。同时,工具如Eclipse IDE提供了对OSGi的支持,方便开发和调试。学习OSGi的过程中,理解模块依赖关系、配置管理、服务生命周期以及如何在...

    OSGi learning materials

    它涵盖了OSGi的开发环境搭建,如Eclipse Equinox或Apache Felix等实现。书中通过一系列实例展示了如何创建、打包和部署OSGi模块,以及如何使用OSGi的命令行工具进行管理和调试。此外,还讨论了如何利用OSGi进行服务...

Global site tag (gtag.js) - Google Analytics