2016-11-02 10 views
0

私のMavenのOSGiのJavaFXプロジェクトを実行しようとしていますが、私は次のエラーを取得しておいてください。org.osgi.framework.BundleException:欠落している要件を解決できませんosgi.wiring.package; (osgi.wiring.package = javafx.application)

org.osgi.framework.BundleException: Unable to resolve launcher [4](R 4.0): missing requirement [launcher [4](R 4.0)] osgi.wiring.package; (osgi.wiring.package=javafx.application) Unresolved requirements: [[launcher [4](R 4.0)] osgi.wiring.package; (osgi.wiring.package=javafx.application)] 
    at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111) 
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2117) 
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) 
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984) 
    at impl.App.loadBundles(App.java:84) 
    at impl.App.initialize(App.java:60) 
    at impl.App.main(App.java:26) 

mvn clean packageは完璧に動作し、私は私のプロジェクトのjarファイルが生成されます。

周りに読んでいくつかはthis StackOverflow answerにさせて頂いています

JavaFX applications depend on packages from the JavaFX APIs, such as javafx.application and several others.

In Java 8 the javafx.* packages are provided by the base JRE. However OSGi does not automatically export every package from the JRE, simply because all JREs have a bunch of non-standard packages (e.g. com.sun.* etc) that normal application code should not have access to. Therefore OSGi only makes available the packages that are defined by the relevant JCP Specification for the version of Java that you are using. For example packages such as javax.swing, org.w3c.dom, etc.

Since JavaFX is not a standard, there is no JCP Specification for JavaFX, and OSGi does not export the javafx.* packages. However you can configure OSGi to do this for you by setting the following configuration property when you launch OSGi:

org.osgi.framework.system.packages.extra=javafx.application,...

どのように私は上記の提案を実装することができ、または私は問題を解決するために何ができるのでしょうか?

答えて

0

フレームワークオブジェクトを構築するアプリケーションでは、設定パラメータのマップを渡します。マップ内のorg.osgi.framework.system.packages.extraプロパティを目的のjavafxパッケージで設定できます。

+0

ありがとうございます。 @BJ Hargraveを説明していただけますか? –

+0

@ Program-Me-Rev BJが与えた答えに欠けているものと、あなたがリンクした質問に私が答えてくれたものがありますか?私はあなたの質問を重複としてマークしました。 –

関連する問題