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

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

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
|

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

JGoldstein
This is happening to me as well, both when using async-http-client (due to netty conflict) and when using play-ws (due to akka conflict).

I've documented it in a recent stack overflow question:
https://stackoverflow.com/questions/45297820/akka-version-collision-between-flink-and-play-2-5

Dropping dependencies in the lib file (as described in the post) seems like a hacky solution that will eventually break.
Is there a better way to solve this?