2012-07-09 59 views
2

我目前正試圖在Equinox中獲得捆綁開始。OSGi運行時中的Commons Logging bundle

此捆綁包需要commons-logging。

我試過包括來自Maven Central的最新的commons-logging jar。沒有運氣。

然後我轉移到slf4j。這是從OSGi控制檯我目前的狀態:

11  ACTIVE  jcl.over.slf4j_1.6.6 
12  ACTIVE  slf4j.api_1.6.6 
        Fragments=14 
14  RESOLVED slf4j.simple_1.6.6 
        Master=12 

在我看到下面的異常日誌:

!ENTRY org.eclipse.osgi 4 0 2012-07-09 11:36:56.157 
!MESSAGE Error starting bundle: [email protected]:/C:/test/slf4j-simple-1.6.6.jar 
!STACK 0 
org.osgi.framework.BundleException: A fragment bundle cannot be started: slf4j.simple_1.6.6 [14] 
    at org.eclipse.osgi.framework.internal.core.BundleFragment.startWorker(BundleFragment.java:224) 
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startBundle(EclipseStarter.java:1119) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startBundles(EclipseStarter.java:1112) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.loadBasicBundles(EclipseStarter.java:631) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:277) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.main(EclipseStarter.java:151) 

!ENTRY org.eclipse.osgi 4 0 2012-07-09 11:36:56.205 
!MESSAGE Bundle slf4j.simple_1.6.6 [14] is not active. 

是什麼,以獲得最佳方式共享記錄兼容包並運行Equinox 3.8?

回答

4

slf4j-simple是一個片段,片段無法啓動。

你在最後用@start在你的config.ini中列出了它嗎?只要刪除它。

0

從OSGi服務平臺核心規範

A Fragment bundle must enter the resolved state only if it has been successfully 
attached to its host bundle. 

All class or resource loading of a fragment is handled through the host’s 
class loader, a fragment must never have its own class loader. Fragment bundles 
are treated as if they are an intrinsic part of their host. 

很多時候,我們開始片段束,然後導致進入org.osgi.framework.BundleException: A fragment bundle cannot be started Exception.

按照說明書沒有必要啓動片段束。它不是你的代碼的問題。

相關問題