Async I/O & async-http-client & Netty

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Async I/O & async-http-client & Netty

Philipp Bussche
Hi there,
just wanted to let you guys know that I was playing around with Async I/O
and async-http-client and there seems to be an incompatibility somewhere on
Netty. I wanted to use an async function to enrich my data with results
coming from Foursquare's API and it works fine when adding the below
dependency locally:

<dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-all</artifactId>
        <version>4.0.27.Final</version>
</dependency>

However when deploying this to my Flink server it fails with a message like
this:

java.lang.NoSuchMethodError:
io.netty.handler.ssl.SslContext.newClientContextInternal(Lio/netty/handler/ssl/SslProvider;Ljava/security/Provider;[Ljava/security/cert/X509Certificate;Ljavax/net/ssl/TrustManagerFactory;[Ljava/security/cert/X509Certificate;Ljava/security/PrivateKey;Ljava/lang/String;Ljavax/net/ssl/KeyManagerFactory;Ljava/lang/Iterable;Lio/netty/handler/ssl/CipherSuiteFilter;Lio/netty/handler/ssl/ApplicationProtocolConfig;[Ljava/lang/String;JJZ)Lio/netty/handler/ssl/SslContext;

I havent quite figured out yet where the issue comes from but I ended up
adding the netty jar file in the version I needed into Flink's lib folder
and with that it works now.

Philipp
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Async I/O & async-http-client & Netty

Aljoscha Krettek
Hi Philipp,

Thanks for the heads-up. I think it fails because Flink uses a different version of Netty that has an incompatible method signature or is missing that method completely. By placing it in the lib folder the different Netty version is in the user code class loader, which means that your code uses that version of Netty. I think.

Best,
Aljoscha

> On 5. May 2017, at 15:11, Philipp Bussche <[hidden email]> wrote:
>
> Hi there,
> just wanted to let you guys know that I was playing around with Async I/O
> and async-http-client and there seems to be an incompatibility somewhere on
> Netty. I wanted to use an async function to enrich my data with results
> coming from Foursquare's API and it works fine when adding the below
> dependency locally:
>
> <dependency>
>        <groupId>io.netty</groupId>
>        <artifactId>netty-all</artifactId>
>        <version>4.0.27.Final</version>
> </dependency>
>
> However when deploying this to my Flink server it fails with a message like
> this:
>
> java.lang.NoSuchMethodError:
> io.netty.handler.ssl.SslContext.newClientContextInternal(Lio/netty/handler/ssl/SslProvider;Ljava/security/Provider;[Ljava/security/cert/X509Certificate;Ljavax/net/ssl/TrustManagerFactory;[Ljava/security/cert/X509Certificate;Ljava/security/PrivateKey;Ljava/lang/String;Ljavax/net/ssl/KeyManagerFactory;Ljava/lang/Iterable;Lio/netty/handler/ssl/CipherSuiteFilter;Lio/netty/handler/ssl/ApplicationProtocolConfig;[Ljava/lang/String;JJZ)Lio/netty/handler/ssl/SslContext;
>
> I havent quite figured out yet where the issue comes from but I ended up
> adding the netty jar file in the version I needed into Flink's lib folder
> and with that it works now.
>
> Philipp
>
>
>
>
> --
> View this message in context: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Async-I-O-async-http-client-Netty-tp13029.html
> Sent from the Apache Flink User Mailing List archive. mailing list archive at Nabble.com.

Loading...