Skip to content

Commit fa089fc

Browse files
committed
Add Installation issue Q2: Java gateway process exited before sending its port number
1 parent 0f35cab commit fa089fc

File tree

2 files changed

+86
-3
lines changed

2 files changed

+86
-3
lines changed

README.md

+83
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Frequently Asked Questions around PyFlink.
77

88
Q1: [Scala 2.11 VS Scala 2.12](#q1-scala-211-vs-scala-212)
99

10+
Q2: [Java gateway process exited before sending its port number](#q2-java-gateway-process-exited-before-sending-its-port-number)
11+
1012
## JDK issues:
1113

1214
Q1: [InaccessibleObjectException: Unable to make field private final byte[] java.lang.String.value accessible: module java.base does not "opens java.lang" to unnamed module @4e4aea35](#q1-inaccessibleobjectexception-unable-to-make-field-private-final-byte-javalangstringvalue-accessible-module-javabase-does-not-opens-javalang-to-unnamed-module-4e4aea35)
@@ -39,6 +41,87 @@ Q3: [Types.BIG_INT() VS Types.LONG()](#q3-typesbig_int-vs-typeslong)
3941

4042
PyFlink only provides official installation packages which contain JAR packages for Scala 2.11 before Flink 1.15 and Scala 2.12 since Flink 1.15+. If you want to use Scala 2.12, you can download the [binary distribution](https://flink.apache.org/downloads.html) of Scala 2.12, unzip it and then set the environment variable **FLINK_HOME** to point to the unzipped directory. This makes it use the JAR packages specified by **FLINK_HOME** instead of the JAR packages under PyFlink installation package. You can refer to [PyFlink documentation](https://nightlies.apache.org/flink/flink-docs-stable/docs/dev/python/environment_variables/) for more details.
4143

44+
## Q2: Java gateway process exited before sending its port number
45+
46+
The exception stack is as following:
47+
```shell
48+
Traceback (most recent call last):
49+
File "/Users/dianfu/code/src/github/pyflink-faq/testing/test_utils.py", line 122, in setUp
50+
self.t_env = TableEnvironment.create(EnvironmentSettings.in_streaming_mode())
51+
File "/Users/dianfu/code/src/github/pyflink-faq/testing/.venv/lib/python3.8/site-packages/apache_flink-1.14.4-py3.8-macosx-10.9-x86_64.egg/pyflink/table/environment_settings.py", line 267, in in_streaming_mode
52+
get_gateway().jvm.EnvironmentSettings.inStreamingMode())
53+
File "/Users/dianfu/code/src/github/pyflink-faq/testing/.venv/lib/python3.8/site-packages/apache_flink-1.14.4-py3.8-macosx-10.9-x86_64.egg/pyflink/java_gateway.py", line 62, in get_gateway
54+
_gateway = launch_gateway()
55+
File "/Users/dianfu/code/src/github/pyflink-faq/testing/.venv/lib/python3.8/site-packages/apache_flink-1.14.4-py3.8-macosx-10.9-x86_64.egg/pyflink/java_gateway.py", line 112, in launch_gateway
56+
raise Exception("Java gateway process exited before sending its port number")
57+
Exception: Java gateway process exited before sending its port number
58+
```
59+
60+
This issue is usually caused by the reason that PyFlink isn't installed correctly. You can verify whether PyFlink is installed correctly as following:
61+
62+
Execute the following command:
63+
```
64+
python -c "import pyflink;import os;print(os.path.dirname(os.path.abspath(pyflink.__file__)))"
65+
```
66+
It will print something like the following:
67+
```shell
68+
/Users/dianfu/code/src/github/pyflink-faq/testing/.venv/lib/python3.8/site-packages/pyflink
69+
```
70+
71+
Execute the following command:
72+
```shell
73+
ls -lh /Users/dianfu/code/src/github/pyflink-faq/testing/.venv/lib/python3.8/site-packages/pyflink/
74+
```
75+
76+
The structure should be as following:
77+
```
78+
total 136
79+
-rw-r--r-- 1 dianfu staff 1.3K Apr 25 09:26 README.txt
80+
-rw-r--r-- 1 dianfu staff 1.9K Apr 25 09:26 __init__.py
81+
drwxr-xr-x 11 dianfu staff 352B Apr 25 09:26 __pycache__
82+
drwxr-xr-x 25 dianfu staff 800B Apr 25 09:26 bin
83+
drwxr-xr-x 21 dianfu staff 672B Apr 25 09:26 common
84+
drwxr-xr-x 13 dianfu staff 416B Apr 25 09:26 conf
85+
drwxr-xr-x 20 dianfu staff 640B Apr 25 09:26 datastream
86+
drwxr-xr-x 4 dianfu staff 128B Apr 25 09:26 examples
87+
-rw-r--r-- 1 dianfu staff 3.2K Apr 25 09:26 find_flink_home.py
88+
drwxr-xr-x 25 dianfu staff 800B Apr 25 09:26 fn_execution
89+
-rw-r--r-- 1 dianfu staff 9.1K Apr 25 09:26 gen_protos.py
90+
-rw-r--r-- 1 dianfu staff 7.6K Apr 25 09:26 java_gateway.py
91+
drwxr-xr-x 11 dianfu staff 352B Apr 25 09:26 lib
92+
drwxr-xr-x 28 dianfu staff 896B Apr 25 09:26 licenses
93+
drwxr-xr-x 4 dianfu staff 128B Apr 25 09:26 log
94+
drwxr-xr-x 5 dianfu staff 160B Apr 25 09:26 metrics
95+
drwxr-xr-x 4 dianfu staff 128B Apr 25 09:26 opt
96+
drwxr-xr-x 11 dianfu staff 352B Apr 25 09:26 plugins
97+
-rw-r--r-- 1 dianfu staff 1.3K Apr 25 09:26 pyflink_callback_server.py
98+
-rw-r--r-- 1 dianfu staff 12K Apr 25 09:26 pyflink_gateway_server.py
99+
-rw-r--r-- 1 dianfu staff 5.3K Apr 25 09:26 serializers.py
100+
-rw-r--r-- 1 dianfu staff 7.9K Apr 25 09:26 shell.py
101+
drwxr-xr-x 31 dianfu staff 992B Apr 25 09:26 table
102+
drwxr-xr-x 6 dianfu staff 192B Apr 25 09:26 util
103+
-rw-r--r-- 1 dianfu staff 1.1K Apr 25 09:26 version.py
104+
```
105+
106+
Please check whether the directories `lib`, `opt` are available. Besides, the jar packages under these directories should be as following:
107+
```shell
108+
(.venv) (base) dianfu@B-7174MD6R-1908 testing % ls -lh /Users/dianfu/code/src/github/pyflink-faq/testing/.venv/lib/python3.8/site-packages/pyflink/lib
109+
total 383344
110+
-rw-r--r-- 1 dianfu staff 84K Apr 25 19:58 flink-csv-1.14.4.jar
111+
-rw-r--r-- 1 dianfu staff 137M Apr 25 19:58 flink-dist_2.11-1.14.4.jar
112+
-rw-r--r-- 1 dianfu staff 150K Apr 25 19:58 flink-json-1.14.4.jar
113+
-rw-r--r-- 1 dianfu staff 7.4M Apr 25 19:58 flink-shaded-zookeeper-3.4.14.jar
114+
-rw-r--r-- 1 dianfu staff 40M Apr 25 19:58 flink-table_2.11-1.14.4.jar
115+
-rw-r--r-- 1 dianfu staff 203K Apr 25 19:58 log4j-1.2-api-2.17.1.jar
116+
-rw-r--r-- 1 dianfu staff 295K Apr 25 19:58 log4j-api-2.17.1.jar
117+
-rw-r--r-- 1 dianfu staff 1.7M Apr 25 19:58 log4j-core-2.17.1.jar
118+
-rw-r--r-- 1 dianfu staff 24K Apr 25 19:58 log4j-slf4j-impl-2.17.1.jar
119+
(.venv) (base) dianfu@B-7174MD6R-1908 testing % ls -lh /Users/dianfu/code/src/github/pyflink-faq/testing/.venv/lib/python3.8/site-packages/pyflink/opt
120+
total 76464
121+
-rw-r--r-- 1 dianfu staff 37M Apr 25 19:58 flink-python_2.11-1.14.4.jar
122+
-rw-r--r-- 1 dianfu staff 472K Apr 25 19:58 flink-sql-client_2.11-1.14.4.jar
123+
```
124+
42125
# JDK issues
43126

44127
## Q1: InaccessibleObjectException: Unable to make field private final byte[] java.lang.String.value accessible: module java.base does not "opens java.lang" to unnamed module @4e4aea35

testing/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ pip install .
1111

1212
- Check that PyFlink is installed successfully
1313
```shell
14-
python -c "import pyflink;import os;print(os.path.dirname(os.path.abspath(pyflink.__file__))+'/log')"
14+
python -c "import pyflink;import os;print(os.path.dirname(os.path.abspath(pyflink.__file__)))"
1515
```
1616

1717
It will print something like the following:
1818
```shell
19-
/Users/dianfu/code/src/github/pyflink-faq/testing/.venv/lib/python3.8/site-packages/pyflink/log
19+
/Users/dianfu/code/src/github/pyflink-faq/testing/.venv/lib/python3.8/site-packages/pyflink
2020
```
2121

2222
Execute the following command:
@@ -53,7 +53,7 @@ drwxr-xr-x 31 dianfu staff 992B Apr 25 09:26 table
5353
drwxr-xr-x 6 dianfu staff 192B Apr 25 09:26 util
5454
-rw-r--r-- 1 dianfu staff 1.1K Apr 25 09:26 version.py
5555
```
56-
Please checks that the directory `lib`, `opt`, `plugins` should be available.
56+
Please checks whether the directories `lib`, `opt` are available.
5757

5858
- Execute command `python3 -m unittest test_table_api.TableTests.test_scalar_function` to run the unit test
5959

0 commit comments

Comments
 (0)