将javax.smartcardio打包为OSGI Bundle

时间:2016-11-04 19:05:24

标签: osgi apache-karaf osgi-bundle karaf

我正在构建一个使用javax.smartcardio库的Karaf OSGI应用程序。当我部署它时,它给了我以下错误:

Unable to resolve 249.0: missing requirement [249.0] osgi.wiring.package; (osgi.wiring.package=javax.smartcardio)
    at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:488)[26:org.apache.karaf.features.core:2.3.2]
    at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:402)[26:org.apache.karaf.features.core:2.3.2]
    at Proxy532dee57_5493_41af_a3a1_bf689277fb5b.installFeature(Unknown Source)[:]
    at org.apache.karaf.deployer.kar.KarArtifactInstaller.installFeatures(KarArtifactInstaller.java:189)[24:org.apache.karaf.deployer.kar:2.3.2]
    at org.apache.karaf.deployer.kar.KarArtifactInstaller.install(KarArtifactInstaller.java:134)[24:org.apache.karaf.deployer.kar:2.3.2]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:929)[6:org.apache.felix.fileinstall:3.2.6]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:857)[6:org.apache.felix.fileinstall:3.2.6]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:483)[6:org.apache.felix.fileinstall:3.2.6]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[6:org.apache.felix.fileinstall:3.2.6]
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle com.isirona.drivers.neuroptics-npi200.core [249]: Unable to resolve 249.0: missing requirement [249.0] osgi.wiring.package; (osgi.wiring.package=javax.smartcardio)
    at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)[org.apache.felix.framework-4.0.3.jar:]
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)[org.apache.felix.framework-4.0.3.jar:]
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)[org.apache.felix.framework-4.0.3.jar:]
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)[org.apache.felix.framework-4.0.3.jar:]
    at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:485)[26:org.apache.karaf.features.core:2.3.2]

我想将javax.smartcardio库打包为一个包。有关于如何从.jar构建包的链接,但我在JDK中找不到javax.smartcardio库。

它在JDK中吗?我是否必须做任何特殊的事情才能访问它。谢谢。

1 个答案:

答案 0 :(得分:1)

如果它是JDK的一部分,请确保将其导出为系统包。 为此编辑 etc / jre.properties 文件。

您需要将相应的包添加到您使用的JVM部分。通常,如果已知,最好以正确的版本导出它。