Closed sangyao closed 7 years ago
Looks like a timeout of the NLP server. It is probably because the text is long.
java -mx8g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000
Greetings, Dennis
Hello, thank you for your answer,
I used the code you uploaded for testing, and didn't change anything. There will be an error for more than 50 words of article.
thank you
Best regards
Yao
In the file "bootstrap.php" find this line: define('USE_GUZZLE', TRUE);
Try setting: define('USE_GUZZLE', FALSE);
Normally CoreNLP_adapter uses "Guzzle" but maybe this is causing a problem for you. By setting it off, it will do a cURL call. Maybe this will solve the problem
Also, in "bootstrap.php" there is this line: define('ONLINE_API', FALSE);
If you set: define('ONLINE_API', TRUE);
Then you can use the online version of CoreNLP. If that works, the way that you setup the Java server is the problem.
thank you for your answer, it works, if the text max. 500 word. But it is ok for my projekt.
hello, I still have a question,every time i must start the CoreNLP serve from the command line. just like you write "java -mx8g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000"
How can my system automatically connect java server,can Apache achieve this function?
thank you very much
yao
hello Mr. Swart,
I am using functional OpenIE for English from your adapter, but when I enter a long English article, the following error occurred:
Fatal error: Uncaught GuzzleHttp\Exception\ServerException: Server error:
POST http://localhost:9000/resulted in a
500 Internal Server Errorresponse: CoreNLP request timed out. Your document may be too long. in D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113 Stack trace: #0 D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\guzzle\src\Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\promises\src\Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response)) #2 D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\promises\src\Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array) #3 D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\promises\src\TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}() #4 D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\prom in D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 113
so i have re-set the java server response time, like this:
java -mx8g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000
the following error occurred:
Fatal error: Uncaught RuntimeException: Error creating resource: [message] fopen(http://localhost:9000/): failed to open stream: HTTP request failed! [file] D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php [line] 324 in D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php:252 Stack trace: #0 D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php(335): GuzzleHttp\Handler\StreamHandler->createResource(Object(Closure)) #1 D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\guzzle\src\Handler\StreamHandler.php(52): GuzzleHttp\Handler\StreamHandler->createStream(Object(GuzzleHttp\Psr7\Request), Array) #2 D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\guzzle\src\PrepareBodyMiddleware.php(66): GuzzleHttp\Handler\StreamHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #3 D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\guzzle\src\Middleware.php(30): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) # in D:\Apache24\htdocs\stanford1\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 52
**how can i solve this problem?
Thank you and best regards**
Yao