d2iq-archive / dcos-flink-service

11 stars 17 forks source link

Is Java 7 present in Docker image? #24

Closed ANierbeck closed 7 years ago

ANierbeck commented 7 years ago

Having a strange effect when trying to start a flink job.

Caused by: java.lang.UnsupportedClassVersionError: de/nierbeck/floating/data/stream/flink/KafkaToCassandraFlinkApp : Unsupported major.minor version 52.0

the demo application is build with JDK8. Strangely it gives me this error like if the flink runtime isn't run with Java 8.

link to sources: https://github.com/ANierbeck/BusFloatingData

joerg84 commented 7 years ago

@ANierbeck Can you provide me with the jar? Then I will update the package and test.

ANierbeck commented 7 years ago

@joerg84 sure you'll find it here: https://oss.sonatype.org/content/repositories/snapshots/de/nierbeck/floating/data/flink-digest_2.11/0.2.2-SNAPSHOT/ it's the flink-digest_2.11-0.2.2-SNAPSHOT-assembly.jar

thanks :)

ANierbeck commented 7 years ago

Tested the latest flink 1.3.1-1.0 version: following logs:

org.apache.flink.client.program.ProgramInvocationException: The program's entry point class 'de.nierbeck.floating.data.stream.flink.KafkaToCassandraFlinkApp' could not be loaded due to a linkage failure.
    at org.apache.flink.client.program.PackagedProgram.loadMainClass(PackagedProgram.java:625)
    at org.apache.flink.client.program.PackagedProgram.<init>(PackagedProgram.java:198)
    at org.apache.flink.client.program.PackagedProgram.<init>(PackagedProgram.java:148)
    at org.apache.flink.runtime.webmonitor.handlers.JarActionHandler.getJobGraphAndClassLoader(JarActionHandler.java:68)
    at org.apache.flink.runtime.webmonitor.handlers.JarPlanHandler.handleJsonRequest(JarPlanHandler.java:50)
    at org.apache.flink.runtime.webmonitor.handlers.AbstractJsonRequestHandler.handleRequest(AbstractJsonRequestHandler.java:41)
    at org.apache.flink.runtime.webmonitor.RuntimeMonitorHandler.respondAsLeader(RuntimeMonitorHandler.java:109)
    at org.apache.flink.runtime.webmonitor.RuntimeMonitorHandlerBase.channelRead0(RuntimeMonitorHandlerBase.java:97)
    at org.apache.flink.runtime.webmonitor.RuntimeMonitorHandlerBase.channelRead0(RuntimeMonitorHandlerBase.java:44)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
    at io.netty.handler.codec.http.router.Handler.routed(Handler.java:62)
    at io.netty.handler.codec.http.router.DualAbstractHandler.channelRead0(DualAbstractHandler.java:57)
    at io.netty.handler.codec.http.router.DualAbstractHandler.channelRead0(DualAbstractHandler.java:20)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
    at org.apache.flink.runtime.webmonitor.HttpRequestHandler.channelRead0(HttpRequestHandler.java:105)
    at org.apache.flink.runtime.webmonitor.HttpRequestHandler.channelRead0(HttpRequestHandler.java:65)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:147)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.UnsupportedClassVersionError: de/nierbeck/floating/data/stream/flink/KafkaToCassandraFlinkApp : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:278)
    at org.apache.flink.client.program.PackagedProgram.loadMainClass(PackagedProgram.java:614)
    ... 38 more

tested with the following artifact: https://oss.sonatype.org/content/repositories/snapshots/de/nierbeck/floating/data/flink-digest_2.11/0.3.0-SNAPSHOT/flink-digest_2.11-0.3.0-SNAPSHOT-assembly.jar it requires the setup of https://github.com/dcos/demos/tree/master/fastdata-iot/1.8 additionally flink 1.3.1-1.0 with scala 2.11 installed. Project is compiled with JDK8. sources can be found here: https://github.com/ANierbeck/BusFloatingData/tree/master/flink-digest/src

tisonet commented 7 years ago

Hi, I have the same problem. Jar is compiled with JAVA 8, but it cant be submitted in DCOS Flink UI, because of error: Unsupported major.minor version 52.0. I did some investigation and found out that base image for flink messos app master does not include JAVA 8, only JAVA 7. Moreover JAVA_HOME is set to not existing location: /usr/lib/jvm/java-8-openjdk-amd64/jre as can be seen in appmaster Dockerfile:

# The base image contains java 8, but it has no environment variables set for it.
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/jre
ANierbeck commented 7 years ago

@tisonet thanks for the pointer, tried a quick fix. @joerg84 ... might want to try this fix https://github.com/mesosphere/dcos-flink-service/pull/28 could solve the issue

EronWright commented 7 years ago

Assuming the issue was simply that the application code required Java 8, we can close this now, thanks to #28.