gnu.trove error

57 views
Skip to first unread message

jiangf...@gmail.com

unread,
Apr 1, 2014, 10:07:16 AM4/1/14
to s-space-re...@googlegroups.com
Hello,

I was using the s-space package for the first time. I downloaded the source package from: https://github.com/fozziethebeat/S-Space/ , then I compile it with: mvn compile. Also I test it using "mvn test" and got no failures.

However, when I ran the code using the following command:

java -cp target/classes edu.ucla.sspace.mains.VsmMain -d data/wiki.sample data/wiki_output/

I got the following errors:

java.lang.NoClassDefFoundError: gnu/trove/map/TObjectIntMap
at edu.ucla.sspace.common.GenericTermDocumentVectorSpace.processDocument(GenericTermDocumentVectorSpace.java:199)
at edu.ucla.sspace.mains.GenericMain$1.run(GenericMain.java:586)
at edu.ucla.sspace.util.WorkQueue$CountingRunnable.run(WorkQueue.java:361)
at edu.ucla.sspace.util.WorkerThread.run(WorkerThread.java:110)
Caused by: java.lang.ClassNotFoundException: gnu.trove.map.TObjectIntMap
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 4 more

It seems that there is no gnu.trove in the package. I found no "lib" folder either.

I am wondering how could I solve it? Thank you very much!

Jiang

David Jurgens

unread,
Apr 1, 2014, 12:50:33 PM4/1/14
to s-space-re...@googlegroups.com
Hi Jiang,

It seems that there is no gnu.trove in the package. I found no "lib" folder either.

I am wondering how could I solve it? Thank you very much!

The S-Space package uses Maven to handle all its dependencies, so the GNU Trove library isn't stored locally in a lib/ directory.  However, probably the easiest workaround is to do run "mvn package".  This will wrap all of the dependencies into a single jar file in target/sspace-2.0.4-jar-with-dependencies.jar .  You can then specify this jar as the classpath, so your new command would look like this:
 
java -cp target/sspace-2.0.4-jar-with-dependencies.jar edu.ucla.sspace.mains.VsmMain -d data/wiki.sample data/wiki_output/

If you decide to change any of the source code, you'll need to add the target/ folder into the classpath before, or just run mvn package again.

  Thanks,
  David

 
You received this message because you are subscribed to the Google Groups "Semantic Space Research - Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to s-space-research...@googlegroups.com.
To post to this group, send email to s-space-re...@googlegroups.com.
Visit this group at http://groups.google.com/group/s-space-research-dev.
For more options, visit https://groups.google.com/d/optout.

tat...@gmail.com

unread,
Jun 10, 2014, 12:08:13 PM6/10/14
to s-space-re...@googlegroups.com
Hi David,

Thanks for the tip with "mvn package" workaround.
However, as currently some tests are failling in the current version from github, I cannot build jars with this command.
Are you aware of those problems with tests or is it something on my side?

Thanks,
Marcin


W dniu wtorek, 1 kwietnia 2014 18:50:33 UTC+2 użytkownik David Jurgens napisał:
Hi Jiang,

It seems that there is no gnu.trove in the package. I found no "lib" folder either.

I am wondering how could I solve it? Thank you very much!

The S-Space package uses Maven to handle all its dependencies, so the GNU Trove library isn't stored locally in a lib/ directory.  However, probably the easiest workaround is to do run "mvn package".  This will wrap all of the dependencies into a single jar file in target/sspace-2.0.4-jar-with-dependencies.jar .  You can then specify this jar as the classpath, so your new command would look like this:
 
java -cp target/sspace-2.0.4-jar-with-dependencies.jar edu.ucla.sspace.mains.VsmMain -d data/wiki.sample data/wiki_output/

If you decide to change any of the source code, you'll need to add the target/ folder into the classpath before, or just run mvn package again.

  Thanks,
  David

 
You received this message because you are subscribed to the Google Groups "Semantic Space Research - Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to s-space-research-dev+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages