VMware {code} Community
hdo0917
Enthusiast
Enthusiast

How to use httpclient-4.1.jar and httpcore-4.1.jar under repository/usr correctly

Hi,

I need to use the package org.apache.http.client, and org.apache.http.util inside my plugin. I found that there are two version of Apache http client inside the repository: version 3.1 (com.springsource.org.apache.commons.httpclient-3.1.0.jar) and version 4.1 (httpclient-4.1.jar); same for the httcore. When I add these under Import-Package:

org.apache.http.client;version="[4.1.0,4.1.0]",

org.apache.http.util;version="[4.1.0,4.1.0]"

It complaints that it could not find the package with version 4.1.0, how do I resolve this.

Thanks,

  - hdo0917

Reply
0 Kudos
1 Reply
laurentsd
VMware Employee
VMware Employee

The solution is to nest the httpclient-4.1.jar library inside your own bundle in order to avoid conflicts with other bundles deployed on the server.  This is described in docs/FAQ.html, at the end of the section "How to use 3rd party java libraries?"

Reply
0 Kudos