Both httpclient-4.0.1.jar and httpcore-4.0.1.jar export package org.apache.http, this is split package issue in OSGi, which should be avoided.
You need use httpcore-osgi and httpclient-osgi bundle instead, something like
Thanks for your help.
The version I used for Httpclient and Httpcore is 4.0.1. So shall I also use exactly the same version 4.0.1 for httpcore-osgi? Or it does not matter if use 4.0.1 or 4.1.3?
Not sure if 4.0.1 OSGi bundle fixed this problem or not, give it a shot anyway.
Thanks. I got another problem:
Error executing command: Error starting bundles:
Unable to start bundle 359: Uses constraint violation. Unable to resolve bundle revision slf4j.api because it exports package 'org.slf4j.spi' and is also exposed to it from bundle revision org.ops4j.pax.logging.pax-logging-api via the following dependency chain:
export: osgi.wiring.package=org.slf4j.impl; uses:=org.slf4j.spi
Is this a similar problem like the httpcore? Is there a osgi bundle for slf4j.api? I have been looking around and find out a bundle named osgi-over-slf4j under org.slf4j group.