Java OSGI捆绑包错误:捆绑包73中未解析的包:package=org.apache.commons.httpclient 我必须使用camel http组件 我在POM文件中添加了依赖项。(代码清单1) 我开始遇到未解决的包错误 运行时的“package=org.apache.commons.httpclient” 因此,我添加了commons httpclient的依赖项(代码清单2)。我在嵌入式依赖项中添加了它,因为commons httpclient是一个非osgi jar 我仍然得到同样的错误 我还尝试在标签中添加这个包

Java OSGI捆绑包错误:捆绑包73中未解析的包:package=org.apache.commons.httpclient 我必须使用camel http组件 我在POM文件中添加了依赖项。(代码清单1) 我开始遇到未解决的包错误 运行时的“package=org.apache.commons.httpclient” 因此,我添加了commons httpclient的依赖项(代码清单2)。我在嵌入式依赖项中添加了它,因为commons httpclient是一个非osgi jar 我仍然得到同样的错误 我还尝试在标签中添加这个包,java,osgi,apache-camel,Java,Osgi,Apache Camel,注意-我可以在我的bundle jar的生成清单文件中的导入包下看到依赖项得到反映 代码清单1: <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-http</artifactId> <version>${camel-version}</version> <!-- us

注意-我可以在我的bundle jar的生成清单文件中的导入包下看到依赖项得到反映

代码清单1:

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-http</artifactId>
      <version>${camel-version}</version>
      <!-- use the same version as your Camel core version -->
    </dependency>

org.apache.camel
骆驼http
${camel版本}
代码清单2:

    <dependency>
      <groupId>commons-httpclient</groupId>
      <artifactId>commons-httpclient</artifactId>
      <version>3.1</version>            
    </dependency>

commons httpclient
commons httpclient
3.1

Servicemix为commons httpclient提供了一个OSGi捆绑包包装器,您是否可以尝试安装它,而不是将其嵌入到您的捆绑包中


mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient/3.1_4

您尝试过or吗?嗨,Dave,谢谢您的回复。我正在使用OSGI捆绑包。我建议您执行
功能:安装mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons httpclient/3.1_4
,然后安装您的捆绑包。看看这是否有效。命令应该是osgi:install-s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient/3.1感谢您的响应Willem。我尝试使用servicemix commons httpclient捆绑包,但错误仍然存在。您使用的是servicemix还是Karaf?使用ApacheCammel-karaf特性,camel-http特性应该是现成的。