1. 程式人生 > >解決Eclipse進行OSGI除錯時出現Could not find bundle: org.eclipse.equinox.console的問題

解決Eclipse進行OSGI除錯時出現Could not find bundle: org.eclipse.equinox.console的問題

故障現象

Eclipse下OSGi開發,執行測試時,程式直接報錯,堆疊資訊顯示:Could not find bundle: org.eclipse.equinox.console

解決辦法

This is because the default shell of Eclipse has been moved to “Apache Felix Gogo”; so the necessary bundles must be added to the “Run Configuration” before running. Followings are the four bundled that you need to select from the list:
- org.apache.felix.gogo.command_0.10.0v.jar
- org.apache.felix.gogo.runtime_0.10.0v.jar
- org.apache.felix.gogo.shell_0.10.0v.jar
- org.eclipse.equinox.console_1.0.100.jar

Bundle settings in osgi develop

解釋說明:
根據 stackoverflow 上的解釋是:Eclipse下預設的shell已經遷移到“Apache Felix Gogo”之下,所以在OSGi開發時的bundles在執行時,必須在“Run Configuration”中新增必要的依賴bundles,以下4項是必須的:

  • org.apache.felix.gogo.command_0.10.0v.jar
  • org.apache.felix.gogo.runtime_0.10.0v.jar
  • org.apache.felix.gogo.shell_0.10.0v.jar
  • org.eclipse.equinox.console_1.0.100.jar

所以,“Run Configuration”–> “Bundles” –> “Target Platform” –> 勾選以上4個依賴bundles
就OK了