在eclipse中配置OSGI运行环境

OSGI详解 对OSGI框架的理解和实践,欢迎各位大佬进行点评; 阅读详情

在eclipse中配置OSGI运行环境运行环境

在eclipse中搭建运行环境,eclipse的版本很关键,也正如OSGI的文档中所描述的那样。

既然是基于 Equinox,自然要先下 Equinox,但由于 Equinox 是 Eclipse 的工程,而且
Eclipse 3.1 以后的版本都是通过它来启动的,这也就意味在 Eclipse 3.1 以后的版本其
实本身就包含了 Equinox 的,所以如果你采用的是 Eclipse 3.1 以后的版本,那么就省
事 了 , 在 你 的 Eclipse 的 plugins 目 录 下 你 可 以 找 到 类 似
org.eclipse.osgi_3.2.0.v20060510.jar 这样的文件,它其实就是 Equinox 的 OSGI R4 Core
Framework 的实现了,如果你采用的不是 Eclipse 3.1 以后的版本,由于我们在开发基
于 Equinox 的应用时采用的也是 Eclipse,那么还是建议你去下个 Eclipse 3.1 以后的版
本。

小编这里使用的eclipse版本是eclipse_luna,如图所示:
eclipse版本信息

配置OSGI环境

接下来就开始配置osgi的环境了。
按照OSGI开发文档中的描述,还需要添加两个jar

  • org.eclipse.equinox.http_1.0.0.v20060601a.jar
  • org.eclipse.equinox.servlet.api_1.0.0.v20060601.jar
    书中给的下载地址:http://download.eclipse.org/eclipse/equinox/drops/S-3.2RC7-200606021317/index.php
    但是小编去访问这个链接时,指向的是一个不存在的地址Not found,于是重新在度娘中找了下资源,找到一个可以访问的下载地址http://archive.eclipse.org/eclipse/equinox/drops/R-3.2-200606291905/index.php。
    将这两个jar下载好之后,放到eclipse的plugins目录中,重启eclipse即可。
  1. 新建一个osgi的运行环境,点击Run旁的小三角,如图所示:Step_1
  2. 先在左边的OSGi Framework右键new一个新的环境出来,然后在Bundles这个tab页,添加如图所示的bundle。 如果你的eclipse中没有osgi framework这个选项,建议你直接去下载一个高版本的eclipse。配置一
  3. 在Arguments这个tab页添加如图所示的参数,小编这里是默认就有的参数。!!!注意!!!:经过小编的测试,-Declipse.ignoreApp=true和**-Dosgi.noShutdown=true这两个运行参数很重要,缺少就会运行报错,特别是-Dosgi.noShutdown=true**这个参数。
    配置二
  4. 点击Apply保存配置,点击Run运行当前配置的OSGI环境。但是小编在按照OSGI的文档添加了以上的jar包后,运行的时候就出现了一下的错误。现在咱们来一个一个解决。

运行异常

异常一:Could not resolve module: org.eclipse.equinox.console

异常描述

详细异常日志如下:

!SESSION 2020-06-28 09:25:52.017 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_191
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN
Command-line arguments:  -dev file:D:/workspace/osgi/.metadata/.plugins/org.eclipse.pde.core/stanard/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -console

!ENTRY org.eclipse.equinox.console 4 0 2020-06-28 09:25:52.562
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.console [4]
  Unresolved requirement: Import-Package: org.apache.felix.service.command; version="0.8.0"; status="provisional"

	at org.eclipse.osgi.container.Module.start(Module.java:434)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.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 2020-06-28 09:25:52.564
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.equinox.console_1.1.0.v20140131-1639.jar was not resolved.

!ENTRY org.eclipse.osgi 4 0 2020-06-28 09:25:52.567
!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.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:64)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:331)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.console [4]
  Unresolved requirement: Import-Package: org.apache.felix.service.command; version="0.8.0"; status="provisional"

	at org.eclipse.osgi.container.Module.start(Module.java:434)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)
	at org.eclipse.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:62)
	... 10 more
Root exception:
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.console [4]
  Unresolved requirement: Import-Package: org.apache.felix.service.command; version="0.8.0"; status="provisional"

	at org.eclipse.osgi.container.Module.start(Module.java:434)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)
	at org.eclipse.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:62)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:331)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

截图如下:
异常一

解决方案:

字面意思是不能解析org.eclipse.equinox.console,那我们就去添加这个bundle试试看。
解决一
这个时候再点击运行,小编出现了另一个异常,我们先看看异常信息再想解决办法。

