start NLP server - could not find or load main class cc.factor.app.nlp.NLP

18 views
Skip to first unread message

Jim Song

unread,
Jan 23, 2018, 2:11:19 PM1/23/18
to Factorie
I am following the basic installation steps to start the NLP server:

$ bin/fac nlp --wsj-forward-pos --conll-chain-ner
java -Xmx6g -ea -Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -classpath ./src/main/resources:./target/classes:./target/factorie_2.12-1.3-SNAPSHOT-nlp-jar-with-dependencies.jar
Error: Could not find or load main class cc.factorie.app.nlp.NLP

I am on Windows7 cygwin. I can see the class file under target/classes folder. mvn install packages all ran fine and built two jars under target

factorie_2.12-1.3-SNAPSHOT.jar
factorie_2.12-1.3-SNAPSHOT-jar-with-dependencies.jar

Any idea how to get this fixed?

Emma Strubell

unread,
Jan 23, 2018, 2:17:38 PM1/23/18
to dis...@factorie.cs.umass.edu
It looks like you're including factorie_2.12-1.3-SNAPSHOT-nlp-jar-with-dependencies.jar on the classpath but maven built only: factorie_2.12-1.3-SNAPSHOT-jar-with-dependencies.jar

--
--
Factorie Discuss group.
To post, email: dis...@factorie.cs.umass.edu
To unsubscribe, email: discuss+u...@factorie.cs.umass.edu

Jim Song

unread,
Jan 23, 2018, 2:44:45 PM1/23/18
to Factorie
I did have the nlp jar, about 800 MB, in the target directory as well.

-rwxrwx---+ 1 842949368 Jan 23 10:43 factorie_2.12-1.3-SNAPSHOT-nlp-jar-with-dependencies.jar

I ran a couple of mvn commands, so I actually have three jars in the target directory. I tried editing the classpath in bin/fac to only use the nlp jar, and not use classes under target, but got the same error.

Nicholas Monath

unread,
Jan 23, 2018, 6:33:12 PM1/23/18
to dis...@factorie.cs.umass.edu
Could this have to do with java expecting windows filepaths, not cygwin/unix style paths? http://www.inonit.com/cygwin/faq/   https://stackoverflow.com/questions/9690756/how-to-run-java-from-cygwin 

---
You received this message because you are subscribed to the Google Groups "Factorie" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@factorie.cs.umass.edu.

Jim Song

unread,
Jan 24, 2018, 10:42:58 AM1/24/18
to Factorie
I changed the path to use / but got the same error.
java -Xmx6g -ea -Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -classpath .\src\main\resources:.\target\classes:.\target\factorie_2.12-1.3-SNAPSHOT-nlp-jar-with-dependencies.jar cc.factorie.app.nlp.NLP --wsj-forward-pos --conll-chain-ner

Error: Could not find or load main class cc.factorie.app.nlp.NLP

Running the tutorial example, I am seeing warning messages about "multiple versions of scala libraries detected". Maybe that's the problem the main class can't be loaded?
$ mvn scala:run -DmainClass=cc.factorie.tutorial.Grid
[INFO] --- scala-maven-plugin:3.3.1:run (default-cli) @ factorie_2.12 ---
[WARNING] Expected all dependencies to require Scala version: 2.12.4
[WARNING] cc.factorie:factorie_2.12:1.3-SNAPSHOT requires scala version: 2.12.4
[WARNING] cc.factorie:factorie_2.12:1.3-SNAPSHOT requires scala version: 2.12.4
[WARNING] org.scala-lang:scala-compiler:2.12.4 requires scala version: 2.12.4
[WARNING] org.scala-lang:scala-reflect:2.12.4 requires scala version: 2.12.4
[WARNING] org.scala-lang.modules:scala-xml_2.12:1.0.6 requires scala version: 2.12.0
[WARNING] Multiple versions of scala libraries detected!
[WARNING] Not mainClass or valid launcher found/define
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

Jim Song

unread,
Jan 24, 2018, 2:57:57 PM1/24/18
to Factorie
Thanks Nicholas. That's it. (I forgot to change the semi-colons).
Reply all
Reply to author
Forward
0 new messages