天天看點

OSGI 之 Declarative Service (1)

OSGI之DS是什麼,這裡就不多說了,網上資料很多,可到别處了解。

OSGI DS相關知識參考:http://www.ibm.com/developerworks/cn/opensource/os-ecl-osgids/index.html

這裡簡單說一個bug處理:

BUG資訊如下:

--------------------------------------------------------------------------------------------------------------------

!SESSION 2012-07-24 10:08:41.093 -----------------------------------------------

eclipse.buildId=unknown
java.version=1.7.0_04
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=zh_CN
Command-line arguments:  -dev file:F:/springsource/workspace2/.metadata/.plugins/org.eclipse.pde.core/New_configuration/dev.properties -os win32 -ws win32 -arch x86 -consoleLog -console

!ENTRY org.eclipse.equinox.ds 4 0 2012-07-24 10:08:42.265
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.ds_1.3.1.R37x_v20110701 [31]" could not be resolved. Reason: Missing Constraint: Import-Package: org.eclipse.equinox.internal.util.event; version="1.0.0"
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1327)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1311)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131)
	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 2012-07-24 10:08:42.281
!MESSAGE Bundle [email protected]:file:plugins/org.eclipse.equinox.ds_1.3.1.R37x_v20110701.jar/ was not resolved.

!ENTRY org.eclipse.osgi 2 0 2012-07-24 10:08:42.296
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2012-07-24 10:08:42.296
!MESSAGE Bundle [email protected]:file:plugins/org.eclipse.equinox.ds_1.3.1.R37x_v20110701.jar/ was not resolved.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.eclipse.equinox.internal.util.hash_1.0.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.eclipse.equinox.internal.util.event_1.0.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.osgi.service.cm_1.2.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.osgi.service.component_[1.1.0,1.2.0).
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.eclipse.equinox.internal.util.threadpool_1.0.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.eclipse.equinox.internal.util.ref_1.0.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.eclipse.equinox.internal.util.pool_1.0.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.eclipse.equinox.internal.util.timer_1.0.0.

!ENTRY org.eclipse.osgi 2 0 2012-07-24 10:08:42.296
!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 2012-07-24 10:08:42.296
!MESSAGE Bundle org.eclipse.equinox.ds_1.3.1.R37x_v20110701 [31] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.eclipse.equinox.internal.util.event_1.0.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.eclipse.equinox.internal.util.hash_1.0.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.eclipse.equinox.internal.util.pool_1.0.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.eclipse.equinox.internal.util.ref_1.0.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.eclipse.equinox.internal.util.threadpool_1.0.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.eclipse.equinox.internal.util.timer_1.0.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.osgi.service.cm_1.2.0.
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.osgi.service.component_[1.1.0,1.2.0).
!SUBENTRY 2 org.eclipse.equinox.ds 2 0 2012-07-24 10:08:42.296
!MESSAGE Missing imported package org.apache.felix.scr_[1.6.0,1.7.0).
           

----------------------------------------------------------------------------------------------

解決辦法: 

除了要添加 org.eclipse.equinox.ds

還需:

1  org.eclipse.equinox.util 

2  org.eclipse.osgi.services

上一篇: 1st day
下一篇: OSGI 入門