异常二:

异常描述:

详细异常信息如下:

!SESSION 2020-06-28 10:06:23.021 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_191
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN
Command-line arguments:  -dev file:D:/workspace/osgi/.metadata/.plugins/org.eclipse.pde.core/stanard/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -console

!ENTRY org.eclipse.equinox.console 4 0 2020-06-28 10:06:23.596
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.console [4]
  Unresolved requirement: Import-Package: org.apache.felix.service.command; version="0.8.0"; status="provisional"

	at org.eclipse.osgi.container.Module.start(Module.java:434)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.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 2020-06-28 10:06:23.598
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.equinox.console_1.1.0.v20140131-1639.jar was not resolved.

!ENTRY org.eclipse.osgi 4 0 2020-06-28 10:06:23.600
!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.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:64)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:331)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.console [4]
  Unresolved requirement: Import-Package: org.apache.felix.service.command; version="0.8.0"; status="provisional"

	at org.eclipse.osgi.container.Module.start(Module.java:434)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)
	at org.eclipse.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:62)
	... 10 more
Root exception:
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.console [4]
  Unresolved requirement: Import-Package: org.apache.felix.service.command; version="0.8.0"; status="provisional"

	at org.eclipse.osgi.container.Module.start(Module.java:434)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)
	at org.eclipse.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:62)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:331)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

截图如下:
异常二

解决方案

一样的Could not resolve module错误,那我们再去添加对应的bundle试试。添加bundle的方式同上一步骤。
不过我们这里按照org.apache.felix.service.command这个去搜索bundle的时候发现,是找不到这个bundle的,那我们就尝试搜索下org.apache.felix,这个时候会搜索出来三个bundle,如下所示:bundle
经过小编的测试,以上截图中的bundle缺一不可,少任何一个都会报错,这里我们就先全部添加进去,继续往下走,先把环境运行起来。
再Run一下试试,OK,不负众望,OSGI环境已经运行起来了,我们先敲个OSGI的命令ss看看在当前osgi framework中运行了哪些bundle,如下图所示:
成功


异常补充

今天由于本地运行了nginx,占用了80端口,再运行osgi的时候,出现了下面这个异常

#异常三

异常描述

详细错误日志如下:

!SESSION 2020-06-28 09:36:33.997 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_191
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN
Command-line arguments:  -dev file:D:/workspace/osgi/.metadata/.plugins/org.eclipse.pde.core/stanard/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -console

!ENTRY org.eclipse.equinox.http 4 0 2020-06-28 09:36:34.577
!MESSAGE Port 80 is use
!STACK 0
java.net.BindException: Address already in use: JVM_Bind
	at java.net.DualStackPlainSocketImpl.bind0(Native Method)
	at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106)
	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
	at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)
	at java.net.ServerSocket.bind(ServerSocket.java:375)
	at java.net.ServerSocket.<init>(ServerSocket.java:237)
	at org.eclipse.equinox.http.HttpServerSocket.<init>(HttpServerSocket.java:48)
	at org.eclipse.equinox.http.HttpConfiguration.createServerSocket(HttpConfiguration.java:220)
	at org.eclipse.equinox.http.HttpListener.setProperties(HttpListener.java:108)
	at org.eclipse.equinox.http.HttpListener.<init>(HttpListener.java:55)
	at org.eclipse.equinox.http.HttpConfiguration.createDefaultListeners(HttpConfiguration.java:138)
	at org.eclipse.equinox.http.HttpConfiguration.initialize(HttpConfiguration.java:102)
	at org.eclipse.equinox.http.HttpConfiguration.<init>(HttpConfiguration.java:90)
	at org.eclipse.equinox.http.Http.start(Http.java:70)
	at org.eclipse.equinox.http.Activator.start(Activator.java:33)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
	at org.eclipse.osgi.container.Module.doStart(Module.java:571)
	at org.eclipse.osgi.container.Module.start(Module.java:439)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.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.equinox.http 4 0 2020-06-28 09:36:34.579
