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 initial@reference: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 initial@reference: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





你可能感兴趣的:(service,File,osgi,constraints,reference,Constants)