hotpxl / corenlp-server

Server wrapper for Stanford CoreNLP
MIT License
8 stars 0 forks source link

Trouble with linking CoreNLP #2

Open jimkang opened 8 years ago

jimkang commented 8 years ago

I'm a little confused about this step:

Stanford CoreNLP is also needed. Install separately and make a symbolic link java-lib to it.

So, I downloaded the stanford-english-corenlp-2016-01-10-models.jar file from that web page and linked it like so:

ln -s stanford-english-corenlp-2016-01-10-models.jar java-lib

After building and running my Docker image, when I try to run start-server.sh from inside the image, I get this error:

root@7d4eb917c470:/corenlp-server# ./start-server.sh 

> @ start /corenlp-server
> node index.js

CoreNLP Server listening at http://[::]:8080
Unhandled rejection Error: Could not find class edu.stanford.nlp.pipeline.StanfordCoreNLP
java.lang.NoClassDefFoundError: edu/stanford/nlp/pipeline/StanfordCoreNLP
Caused by: java.lang.ClassNotFoundException: edu.stanford.nlp.pipeline.StanfordCoreNLP
  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

    at Error (native)
    at Java.tryCatcher (/corenlp-server/node_modules/bluebird/js/release/util.js:16:23)
    at Java.ret [as newInstanceAsync] (eval at <anonymous> (/corenlp-server/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:15:23)
    at /corenlp-server/lib.js:23:17
    at tryCatcher (/corenlp-server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/corenlp-server/node_modules/bluebird/js/release/promise.js:503:31)
    at Promise._settlePromise (/corenlp-server/node_modules/bluebird/js/release/promise.js:560:18)
    at Promise._settlePromise0 (/corenlp-server/node_modules/bluebird/js/release/promise.js:605:10)
    at Promise._settlePromises (/corenlp-server/node_modules/bluebird/js/release/promise.js:684:18)
    at Promise._fulfill (/corenlp-server/node_modules/bluebird/js/release/promise.js:629:18)
    at /corenlp-server/node_modules/bluebird/js/release/nodeback.js:42:21

Any ideas about what I should be doing differently?

jimkang commented 8 years ago

Doh. It seems I thought the model links were CoreNLP itself.

jimkang commented 8 years ago

OK, if the correct zip file is downloaded, and the directory linked as java-lib, the next problem is that the jar versions are wrong in lib.js. (Currently 3.6.0, is 3.5.2 in the code.)

hotpxl commented 8 years ago

Sorry for the late reply. Glad you found it out yourself. I haven't touch this code for a long time. Does it work with newer version?

jimkang commented 8 years ago

Well, it does run, but I can't seem to get a response from the http server. (I stopped there a few days ago, so unfortunately, I have no further details.)