Menu

building new models

Help
Keir
2009-10-07
2013-04-16
  • Keir

    Keir - 2009-10-07

    I've come across an issue.  Upon trying to build a model (java -Xmx512m opennlp.tools.namefind.NameFinderME -encoding utf-8 muc1264_persons.txt muc1264_persons.bin.gz), I got the following error:

    Indexing events using cutoff of 5

    Computing event counts…  Exception in thread "main" java.lang.NoClassDefFoundError: gnu/trove/TLinkableAdaptor
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:703)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:244)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
    at opennlp.tools.namefind.NameFinderEventStream.createNewEvents(NameFinderEventStream.java:97)
    at opennlp.tools.namefind.NameFinderEventStream.hasNext(NameFinderEventStream.java:110)
    at opennlp.maxent.TwoPassDataIndexer.computeEventCounts(Unknown Source)
    at opennlp.maxent.TwoPassDataIndexer.<init>(Unknown Source)
    at opennlp.tools.namefind.NameFinderME.train(NameFinderME.java:234)
    at opennlp.tools.namefind.NameFinderME.main(NameFinderME.java:294)
    Caused by: java.lang.ClassNotFoundException: gnu.trove.TLinkableAdaptor
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:244)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
    … 18 more

    So I have a missing class, or so I thought.  I checked to make sure the trove-2.0.4.jar was in my Extensions folder (I'm using Snow Leopard).  This folder automatically adds jars to the classpath for every version off Java installed.  Kind of like a global ext folder for all the JDKs.  Case in point, the trove jar is accounted for with rest of the opennlp and maxent jars.  I looked more closely at the "class not found" and saw that the TLinkableAdaptor class can't be found.  I did a jar tf on the trove jar I have and it supposedly has it.  But it's named differently.  It's called TLinkableAdapter, not TLinkableAdaptor.

    Has this been brought up or seen?  I'm extremely new to OpenNLP and NLP in general.  My Java is so-so, but this issue is quite clear.  Will an older trove jar work (trying that right now)?

    Thanks
    Keir

     
  • Keir

    Keir - 2009-10-07

    I just tried a newer version of trove, trove-2.1.0.jar, and got the same exception thrown.

     
  • Thomas Morton

    Thomas Morton - 2009-10-07

    Hi,
       The trove jar to use is the one distributed with the code in the lib directory.  The LIBNOTES file there also specifies the version used which is 1.0.2.  Looks like you figured this out…Tom

     

Log in to post a comment.