On Wed, 2014-06-18 at 20:44 -0300, Fernando Barbat wrote:
> Hi,
> 
> I'm trying to run Http Components in a Felix container embedded in an
> Android application.
> 
> At first there were two possibilities:
> 1 - Use HttpClient and HttpCore OSGi bundles
> Or 2 - Use HttpClient for Android
> 
> At first I tried 1, but I couldn't make it work because of its dependencies
> to org.ietf.jgss package. It isn't available on Android platform. What is
> that package for? Can I tell the container that the package is available as
> long as I don't use specific HTTP Components features? Which features use
> that package?
> 
> Then I tried 2, by "bundleizing" HttpClient for Android. I configured Felix
> to export the following packages on the system bundle
> (Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA property):
> android.net,android.os,android.util,org.apache.http.conn.routing
> 
> However, I'm getting this exception:
> 
> Caused by: java.lang.ClassNotFoundException:
> org.apache.http.client.HttpClient not found by
> org.apache.httpcomponents.httpclient-android [5]

This is because the org.apache.http.client.HttpClient interfaces (and
all interfaces and classes that exist since 4.0-beta1 release) is
shipped with Android platform and is not present in httpclient-android
jar.

Hope this helps

Oleg

>         at
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1550)
> ~[na:0.0]
>         at
> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77)
> ~[na:0.0]
>         at
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1988)
> ~[na:0.0]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:461) ~[na:0.0]
>         at
> org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1392)
> ~[na:0.0]
>         at
> org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1571)
> ~[na:0.0]
>         at
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1502)
> ~[na:0.0]
>         at
> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77)
> ~[na:0.0]
>         at
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1988)
> ~[na:0.0]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:461) ~[na:0.0]
>         ... 40 common frames omitted
> 
> I tried adding org.apache.http.client to system packages too but had no
> success. Any ideas?
> 
> Thanks!



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to