!MESSAGE An unexpected IOException occurred
!STACK 0
java.net.BindException: Address already in use: JVM_Bind
	at java.net.DualStackPlainSocketImpl.bind0(Native Method)
	at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106)
	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
	at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)
	at java.net.ServerSocket.bind(ServerSocket.java:375)
	at java.net.ServerSocket.<init>(ServerSocket.java:237)
	at org.eclipse.equinox.http.HttpServerSocket.<init>(HttpServerSocket.java:48)
	at org.eclipse.equinox.http.HttpConfiguration.createServerSocket(HttpConfiguration.java:220)
	at org.eclipse.equinox.http.HttpListener.setProperties(HttpListener.java:108)
	at org.eclipse.equinox.http.HttpListener.<init>(HttpListener.java:55)
	at org.eclipse.equinox.http.HttpConfiguration.createDefaultListeners(HttpConfiguration.java:138)
	at org.eclipse.equinox.http.HttpConfiguration.initialize(HttpConfiguration.java:102)
	at org.eclipse.equinox.http.HttpConfiguration.<init>(HttpConfiguration.java:90)
	at org.eclipse.equinox.http.Http.start(Http.java:70)
	at org.eclipse.equinox.http.Activator.start(Activator.java:33)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
	at org.eclipse.osgi.container.Module.doStart(Module.java:571)
	at org.eclipse.osgi.container.Module.start(Module.java:439)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.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.equinox.http 4 0 2020-06-28 09:36:34.581
!MESSAGE An unexpected RuntimeException occurred
!STACK 0
java.net.BindException: Address already in use: JVM_Bind
	at java.net.DualStackPlainSocketImpl.bind0(Native Method)
	at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106)
	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
	at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190)
	at java.net.ServerSocket.bind(ServerSocket.java:375)
	at java.net.ServerSocket.<init>(ServerSocket.java:237)
	at org.eclipse.equinox.http.HttpServerSocket.<init>(HttpServerSocket.java:48)
	at org.eclipse.equinox.http.HttpConfiguration.createServerSocket(HttpConfiguration.java:220)
	at org.eclipse.equinox.http.HttpListener.setProperties(HttpListener.java:108)
	at org.eclipse.equinox.http.HttpListener.<init>(HttpListener.java:55)
	at org.eclipse.equinox.http.HttpConfiguration.createDefaultListeners(HttpConfiguration.java:138)
	at org.eclipse.equinox.http.HttpConfiguration.initialize(HttpConfiguration.java:102)
	at org.eclipse.equinox.http.HttpConfiguration.<init>(HttpConfiguration.java:90)
	at org.eclipse.equinox.http.Http.start(Http.java:70)
	at org.eclipse.equinox.http.Activator.start(Activator.java:33)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
	at org.eclipse.osgi.container.Module.doStart(Module.java:571)
	at org.eclipse.osgi.container.Module.start(Module.java:439)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.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)
osgi> 

截图如下:
异常3

解决方案

这个异常就好比我们tomcat的8080端口被占用了一样,我们重新指定下端口即可,通过配置**-Dorg.osgi.service.http.port=6666**,如图所示:
异常3
添加完配置后,再运行下即可。

8、Eclipse/OSGi 运行时开发指南 本文深入讲解了基于Eclipse/OSGi的运行时开发指南,涵盖Eclipse插件的基础与高级开发实践,包括简单的插件创建、使用扩展点构建浏览器应用、从命令行启动Eclipse应用程序等内容。同时,解析了WebSphere Application Server(WAS)7的启动过程,揭示其基于OSGi框架的运行机制。文中还介绍了OSGi的基本概念,如包(Bundle)和服务,并探讨了WAS如何利用OSGi实现动态扩展和热部署。通过学习本文,开发者可以掌握Eclipse/OSGi开发的核心技能,并应用于实际项 阅读详情

相关推荐

org.eclipse.osgi_3.7.0.v20110613及源码

org.eclipse.osgi_3.7.0.v20110613以及源码 。

OSGI---Eclipse搭建

1 OSGi开发环境的建立 1.1 Equinox是什么 从代码角度来看,Equinox其实就是OSGi核心标准的完整实现,并且还在这个基础上增加了一些额外的功能(比如为框架增加了命令行和程序执行的入口)。我们在之前入门篇讲解的都东西其实都是OSGi核心标准的一小部分。其实它的核心就是一个jar包,这个jar包既能执行(作为标准Java包的特性),也是一个bundle(Manifest里面含有OSGi bundle特有的元数据)。 现在你需要知道的就是,我们能够利用Equinox项目的代码来运行一个实实在在

__盛某人的博客 2166

Cartographer全局重定位优化:无初始位姿约束的2万平工厂秒级定位实践

本文深入解析了Cartographer在2万平工业场景中的全局重定位优化实践,通过分支定界优化、子图动态加载和多传感器融合等关键技术,实现了无初始位姿约束下的秒级重定位。特别针对大场景下的快速重定位需求,优化后的系统在RK3588平台上表现出色,定位耗时从47秒降至1.8秒,成功率提升至91%,为工业自动化提供了高效解决方案。

