无法启动OSGi包,缺少com.ibm.uvm.tools

时间:2023-01-25 22:55:58

I am trying to start a bundle, with a whole bunch of dependencies. I am getting the error could not be resolved. Reason: Missing Constraint: Import-Package: com.ibm.uvm.tools, but cannot find this package in the maven repos or on the web. By marking this package (and a bunch of others) optional in the Import-Package directive, I can resolve the package, but it fails to start if the dependencies are not met. What can I do to resolve this Import-package?

我正在尝试使用一大堆依赖项来启动一个包。我得到的错误无法解决。原因:缺少约束:Import-Package:com.ibm.uvm.tools,但无法在maven存储库或Web上找到此包。通过在Import-Package指令中将此包(以及其他一些包)标记为可选,我可以解析包,但如果不满足依赖性则无法启动。我该怎么做才能解决这个Import-package?

I am using the maven-bundle-plugin to generate the bundle.

我正在使用maven-bundle-plugin来生成捆绑包。

2 个解决方案

#1


3  

Solution was to use a OSGified version of log4j as provided dependency. I had it as a compiled dependency. Log4j manifest mentions this package as an optional depndency, so maven-bundle-plugin added it to my bundle's manifest, but did not make it optional.

解决方案是使用OSGified版本的log4j作为提供的依赖项。我把它作为编译依赖项。 Log4j清单提到这个包是一个可选的depndency,所以maven-bundle-plugin将它添加到我的bundle的清单中,但没有让它成为可选的。

#2


2  

You have built your bundle with a couple of jars on the classpath. Otherwise your bundle would not reference anything in a package named com.ibm.uvm.tools. Now you need to see whether or not this jar is OSGi-ready (specifying the correct headers and package-exports). Maybe there also exists a 'OSGi-fied' version of that jar, have look at the springsource repository for example.

您已经在类路径上使用几个jar构建了捆绑包。否则,您的bundle不会引用名为com.ibm.uvm.tools的包中的任何内容。现在您需要查看此jar是否已准备好OSGi(指定正确的标头和包导出)。也许还存在该jar的'OSGi-fied'版本,例如看一下Springsource存储库。

Looking at the package name, I assume the probably proprietary code that cannot be found re-wrapped in any public repository, then you may try to wrap it as a bundle yourself , having a look at this * question.

查看包名称,我假设可能无法在任何公共存储库中重新包装的专有代码,然后您可以尝试将其自己包装为一个包,看看这个*问题。

#1


3  

Solution was to use a OSGified version of log4j as provided dependency. I had it as a compiled dependency. Log4j manifest mentions this package as an optional depndency, so maven-bundle-plugin added it to my bundle's manifest, but did not make it optional.

解决方案是使用OSGified版本的log4j作为提供的依赖项。我把它作为编译依赖项。 Log4j清单提到这个包是一个可选的depndency,所以maven-bundle-plugin将它添加到我的bundle的清单中,但没有让它成为可选的。

#2


2  

You have built your bundle with a couple of jars on the classpath. Otherwise your bundle would not reference anything in a package named com.ibm.uvm.tools. Now you need to see whether or not this jar is OSGi-ready (specifying the correct headers and package-exports). Maybe there also exists a 'OSGi-fied' version of that jar, have look at the springsource repository for example.

您已经在类路径上使用几个jar构建了捆绑包。否则,您的bundle不会引用名为com.ibm.uvm.tools的包中的任何内容。现在您需要查看此jar是否已准备好OSGi(指定正确的标头和包导出)。也许还存在该jar的'OSGi-fied'版本,例如看一下Springsource存储库。

Looking at the package name, I assume the probably proprietary code that cannot be found re-wrapped in any public repository, then you may try to wrap it as a bundle yourself , having a look at this * question.

查看包名称,我假设可能无法在任何公共存储库中重新包装的专有代码,然后您可以尝试将其自己包装为一个包,看看这个*问题。