Python 尝试连接到Java服务器时出错(127.0.0.1:34663)

Python 尝试连接到Java服务器时出错(127.0.0.1:34663),python,pyspark,apache-spark-ml,py4j,johnsnowlabs-spark-nlp,Python,Pyspark,Apache Spark Ml,Py4j,Johnsnowlabs Spark Nlp,我正在使用sparknlp,在烧瓶应用程序中。flask应用程序的目的是收听卡夫卡服务器,获取故事,处理它们并将其广播给另一个卡夫卡主题。当我启动应用程序时,它运行良好。但几个小时后,它失败了,并抛出了这个错误。错误的堆栈跟踪是: 2020-09-12 04:48:32,241 ERROR py4j.java_gateway Thread-3: An error occurred while trying to connect to the Java server (127.0.0.1:3466

我正在使用sparknlp,在烧瓶应用程序中。flask应用程序的目的是收听卡夫卡服务器,获取故事,处理它们并将其广播给另一个卡夫卡主题。当我启动应用程序时,它运行良好。但几个小时后,它失败了,并抛出了这个错误。错误的堆栈跟踪是:

2020-09-12 04:48:32,241 ERROR py4j.java_gateway Thread-3: An error occurred while trying to connect to the Java server (127.0.0.1:34663)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/py4j/java_gateway.py", line 929, in _get_connection
    connection = self.deque.pop()
IndexError: pop from an empty deque

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/py4j/java_gateway.py", line 1067, in start
    self.socket.connect((self.address, self.port))
ConnectionRefusedError: [Errno 111] Connection refused