1

I have 2 applications. The first is a Play! Framework (v2.5.1) application. This application's job is to read the aggregated data. The second is an Apache Flink (v1.1.2) application. This application's job is to write the aggregated data.

The error

java.lang.NoSuchMethodError: com.typesafe.config.ConfigFactory.defaultApplication(Lcom/typesafe/config/ConfigParseOptions;)Lcom/typesafe/config/Config;

This is caused by Play & Flink using different versions of com.typesafe.config (1.3.0 vs 1.2.1).

I've tried

I've tried using shading, but there are further complications when I get to using Akka. Akka also has conflicting versions, so I shade config & akka, which leads to a configuration error in Akka. If I duplicate the configuration to the correct path, then the ActorSystem fails to initialize because of incorrect class version.

Research

I don't know this area well, but it seems like a number of JVM servers handle this by doing parent-last class loading. Is that possible in flink?

There may be other, simple solutions that I've not tried as well. If there are some of those, let me know, and I'll gladly try them.

Thanks for your help!

mbarlocker
  • 1,310
  • 10
  • 16
  • Why don't you define the 2 applications as separate projects in sbt? – Chobeat Sep 27 '16 at 07:05
  • Thanks for the suggestion. There is a project for the play application, a separate project for the flink application/module, and a third project for the common code. Flink and Play both depend on that common project. Any other ideas? – mbarlocker Sep 27 '16 at 14:28
  • I believe they should run on different jvms with different classpaths and so defining dependencies in isolation should be fine. Are you actually including all the dependencies in the common project? – Chobeat Sep 27 '16 at 15:13
  • If I run a LocalExecutionEnvironment, everything works great. When I bundle it up and run it on a running Flink standalone server, I get JAR hell. Looking at the flink source, it looks like it's all the same JVM with shared dependencies. I'm exploring creating my own classpath right now. – mbarlocker Sep 27 '16 at 18:11
  • Possible duplicate of [AWS SDK conflicts in Apache Flink enviromnent](https://stackoverflow.com/questions/46907526/aws-sdk-conflicts-in-apache-flink-enviromnent) – Yaroslav Oct 25 '17 at 12:37

0 Answers0