【发布时间】:2018-07-21 07:43:36
【问题描述】:
我在 OSGi 中创建了一个使用 Spark 提供休息端点的服务。
我收到以下错误:
错误
Error executing command: Error executing command on bundles:
Error starting bundle 66: Unable to resolve OSGiConsumerProducer.ProducerConsumer.helloendpoint [66](R 66.0): missing requirement [OSGiConsumerProducer.ProducerConsumer.helloendpoint [66](R 66.0)] osgi.wiring.package; (osgi.wiring.package=spark.Spark.get) Unresolved requirements: [[OSGiConsumerProducer.ProducerConsumer.helloendpoint [66](R 66.0)] osgi.wiring.package; (osgi.wiring.package=spark.Spark.get)]
我已经被 POM 定义为这样编译:
<instructions>
<Bundle-SymbolicName>${parent.groupId}.${parent.artifactId}.helloendpoint</Bundle-SymbolicName>
<Bundle-Activator>com.osgi.endpoint.EndpointActivator</Bundle-Activator>
<Import-Package>
spark.Spark.get
</Import-Package>
<Export-Package>
com.osgi.endpoint.HelloEndpointAPI
</Export-Package>
<Bundle-ManifestVersion>2</Bundle-ManifestVersion>
</instructions>
我假设我只需要导出我的 impl 类使用的接口,然后导入 Spark 包,因为我在这个模块中使用它?
潜在问题:
我需要将 Spark 安装到 Karaf 中吗?
【问题讨论】:
标签: maven osgi osgi-bundle