2

パックされていないバンドルをその場で組み立てられるように、PAX-URL を使用しようとしています。

自動起動バンドルに pax-url-assembly-1.2.1.jar を入れてから、次のように入力します。

インストール アセンブリ:path/to/my/folder

すべてが機能します。問題は、設定ファイルで > felix.auto.start.1=assembly:path/to/my/folder を使用してこれらのフォルダーをフェリックスに与えたいことです。

そうすると、「不明なプロトコル: アセンブリ」という例外が発生します。

レベル 1 で PAX-URL を読み込んでみましたが、他のすべてのバンドルのデフォルトの開始レベルを 10 に設定しました。役に立ちません。バンドルがロードされる前に構成を読み取るのは「システムバンドル」自体だと思うため、「アセンブリ」は理解されません。

私の推測では、Felix 自体が起動したときに Felix に PAX-URL をロードするように指示する必要があります。

何か案は?私はそれをすべて間違っていましたか?:)

ありがとう!

4

2 に答える 2

4

PAX-URL を Apache Felix のフォルダーに入れ、オプションbundleで起動してみてください。-Djava.protocol.handler.pkgs=org.ops4j.pax.url

これは、 Eclipseでの Apache Felix 開発について説明した投稿です。

于 2011-07-29T14:14:37.740 に答える
2

One more thing! If you are using Declarative Services with the maven-SCR-plugin, pax-url won't find the servicecomponents.xml, since the plugin by default puts it directly in target (as opposed to target/classes). For this to work, you'll have to add a config stanza to your scr plugin changing the output directory, like so:

<plugin>
    <groupId>org.apache.felix</groupId>
    <artifactId>maven-scr-plugin</artifactId>
    <version>1.7.0</version>
    <executions>
        <execution>
            <id>generate-scr-scrdescriptor</id>
            <goals>
                <goal>scr</goal>
            </goals>
            <configuration>
                <!-- Without this, PAX-URL won't work -->
                <outputDirectory>target/classes</outputDirectory>
            </configuration>
        </execution>
    </executions>
</plugin>
于 2011-08-04T11:37:37.073 に答える