在eclipse中配置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
添加完配置後,再運行下即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章