我正在尝试在 OSGI 包中使用 OWL api 和 Pellet。捆绑包成功构建,但在运行时我收到以下错误:org.osgi.framework.BundleException: Unresolved constraint in bundle smp.lighting.client.osgi [2]: package; (package=org.mindswap.pellet)
.
这些是在 pom 文件中声明的依赖项:
<dependency>
<groupId>edu.stanford.protege</groupId>
<artifactId>org.semanticweb.owl.owlapi</artifactId>
<version>3.4.4</version>
<exclusions>
<exclusion>
<artifactId>org.osgi.core</artifactId>
<groupId>org.apache.felix</groupId>
</exclusion>
<exclusion>
<artifactId>owlapi-apibinding</artifactId>
<groupId>net.sourceforge.owlapi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.ansell.pellet</groupId>
<artifactId>pellet-owlapiv3</artifactId>
<version>2.3.3</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
<exclusion>
<artifactId>xercesImpl</artifactId>
<groupId>xerces</groupId>
</exclusion>
</exclusions>
</dependency>
另外,在包的启动文件中,我调用:mvn:edu.stanford.protege/org.semanticweb.owl.owlapi/3.4.4
并在下一个级别: wrap:mvn:com.github.ansell.pellet/pellet-jena/2.3.3 wrap:mvn:com.github.ansell.pellet/pellet-owlapiv3/2.3.3
我不知道我是否遗漏了什么,感谢您的帮助。先感谢您!