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

Wei Zhong commented on FLINK-17436:
-----------------------------------

Hi [~chesnay] I have updated the description. The IllegalAccessError is thrown 
because though the `PythonProgramOptions` has the same package name with 
`CliFrontendParser`, they are loaded by different class loader, which are 
recognized as different package. So the `PythonProgramOptions` can not access 
the package-private content of `CliFrontendParser` in actual usage i.e "flink 
run".

> When submitting Python job via "flink run" a IllegalAccessError will be 
> raised due to the package's private access control
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-17436
>                 URL: https://issues.apache.org/jira/browse/FLINK-17436
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Python
>    Affects Versions: 1.11.0
>            Reporter: Wei Zhong
>            Assignee: Wei Zhong
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.11.0
>
>
> Currently when submitting Python job via "flink run" a IllegalAccessError 
> will be raised due to the package's private access control. We should fix 
> this issue.
> This issue Error can be simply reproduced by such a command:
> {code:java}
> ./flink run -c org.apache.flink.client.python.PythonGatewayServer 
> ../opt/flink-python_2.11-1.11-SNAPSHOT.jar
> {code}
> The error can be found in the client log file:
> {code:java}
> org.apache.flink.client.cli.CliArgsException: Python command line option 
> detected but the flink-python module seems to be missing or not working as 
> expected.
>       at 
> org.apache.flink.client.cli.ProgramOptionsUtils.createPythonProgramOptions(ProgramOptionsUtils.java:91)
>  ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
>       at 
> org.apache.flink.client.cli.ProgramOptions.create(ProgramOptions.java:185) 
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
>       at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:179) 
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
>       at 
> org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:868) 
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
>       at 
> org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:941) 
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
>       at 
> org.apache.flink.runtime.security.contexts.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30)
>  [flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
>       at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:941) 
> [flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
> Caused by: java.lang.reflect.InvocationTargetException
>       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
> Method) ~[?:1.8.0_172]
>       at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>  ~[?:1.8.0_172]
>       at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>  ~[?:1.8.0_172]
>       at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
> ~[?:1.8.0_172]
>       at 
> org.apache.flink.client.cli.ProgramOptionsUtils.createPythonProgramOptions(ProgramOptionsUtils.java:85)
>  ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
>       ... 6 more
> Caused by: java.lang.IllegalAccessError: tried to access field 
> org.apache.flink.client.cli.CliFrontendParser.ARGS_OPTION from class 
> org.apache.flink.client.cli.PythonProgramOptions
>       at 
> org.apache.flink.client.cli.PythonProgramOptions.extractProgramArgs(PythonProgramOptions.java:61)
>  ~[?:?]
>       at 
> org.apache.flink.client.cli.ProgramOptions.<init>(ProgramOptions.java:79) 
> ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
>       at 
> org.apache.flink.client.cli.PythonProgramOptions.<init>(PythonProgramOptions.java:47)
>  ~[?:?]
>       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
> Method) ~[?:1.8.0_172]
>       at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>  ~[?:1.8.0_172]
>       at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>  ~[?:1.8.0_172]
>       at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
> ~[?:1.8.0_172]
>       at 
> org.apache.flink.client.cli.ProgramOptionsUtils.createPythonProgramOptions(ProgramOptionsUtils.java:85)
>  ~[flink-dist_2.11-1.11-SNAPSHOT.jar:1.11-SNAPSHOT]
>       ... 6 more
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to