Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-3886

Give a better error when the application Main class is not public.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0
    • None
    • None

    Description

      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)

      class Main {
         ...
      }
      

      The error you get is:

      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)
      

      This took me 30 minutes to figure out what I did wrong.
      I think the error message should be more explanatory to the developer.

      Attachments

        1. FLINK-3886-20160509.patch
          0.8 kB
          Niels Basjes

        Issue Links

          Activity

            People

              nielsbasjes Niels Basjes
              nielsbasjes Niels Basjes
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: