Shadab Ali
Shadab Ali

Reputation: 53

OSGI bundle error: Unresolved package in bundle 73:package=org.apache.commons.httpclient

  1. I have to use camel-http component.
  2. I added the dependencies in the POM file. (Code Listing 1)
  3. I started getting Unresolved package error for "package=org.apache.commons.httpclient" at Runtime.
  4. So I have added the dependency for commons-httpclient (Code Listing 2). I added it in embedded-dependency because commons-httpclient is a non-osgi jar.
  5. I am still getting the same error.
  6. I also tried adding this package in tag.

Note - I can see the dependencies getting reflected under Import-Package, in the generated MANIFEST file of my bundle jar.

Code Listing 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>

Code Listing 2:

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

Upvotes: 0

Views: 1273

Answers (1)

Willem Jiang
Willem Jiang

Reputation: 3291

Servicemix has an OSGi bundle wrapper for the commons-httpclient, can you try to install it instead of embedding it in your bundle ?

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

Upvotes: 0

Related Questions