rose2的博客 973

windows启动Eclipse报错

!SESSION 2019-04-16 14:49:59.830 ----------------------------------------------- eclipse.buildId=M20110909-1335 java.version=11.0.1 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=...

蚁人日记 1460

ansys workbench 静力结构分析 高阶教程

ansys workbench 静力结构分析 高阶教程 目录ansys workbench 静力结构分析 高阶教程新建工程模型导入设置材料模型简化: 主要内容: 材料设置、模型简化、网格细化、约束分析、接触设置、求解设置、报错处理、结果分析 基础教程: ansys workbench 静力结构分析 基础操作流程(入门) ansys版本: 19.0(16.0及以上均可) 参考资料: 推荐教学视频《有限元分析 张晔》(超详细 ???? )、ansys workbench 超级学习手册(查阅用) 说明:一些基

weixin_43434624的博客 5万+

从零构建AXI接口的DDR3控制器:MIG IP核实战指南

本文详细介绍了如何从零构建AXI接口的DDR3控制器,重点解析MIG IP核的配置流程和优化策略。通过实战案例和仿真验证,帮助开发者掌握FPGA中DDR3控制器的AXI接口设计,提升高速数据传输效率。适用于图像处理、网络加速等高性能应用场景。

weixin_28256233的博客 454

【OSGI】非Eclipse下构建OSGI运行环境

搭建非Eclipse下构建OSGI运行环境 由于工作需要,学习了OSGI。之前在Eclipse上搭建过OSGI模块化开发平台,但是这种启动plug-in项目的方法最终交付用户的时候不能让用户通过Eclipse来启动项目,所以我们要搭建一个非Eclipse下构建OSGI运行环境。 首先我写这篇文章的时间是2016年3月3日,我使用的编译器是Spri...

weixin_34253539的博客 292

南京邮电大学《数学实验》模块二(函数的迭代)参考答案

【代码】南京邮电大学《数学实验》模块二(函数的迭代)参考答案。

qq_1293730064的博客 3万+

Equinox 和 OSGI 介绍

1.       背景信息 Equinox项目是Eclipse开源组织提供的OSGi框架的实现。Eclipse自3.0版本开始,其内核移植到OSGi框架上。通过OSGi框架强大的组件控制,交互和管理能力,再加上Eclipse插件的自有特点,Eclipse开源框架得到了跳跃式的发展。同时,OSGi规范得益于Eclipse IDE环境庞大的...

wangpengfei2011的博客 1023

ABB机器人与西门子PLC、工业相机联合实现无序抓取的完整调试方案

将此方案导入系统后,逐步执行调试,确保各环节信号正常触发,即可实现高效无序抓取!

CHUXUEZHE8210的博客 1998

【C++】开源:ncurses终端TUI文本界面库

ncurses配置使用(TUI)

DevFrank的博客 3181

Eclispe4.5 servlet web开发_非Eclipse下构建OSGI运行环境

