我正在尝试在OSGI捆绑包中使用OWL和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
我不知道我是否遗漏了什么,任何帮助都是非常感谢的.提前谢谢你!
发布于 2015-11-26 04:07:24
pellet-owlapiv3是Pellet和OWL API之间的适配器,因此它本身不包含核心Pellet类。从错误中,我认为您还需要包装pellet-core,可能还需要包装一些其他的Pellet模块。
https://stackoverflow.com/questions/33921177
复制相似问题