Open songyang-dev opened 2 years ago
Is this some issue with Windows not freeing up the port quickly enough? I can run the server multiple times in a row and it works fine for me. No idea about VSCode, though.
One thought that has been in the back of my mind for a while is that there's no reason the functionality of the server can't just be in a subprocess pipe for people who need annotations from a local java process. Aside from the problem that editing the server code was the original inspiration for Dante's Inferno
Describe the bug The CoreNLP server is not stopped automatically after the
with
statement in Python is finished. This happens during interactive Python sessions and running Python scripts as a whole. The server will close itself if the terminal session is closed.To Reproduce Steps to reproduce the behavior:
if name == "main": text = "Chris Manning is a nice person. Chris wrote a simple sentence. He also gives oranges to people." with CoreNLPClient( annotators=[ "tokenize", "ssplit", "pos", "lemma", "ner", "parse", "depparse", "coref", ], timeout=30000, memory="6G", ) as client: ann = client.annotate(text)
$ py -3.9 -i extraction/preprocess.py 2022-02-11 17:52:07 INFO: Writing properties to tmp file: corenlp_server-f591e0f5098f4ab5.props Traceback (most recent call last): File "C:\Users\songy\miniconda3\lib\site-packages\stanza\server\client.py", line 132, in start sock.bind((self.host, self.port)) OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\songy\Documents\My Documents\UDEM\master thesis\uml data\database\cleaning\3step\extraction\preprocess.py", line 16, in
with CoreNLPClient(
File "C:\Users\songy\miniconda3\lib\site-packages\stanza\server\client.py", line 185, in enter
self.start()
File "C:\Users\songy\miniconda3\lib\site-packages\stanza\server\client.py", line 139, in start
raise PermanentlyFailedException("Error: unable to start the CoreNLP server on port %d "
stanza.server.client.PermanentlyFailedException: Error: unable to start the CoreNLP server on port 9000 (possibly something is already running there)