flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chiwan Park <chiwanp...@apache.org>
Subject Re: Getting an eeror while running the code
Date Mon, 27 Jul 2015 11:18:34 GMT
Oh, I confused Streaming API with Batch API. :) Stephen’s comment will help you.

Regards,
Chiwan Park

> On Jul 27, 2015, at 4:22 PM, Stephan Ewen <sewen@apache.org> wrote:
> 
> Your program gives this exception: java.lang.UnsupportedClassVersionError:
> 
> This usually means that a JVM tries to load code that has been compiled
> with a newer Java version. For example, Java 7 running a Java 8 program.
> 
> Per stack Overflow:
> http://stackoverflow.com/questions/10382929/how-to-fix-unsupported-major-minor-version-51-0-error
> 
> 
> 
> On Mon, Jul 27, 2015 at 7:22 AM, Chiwan Park <chiwanpark@apache.org> wrote:
> 
>> Hi, print() method runs the program immediately. After execution, there is
>> no sink in
>> the program. You should remove calling execute() method after calling
>> print() method.
>> 
>> There is more detail description [1][2] in Flink documentation. I hope
>> that this helps.
>> 
>> Regards,
>> Chiwan Park
>> 
>> [1]
>> https://ci.apache.org/projects/flink/flink-docs-release-0.9/apis/programming_guide.html#lazy-evaluation
>> [2]
>> https://ci.apache.org/projects/flink/flink-docs-release-0.9/apis/programming_guide.html#data-sinks
>> 
>>> On Jul 27, 2015, at 1:41 PM, bharathkarnam <mailbharathk@gmail.com>
>> wrote:
>>> 
>>> bin/flink run -c com.hello.flink.StreamData /home/a544403/Flinkstream.jar
>>> org.apache.flink.client.program.ProgramInvocationException: The program's
>>> entry point class 'com.hello.flink.StreamData' could not be loaded due
>> to a
>>> linkage failure.
>>>       at
>>> 
>> org.apache.flink.client.program.PackagedProgram.loadMainClass(PackagedProgram.java:527)
>>>       at
>>> 
>> org.apache.flink.client.program.PackagedProgram.<init>(PackagedProgram.java:142)
>>>       at
>>> org.apache.flink.client.CliFrontend.buildProgram(CliFrontend.java:654)
>>>       at org.apache.flink.client.CliFrontend.run(CliFrontend.java:256)
>>>       at
>>> org.apache.flink.client.CliFrontend.parseParameters(CliFrontend.java:880)
>>>       at org.apache.flink.client.CliFrontend.main(CliFrontend.java:922)
>>> Caused by: java.lang.UnsupportedClassVersionError:
>>> com/hello/flink/StreamData : Unsupported major.minor version 52.0
>>>       at java.lang.ClassLoader.defineClass1(Native Method)
>>>       at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
>>>       at
>>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
>>>       at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
>>>       at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
>>>       at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
>>>       at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
>>>       at java.security.AccessController.doPrivileged(Native Method)
>>>       at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
>>>       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:274)
>>>       at
>>> 
>> org.apache.flink.client.program.PackagedProgram.loadMainClass(PackagedProgram.java:516)
>>>       ... 5 more
>>> 
>>> here is my code
>>> 
>>> package com.hello.flink;
>>> 
>>> import
>>> org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
>>> import org.apache.flink.streaming.connectors.kafka.api.KafkaSource;
>>> import org.apache.flink.streaming.util.serialization.SimpleStringSchema;
>>> 
>>> public class StreamData {
>>> 
>>>      public static void main(String[] args) {
>>> 
>>>              StreamExecutionEnvironment env =
>>> StreamExecutionEnvironment.getExecutionEnvironment();
>>> 
>>> 
>>>              env.addSource(new KafkaSource<String>("localhost:2181",
>>> "syslog_framework", new SimpleStringSchema())).print();
>>> 
>>> 
>>>              try {
>>>                      env.execute("MyJob");
>>>              } catch (Exception e) {
>>>                      // TODO Auto-generated catch block
>>>                      e.printStackTrace();
>>>              }
>>> 
>>>      }
>>> 
>>> }
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>> http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/Getting-an-eeror-while-running-the-code-tp7154.html
>>> Sent from the Apache Flink Mailing List archive. mailing list archive at
>> Nabble.com.
>> 
>> 
>> 




Mime
View raw message