OSGi:缺少带有本地捆绑包的 osgi.wiring.package 要求

问题描述 投票:0回答:1

我第一次使用maven和OSGi。我为 Cytoscape 编写应用程序,它使用 OSGi。我的应用程序需要 SMT 求解器。首先,我使用来自 github.com/SRI-CSL/yices2_java_bindings 的绑定构建了常规 JAR。然后使用 bnd 创建 OSGi 包,其中包含以下文本(在 .bnd 文件中):

-classpath: yices.jar
Bundle-SymbolicName: com.sri.yices
ver: 1.0.0
-output: ${bsn}.jar
Bundle-Version: ${ver}
Export-Package: *; version=${ver} 

SMT 求解器包的 MANIFEST.MF:

Manifest-Version: 1.0
Bnd-LastModified: 1709709378499
Bundle-ManifestVersion: 2
Bundle-Name: com.sri.yices
Bundle-SymbolicName: com.sri.yices
Bundle-Version: 1.0.0
Created-By: 17.0.10 (Private Build)
Export-Package: com.sri.yices;version="1.0.0"
Require-Capability: osgi.ee;filter:="(osgi.ee=UNKNOWN)"
Tool: Bnd-5.0.1.202101211358

我的应用程序的 pom.xml 中关于 maven-bundle-plugin 的内容:

<plugin>
 <groupId>org.apache.felix</groupId>
 <artifactId>maven-bundle-plugin</artifactId>
 <version>${maven-bundle-plugin.version}</version>
 <extensions>true</extensions>
 <configuration>
  <instructions>
   <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
   <Bundle-Name>BNwPAS</Bundle-Name>
   <Bundle-Version>${project.version}</Bundle-Version>
   <Private-Package>${bundle.namespace}.*</Private-Package>
   <Export-Package>!${bundle.namespace}.*</Export-Package>
   <Bundle-Activator>${bundle.namespace}.CyActivator</Bundle-Activator>
  </instructions>
 </configuration>
</plugin>

关于 smt 求解器依赖的 pom.xml 文件内容:

<dependency>
 <groupId>org.sri</groupId>
 <artifactId>yices</artifactId>
 <version>1.0.0</version>
 <scope>system</scope>
 <systemPath>${yices-systemPath}</systemPath>
</dependency>

项目包的MANIFEST.FM:

Manifest-Version: 1.0
Bnd-LastModified: 1709972907550
Build-Jdk-Spec: 21
Bundle-Activator: org.veldalen.BNwPAS.internal.CyActivator
Bundle-ManifestVersion: 2
Bundle-Name: BNwPAS
Bundle-SymbolicName: org.veldalen.BNwPAS
Bundle-Version: 0.1
Created-By: Apache Maven Bundle Plugin 5.1.9
Import-Package: com.sri.yices;version="[1.0,2)",java.lang,java.util,or
 g.cytoscape.model;version="[3.10,4)",org.cytoscape.service.util;versi
 on="[3.10,4)",org.cytoscape.work;version="[3.10,4)",org.osgi.framewor
 k;version="[1.8,2)"
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=17))"
Tool: Bnd-6.3.1.202206071316

当我尝试在 Cytoscape 中启动我的应用程序时,我收到以下信息:

Error starting bundle 127: Unable to resolve org.veldalen.BNwPAS [127](R 127.0): missing requirement [org.veldalen.BNwPAS [127](R 127.0)] osgi.wiring.package; (&(osgi.wiring.package=com.sri.yices)(version>=1.0.0)(!(version>=2.0.0))) Unresolved requirements: [[org.veldalen.BNwPAS [127](R 127.0)] osgi.wiring.package; (&(osgi.wiring.package=com.sri.yices)(version>=1.0.0)(!(version>=2.0.0)))]
我错过了什么?

我原本以为不会出现接线问题。

osgi cytoscape
1个回答
0
投票

Require-Capability: osgi.ee;filter:="(osgi.ee=UNKNOWN)"

清单中的

表示构建捆绑包时出现问题。这不会在运行时解决,因为它是未知的。

该捆绑包似乎是由自定义工具创建的?

Created-By: 17.0.10 (Private Build)

© www.soinside.com 2019 - 2024. All rights reserved.