[ 
https://issues.apache.org/jira/browse/FLINK-5739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15860888#comment-15860888
 ] 

ASF GitHub Bot commented on FLINK-5739:
---------------------------------------

GitHub user clarkyzl opened a pull request:

    https://github.com/apache/flink/pull/3292

    [FLINK-5739] [client] fix NullPointerException in CliFrontend

    Type: Bug
    Priority: Major
    Problem Definition: CliFrontEnd throws a NullPointerException
    Design:
    see https://issues.apache.org/jira/browse/FLINK-5739
    Client will throw a NullPointerException if use forgot to call method 
"execute()".
    User may be confused by this NullPointerException. This patch adds a 
message here, and makes the NullPointerException meaningful.
    Impact Analysis:
    Only the client and messages are affected.
    Test:
    mvn clean verify has been done.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/clarkyzl/flink master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/3292.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3292
    
----
commit 2921e4170502f54e1c2fb11e22cb2169deebe78e
Author: Zhuoluo Yang <[email protected]>
Date:   2017-02-10T07:22:50Z

    [FLINK-5739] [client] fix NullPointerException in CliFrontend

commit db035643c782fb65c26efd10c8bf36d4173103f0
Author: Zhuoluo Yang <[email protected]>
Date:   2017-02-10T07:33:35Z

    [FLINK-5739] [client] fix code style

----


> NullPointerException in CliFrontend
> -----------------------------------
>
>                 Key: FLINK-5739
>                 URL: https://issues.apache.org/jira/browse/FLINK-5739
>             Project: Flink
>          Issue Type: Bug
>          Components: Client
>    Affects Versions: 1.3.0
>         Environment: Mac OS X 10.12.2, Java 1.8.0_92-b14
>            Reporter: Zhuoluo Yang
>             Fix For: 1.3.0
>
>
> I've run a simple program on a local cluster. It always fails with code 
> Version: 1.3-SNAPSHOTCommit: e24a866. 
> {quote}
> Zhuoluos-MacBook-Pro:build-target zhuoluo.yzl$ bin/flink run -c 
> com.alibaba.blink.TableApp ~/gitlab/tableapp/target/tableapp-1.0-SNAPSHOT.jar 
> Cluster configuration: Standalone cluster with JobManager at 
> localhost/127.0.0.1:6123
> Using address localhost:6123 to connect to JobManager.
> JobManager web interface address http://localhost:8081
> Starting execution of program
> ------------------------------------------------------------
>  The program finished with the following exception:
> java.lang.NullPointerException
>       at 
> org.apache.flink.client.CliFrontend.executeProgram(CliFrontend.java:845)
>       at org.apache.flink.client.CliFrontend.run(CliFrontend.java:259)
>       at 
> org.apache.flink.client.CliFrontend.parseParameters(CliFrontend.java:1076)
>       at org.apache.flink.client.CliFrontend$2.call(CliFrontend.java:1123)
>       at org.apache.flink.client.CliFrontend$2.call(CliFrontend.java:1120)
>       at 
> org.apache.flink.runtime.security.HadoopSecurityContext$1.run(HadoopSecurityContext.java:43)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at javax.security.auth.Subject.doAs(Subject.java:422)
>       at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548)
>       at 
> org.apache.flink.runtime.security.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:40)
>       at org.apache.flink.client.CliFrontend.main(CliFrontend.java:1120)
> {quote}
> I don't think there should be a NullPointerException here, even if you forgot 
> the "execute()" call.
> The reproducing code looks like following:
> {code:java}
>     public static void main(String[] args) throws Exception {
>         ExecutionEnvironment env = 
> ExecutionEnvironment.getExecutionEnvironment();
>         DataSource<String> customer = 
> env.readTextFile("/Users/zhuoluo.yzl/customer.tbl");
>         customer.filter(new FilterFunction<String>() {
>             public boolean filter(String value) throws Exception {
>                 return true;
>             }
>         })
>         .writeAsText("/Users/zhuoluo.yzl/customer.txt");
> //        env.execute();
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to