You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by "Khare, Aparna" <ap...@sap.com> on 2018/04/10 09:53:15 UTC

RE: Versions and osgi and async and such

Hi All ,

   We are also trying to use the lastest HTTPClient 4.5.5 with Asycn Httpclient ..

When we try to bundle the latest Async HttpClient we are not able to start the application because of missing dependency.. we need to find the relevant OSGI jars httpclient-cache-4.5.3 etc  which we could bundle

Can someone guide here ...

Thanks,
Aparma

-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com] 
Sent: Wednesday, September 14, 2016 5:44 PM
To: HttpClient User Discussion <ht...@hc.apache.org>
Subject: Versions and osgi and async and such

I am struggling to maintain some code that wants to use the latest 4.x
version of http asynchronous client via OSGi.

The latest async client is 4.1.2. I've had this working, but a small change
has put me in a state where various things implode, so I'm trying to start
over from first principles.

When I use that as a dependency, I end up with ...


java.lang.NoSuchMethodError:
org.apache.http.util.Asserts.check(ZLjava/lang/String;Ljava/lang/Object;)V
        at
org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRunning(CloseableHttpAsyncClientBase.java:90)
        at
org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:123)
        at
org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:75)
        at
org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:108)
        at
org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:92)

Re: Versions and osgi and async and such

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2018-04-12 at 08:15 +0000, Khare, Aparna wrote:
> Hi,
> 
>   We tried and we are able to get our bundle up with the dependency
> of the httpclient async.. This is not an OSGI but via writing to the
> bundle classpath from pom.
> 
> <httpcore.version>4.4</httpcore.version>
> 		<httpclient.version>4.5.4</httpclient.version>
> 		<asyncclient.version>4.1.3</asyncclient.version>
> 		<commons-logging.version>1.2</commons-logging.version>
> 		<commons-io.version>2.4</commons-io.version>
> 
> <dependency>
> 			<groupId>org.apache.httpcomponents</groupId>
> 			<artifactId>httpasyncclient</artifactId>
> 			<version>${asyncclient.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.httpcomponents</groupId>
> 			<artifactId>httpcore</artifactId>
> 			<version>${httpcore.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.httpcomponents</groupId>
> 			<artifactId>httpcore-nio</artifactId>
> 			<version>${httpcore.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.httpcomponents</groupId>
> 			<artifactId>httpclient</artifactId>
> 			<version>${httpclient.version}</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>commons-logging</groupId>
> 			<artifactId>commons-logging</artifactId>
> 			<version>${commons-logging.version}</version>
> 		</dependency>
> 		<dependency>
> 
> 
> But when I run my service I'm getting  
> 
> java.lang.NoSuchMethodError:
> org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.<init>(Lo
> rg/apache/http/impl/nio/reactor/IOReactorConfig;Ljava/util/concurrent
> /ThreadFactory;)V
> 	org.apache.http.impl.nio.client.IOReactorUtils.create(IOReactor
> Utils.java:43)
> 	org.apache.http.impl.nio.client.HttpAsyncClientBuilder.build(Ht
> tpAsyncClientBuilder.java:666)
> 	org.apache.http.impl.nio.client.HttpAsyncClients.createDefault(
> HttpAsyncClients.java:60)
> 
> I tried moving to the different version of httpcore.. It still does
> not work.
> 
> Can some please help here
> 

There still must be an older version of HttpCore on your classpath.

Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


RE: Versions and osgi and async and such

Posted by "Khare, Aparna" <ap...@sap.com>.
Hi,

  We tried and we are able to get our bundle up with the dependency of the httpclient async.. This is not an OSGI but via writing to the bundle classpath from pom.

<httpcore.version>4.4</httpcore.version>
		<httpclient.version>4.5.4</httpclient.version>
		<asyncclient.version>4.1.3</asyncclient.version>
		<commons-logging.version>1.2</commons-logging.version>
		<commons-io.version>2.4</commons-io.version>

<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpasyncclient</artifactId>
			<version>${asyncclient.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore</artifactId>
			<version>${httpcore.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore-nio</artifactId>
			<version>${httpcore.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>${httpclient.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
			<version>${commons-logging.version}</version>
		</dependency>
		<dependency>


But when I run my service I'm getting  

java.lang.NoSuchMethodError: org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.<init>(Lorg/apache/http/impl/nio/reactor/IOReactorConfig;Ljava/util/concurrent/ThreadFactory;)V
	org.apache.http.impl.nio.client.IOReactorUtils.create(IOReactorUtils.java:43)
	org.apache.http.impl.nio.client.HttpAsyncClientBuilder.build(HttpAsyncClientBuilder.java:666)
	org.apache.http.impl.nio.client.HttpAsyncClients.createDefault(HttpAsyncClients.java:60)

I tried moving to the different version of httpcore.. It still does not work.

Can some please help here


-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@apache.org] 
Sent: Tuesday, April 10, 2018 6:22 PM
To: HttpClient User Discussion <ht...@hc.apache.org>
Subject: Re: Versions and osgi and async and such

On Tue, 2018-04-10 at 09:53 +0000, Khare, Aparna wrote:
> Hi All ,
> 
>    We are also trying to use the lastest HTTPClient 4.5.5 with Asycn
> Httpclient ..
> 
> When we try to bundle the latest Async HttpClient we are not able to
> start the application because of missing dependency.. we need to find
> the relevant OSGI jars httpclient-cache-4.5.3 etc  which we could
> bundle
> 
> Can someone guide here ...
> 
> Thanks,
> Aparma

Aparma

You need to latest version of HttpCore 4.4.x OSGi bundle and HttpClient
4.5.x OSGi bundle.

http://hc.apache.org/downloads.cgi

Oleg.



> 
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com] 
> Sent: Wednesday, September 14, 2016 5:44 PM
> To: HttpClient User Discussion <ht...@hc.apache.org>
> Subject: Versions and osgi and async and such
> 
> I am struggling to maintain some code that wants to use the latest
> 4.x
> version of http asynchronous client via OSGi.
> 
> The latest async client is 4.1.2. I've had this working, but a small
> change
> has put me in a state where various things implode, so I'm trying to
> start
> over from first principles.
> 
> When I use that as a dependency, I end up with ...
> 
> 
> java.lang.NoSuchMethodError:
> org.apache.http.util.Asserts.check(ZLjava/lang/String;Ljava/lang/Obje
> ct;)V
>         at
> org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRu
> nning(CloseableHttpAsyncClientBase.java:90)
>         at
> org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(Inter
> nalHttpAsyncClient.java:123)
>         at
> org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(Clos
> eableHttpAsyncClient.java:75)
>         at
> org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(Clos
> eableHttpAsyncClient.java:108)
>         at
> org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(Clos
> eableHttpAsyncClient.java:92)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Versions and osgi and async and such

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2018-04-10 at 09:53 +0000, Khare, Aparna wrote:
> Hi All ,
> 
>    We are also trying to use the lastest HTTPClient 4.5.5 with Asycn
> Httpclient ..
> 
> When we try to bundle the latest Async HttpClient we are not able to
> start the application because of missing dependency.. we need to find
> the relevant OSGI jars httpclient-cache-4.5.3 etc  which we could
> bundle
> 
> Can someone guide here ...
> 
> Thanks,
> Aparma

Aparma

You need to latest version of HttpCore 4.4.x OSGi bundle and HttpClient
4.5.x OSGi bundle.

http://hc.apache.org/downloads.cgi

Oleg.



> 
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com] 
> Sent: Wednesday, September 14, 2016 5:44 PM
> To: HttpClient User Discussion <ht...@hc.apache.org>
> Subject: Versions and osgi and async and such
> 
> I am struggling to maintain some code that wants to use the latest
> 4.x
> version of http asynchronous client via OSGi.
> 
> The latest async client is 4.1.2. I've had this working, but a small
> change
> has put me in a state where various things implode, so I'm trying to
> start
> over from first principles.
> 
> When I use that as a dependency, I end up with ...
> 
> 
> java.lang.NoSuchMethodError:
> org.apache.http.util.Asserts.check(ZLjava/lang/String;Ljava/lang/Obje
> ct;)V
>         at
> org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRu
> nning(CloseableHttpAsyncClientBase.java:90)
>         at
> org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(Inter
> nalHttpAsyncClient.java:123)
>         at
> org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(Clos
> eableHttpAsyncClient.java:75)
>         at
> org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(Clos
> eableHttpAsyncClient.java:108)
>         at
> org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(Clos
> eableHttpAsyncClient.java:92)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org