我尝试在 glassfish 4.1.1 中部署一个简单的 OSGI 包(hello world),但出现以下错误:
Infos: org.osgi.framework.BundleException:
Unresolved constraint in bundle com.mycompany.MavenHelloServiceImpl [324]:
Unable to resolve 324.0: missing requirement [324.0]
osgi.wiring.package; (osgi.wiring.package=com.mycompany.mavenhelloserviceapi)
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
我不知道如何修复丢失的包,我已经将“com.mycompany.mavenhelloserviceapi”定义为 bundle MavenHelloServiceImpl 中的依赖项,并且它存在于 bundle MavenHelloServiceImpl 的依赖项文件夹中 知道如何修复此错误吗?!
最佳答案
有com.mycompany.mavenhelloserviceapi
因为 pom.xml 中的依赖项是不够的:pom 是关于编译时依赖项的。您在这里看到一个关于缺少运行时依赖项的问题。
您应该安装com.mycompany.mavenhelloserviceapi
在你的容器中。
关于java - 如何在部署 OSGI 包时修复缺失的需求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35566265/