搭建非Eclipse下构建OSGI运行环境 由于工作需要,学习了OSGI。之前在Eclipse上搭建过OSGI模块化开发平台,但是这种启动plug-in项目的方法最终交付用户的时候不能让用户通过Eclipse来启动项目,所以我们要搭建一个非Eclipse下构建OSGI运行环境。   首先我写这篇文章的时间是2016年3月3日,我使用的编译器是spring Tool Suite(和

u014114709的博客 494

【Dify】36氪新闻热榜智能自动化采集与AI处理

本文介绍如何利用Dify等自动化工具实现36氪新闻热榜的智能采集与处理。通过HTTP请求节点获取数据,JSON解析节点结构化处理,AI处理节点生成智能摘要,最终格式化输出结果。工作流程包含数据获取、解析、AI摘要、文本整理和内容输出五个环节,支持批量化、定制化的新闻处理需求。该方案适用于行业监测、内容创作、舆情管理等场景,显著提升信息获取效率,实现"所需即得"的自动化新闻服务。系统采用OpenAI GPT和Dify API作为核心模型,无需复杂人工干预即可完成全流程处理。

Mr数据杨 607

OSGI企业应用开发(二)Eclipse中搭建Felix运行环境

上篇文章介绍了什么是OSGI以及使用OSGI构建应用的优点,接着介绍了两款常用的OSGI实现,分别为Apache Felix和Equinox,接下来开始介绍如何在Eclipse中使用Apache Felix和Equinox搭建OSGI运行环境。 一、搭建Apache Felix运行环境 上篇文章中介绍了Felix的下载与使用,本节我们在Eclipse中搭建Felix运行环境,并开发一个自己的B

Bean的博客 1436

PCL 使用RANSAC拟合平面【2026最新版】

RANSAC拟合平面算法原理和实现流程详解以及最大迭代次数和内点期望概率的设置方法。最后再对拟合后的平面法向量与向量(1,1,1)进行定向。博客长期更新,最近一次更新时间为:2026年4月24日。

点云侠的博客 42万+

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Eclipse 中搭建 Apache Felix 运行环境

本文中使用的是Eclipse3.6;Felix Framework版本是3.2.2。   1、从Apache Felix官网下载Felix Framework。官网地址: http://felix.apache.org/。       Felix Framework下载地址:http://felix.apache.org/site/downloads.cgi           下载F...

技术分享 409

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

eclipse下构建spring与OSGI项目

1.准备工作。 下载springframework2.5.6包。 取得文件spring-context.jar,spring-aop.jar,spring-beans.jar 下载spring-osgi1.2包。 取得文件spring-osgi-core-1.2.0.jar,spring-osgi-extender-1.2.0.jar,spring-osgi-io-1.2.0.jar  ...

sunxboy的专栏 179

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

2.OSGI企业应用开发-Eclipse中搭建Felix运行环境

上篇文章介绍了什么是OSGI以及使用OSGI构建应用的优点,接着介绍了两款常用的OSGI实现,分别为Apache Felix和Equinox,接下来开始介绍如何在Eclipse中使用Apache Felix和Equinox搭建OSGI运行环境。 一、搭建Apache Felix运行环境 上篇文章中介绍了Felix的下载与使用,本节我们在Eclipse中搭建Felix运行环境,并开发一个自己的Bundle,然后发布到Felix容器中,下载解压后的Felix框架文件结构如下: [外链图片转存失败,源站可能有防盗

clearlxj的博客 511

OSGi尝试

最好的入门材料: OSGI 实战 ,真的要感谢BlueDavy ! 这里还有用Webex产品录制的OSGi 的简单培训 OSGiInAction 当前的开源社区对OSGi 支持的基本情况是: 1. OSGi R4 core framework specification 2. Equinox lates...

Mars Suburbs People 220

基于OSGi的Web模块开发基本流程

由于项目的需要,写了一个简单的开发基于OSGi的Web模块开发示例用于项目组交流,最初发布在自己的个人博客上(http://www.tofacto.org/2012/02/189.html),在CSDN上同时发布出来期望能够抛砖引玉,或者能给大家带来一点启发。 一、生成项目: 1、 Eclipse菜单:File -> new -> project -> Plug-in Project,如图:1

流动的空气 920

【OSGI】2.走近OSGI-开发第一个Plug-in项目

上一次我们介绍了什么是OSGI和OSGI在我们的项目中起到了什么作用。这次我们来亲手使用OSGI技术。 主要利用Eclipse开发工具提供给我们的plug-in插件工程模板来创建我们的工程。零距离的体验一下OSGI项目创建的基本过程,和运行流程以及其它相关的知识。 所有语言或技术的第一次测试通常都会以“HelloWorld”作为代表性语句,那么我们接下来将利用OSGI技术,创建一个He

程序猿之洞 1万+

OSGi运行环境依赖的jar包

 开发环境使用eclipse 4.3.2(kelper) 1、最基础的运行环境包 0 ACTIVE org.eclipse.osgi_3.9.1.v20140110-1610 1 ACTIVE org.eclipse.equinox.console_1.0.100.v20130429-0953 2 ACTIVE org.eclipse.equinox.co...

conkeyn的专栏 839

osgi 学习——osgi与spring-dm整合引入第三方jar包

1、新建eclipse工程,工程选择为Plug-in Development—>Plug-in from Existing JAR Archives;   2、点击Add External...按钮,添加已经下载好的jar包;   3、注意两点,一是最好在"This plug-in is targeted to run with:"中选择an OSGI framework:

shixihaoma的专栏 1733

OSGi Note

Create OSGi environment outside Eclipse. ------------------------------------------------------------------------------ 1) Create folder and files: [code="java"]C:\equinox │ run.bat │ ├─confi...

louisling 120
上一篇: RAML文件书写规则笔记
下一篇: 笔记整理:TCP的三次握手,四次挥手
Min_Monk
博客等级 码龄11年 17粉丝 84原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值