[ https://issues.apache.org/jira/browse/FLINK-3886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15303970#comment-15303970 ]
ASF GitHub Bot commented on FLINK-3886: --------------------------------------- GitHub user nielsbasjes opened a pull request: https://github.com/apache/flink/pull/2043 [FLINK-3886] Give a better error when the application Main class is not public. A simple fix that reduces the time needed to find the cause of this simple developer error. You can merge this pull request into a Git repository by running: $ git pull https://github.com/nielsbasjes/flink master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/2043.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 #2043 ---- commit 062879e0e74d32caa6aa09d770f8e67230181cf9 Author: Niels Basjes <nbas...@bol.com> Date: 2016-05-27T11:51:04Z [FLINK-3886] Give a better error when the application Main class is not public. ---- > Give a better error when the application Main class is not public. > ------------------------------------------------------------------ > > Key: FLINK-3886 > URL: https://issues.apache.org/jira/browse/FLINK-3886 > Project: Flink > Issue Type: Improvement > Reporter: Niels Basjes > Assignee: Niels Basjes > Attachments: FLINK-3886-20160509.patch > > > I wrote a Flink application and made the simple mistake of making the Main > class 'package private' by simply writing it as (note: I simply forgot the > 'public' keyword) > {code} > class Main { > ... > } > {code} > The error you get is: > {code} > Caused by: java.lang.IllegalAccessException: Class > org.apache.flink.client.program.PackagedProgram can not access a member of > class com.bol.experiment.flink.Main with modifiers "public static" > at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102) > at > java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296) > at > java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288) > at java.lang.reflect.Method.invoke(Method.java:490) > at > org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:505) > {code} > This took me 30 minutes to figure out what I did wrong. > I think the error message should be more explanatory to the developer. -- This message was sent by Atlassian JIRA (v6.3.4#6332)