1

皆さんこんにちは、

Kura Linux エミュレーターを使用して、Kura Documentation http://eclipse.github.io/kura/dev/deploying-bundles.html#remote-target-deviceから Hello World の例を実行しています。

OSGi プラグインをローカル エミュレーション モードで実行することができました。Kura Emulator Linux/java ログからの出力は次のとおりです。

21:14:18,036 [Component Resolve Thread] INFO  HelloOsgi:15  - Bundle org.eclipse.kura.example.hello_osgi has started!

ただし、コンソールからバンドルを開始/停止しようとすると、インストール手順のみを実装できます。インストール後のホスト OSGi コンソールからの関連する出力を次に示します。

osgi> install file:/home/tihomir/workspace/kura/plugins/org.eclipse.kura.example.hello_osgi_1.0.0.201712111129.jar
Bundle id is 1020
LastModified         1513020115678
Headers               Bundle-ManifestVersion = 2
 Bundle-Name = Hello World Example with Logger
 Bundle-RequiredExecutionEnvironment = JavaSE-1.8
 Bundle-SymbolicName = org.eclipse.kura.example.hello_osgi
 Bundle-Version = 1.0.0.201712111129
 Import-Package = org.eclipse.osgi.framework.console;version="1.0.0",
org.osgi.framework;version="1.3.0",
org.osgi.service.component;version="1.2.2",
org.osgi.service.component.annotations;version="1.2.0";resolution:=optional,
org.osgi.util.tracker;version="1.3.1",org.4j;version="1.7.21"
 Manifest-Version = 1.0
 Service-Component = OSGI-INF/*.xml
Location             file:/home/tihomir/workspace/kura/plugins/org.eclipse.kura.example.hello_osgi_1.0.0.201712111129.jar
State                2
Bundle                1020|Installed  |    1|org.eclipse.kura.example.hello_osgi (1.0.0.201712111129)
Version              1.0.0.201712111129
RegisteredServices   null
ServicesInUse        null
Module               osgi.identity; osgi.identity="org.eclipse.kura.example.hello_osgi"; type="osgi.bundle"; version:Version="1.0.0.201712111129" [id=1020]
SymbolicName         org.eclipse.kura.example.hello_osgi
BundleContext        null
BundleId             1020


osgi> ss
"Framework is launched."
id  State       Bundle
0   ACTIVE      org.eclipse.osgi_3.12.50.v20170928-1321
                Fragments=1
997 RESOLVED    org.slf4j.api_1.7.2.v20121108-1250
                Fragments=5, 998
998 RESOLVED    org.slf4j.impl.log4j12_1.7.2.v20131105-2200
                Master=997
1020    INSTALLED   org.eclipse.kura.example.hello_osgi_1.0.0.201712111129

しかし、バンドルをアクティブ化しようとすると、org.slf4j が解決されたことを示す上記の出力にもかかわらず、次の例外が発生します。

osgi> start 1020
gogo: BundleException: Could not resolve module: org.eclipse.kura.example.hello_osgi [1020]
  Unresolved requirement: Import-Package: org.slf4j; version="1.7.21"

Debian 9 でエミュレーターを実行しています。プラグインのマニフェストもあります。

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Hello World Example with Logger
Bundle-SymbolicName: org.eclipse.kura.example.hello_osgi
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Service-Component: OSGI-INF/*.xml
Import-Package: org.eclipse.osgi.framework.console;version="1.0.0",
 org.osgi.framework;version="1.3.0",
 org.osgi.service.component;version="1.2.2",
 org.osgi.service.component.annotations;version="1.2.0";resolution:=optional,
 org.osgi.util.tracker;version="1.3.1",
 org.slf4j;version="1.7.21"

こことEclipseフォーラムで見つけたいくつかのチェック/修正をすでに試しましたが、何もうまくいきませんでした.新しい提案は大歓迎です.

4

3 に答える 3

0

Kura は SLF4j v 1.7 を提供しているようなので、プロジェクトの POM を編集して SLF4j をダウングレードします。2バンドルには少なくとも v 1.7 が必要です。21


@NeilBartlett のコメントによると、バンドルの依存関係を解決するために SLF4j バンドルを開始する必要はありません。バンドルからのログ行が表示されない場合のリマインダーとして、回答のこの部分をここに残します。

SLF4j バンドルは開始されていません (RESOLVEDss状態で表示されます)。で起動してみてくださいstart 997 998

于 2017-12-12T12:42:11.917 に答える