Uploaded image for project: 'Terrier Core'
  1. Terrier Core
  2. TR-283

trec_terrier.sh -i fails with java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.6
    • Fix Version/s: 3.6
    • Component/s: .indexing
    • Labels:
      None

      Description

      I'm walking through the quickstart tutorial, and indexing WT2G:

      $ ./bin/trec_terrier.sh -i
      Setting TERRIER_HOME to /Users/soboroff/terrier-3.6
      INFO - TRECCollection read collection specification (1081 files)
      INFO - Processing /home/collections/WT2G_1999//WT01/B01
      INFO - creating the data structures data_1
      Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
      at org.apache.hadoop.io.Text.<clinit>(Text.java:49)
      at org.terrier.structures.indexing.CompressingMetaIndexBuilder.writeDocumentEntry(CompressingMetaIndexBuilder.java:232)
      at org.terrier.structures.indexing.CompressingMetaIndexBuilder.writeDocumentEntry(CompressingMetaIndexBuilder.java:212)
      at org.terrier.indexing.BasicIndexer.indexDocument(BasicIndexer.java:386)
      at org.terrier.indexing.BasicIndexer.createDirectIndex(BasicIndexer.java:270)
      at org.terrier.indexing.Indexer.index(Indexer.java:346)
      at org.terrier.applications.TRECIndexing.index(TRECIndexing.java:122)
      at org.terrier.applications.TrecTerrier.run(TrecTerrier.java:408)
      at org.terrier.applications.TrecTerrier.applyOptions(TrecTerrier.java:589)
      at org.terrier.applications.TrecTerrier.main(TrecTerrier.java:246)
      Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      ... 10 more

      The lib/ directory is missing a commons-logging jar. I copied a random one from CDH4 I had lying around and it worked.

        Attachments

          Activity

          Hide
          isoboroff Ian Soboroff added a comment -

          Also, the commands in the quickstart say to use model PL2, but the output file indicated in the text uses InL2. The AP numbers I get from either model don't agree with the text, but I may have a corrupted corpus or qrels file... not enough info to debug that.

          Show
          isoboroff Ian Soboroff added a comment - Also, the commands in the quickstart say to use model PL2, but the output file indicated in the text uses InL2. The AP numbers I get from either model don't agree with the text, but I may have a corrupted corpus or qrels file... not enough info to debug that.
          Hide
          craigm Craig Macdonald added a comment - - edited

          For anyclass.sh, the patch is:

          Index: anyclass.sh
          ===================================================================
          --- anyclass.sh	(revision 3784)
          +++ anyclass.sh	(working copy)
          @@ -91,7 +91,7 @@
           	CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar
           fi
           
          -for jar in $TERRIER_LIB/*.jar; do
          +for jar in $TERRIER_LIB/*.jar $TERRIER_LIB/hadoop/*.jar  $TERRIER_LIB/poi/*.jar; do
           	if [ ! -n "$CLASSPATH" ]
           	then
           		CLASSPATH=$jar
          

          Craig

          Show
          craigm Craig Macdonald added a comment - - edited For anyclass.sh, the patch is: Index: anyclass.sh =================================================================== --- anyclass.sh (revision 3784) +++ anyclass.sh (working copy) @@ -91,7 +91,7 @@ CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar fi -for jar in $TERRIER_LIB/*.jar; do +for jar in $TERRIER_LIB/*.jar $TERRIER_LIB/hadoop/*.jar $TERRIER_LIB/poi/*.jar; do if [ ! -n "$CLASSPATH" ] then CLASSPATH=$jar Craig
          Hide
          isoboroff Ian Soboroff added a comment -

          The hadoop0.20 directory doesn't exist in the 3.6 tarball. ITYM 'hadoop'?

          Show
          isoboroff Ian Soboroff added a comment - The hadoop0.20 directory doesn't exist in the 3.6 tarball. ITYM 'hadoop'?
          Hide
          craigm Craig Macdonald added a comment -

          Yes, brain fart.

          Show
          craigm Craig Macdonald added a comment - Yes, brain fart.
          Hide
          richardm Richard McCreadie added a comment -

          Terrier 3.6 download has been patched to fix this issue for both unix and windows. Resolving issue.

          Show
          richardm Richard McCreadie added a comment - Terrier 3.6 download has been patched to fix this issue for both unix and windows. Resolving issue.

            People

            • Assignee:
              craigm Craig Macdonald
              Reporter:
              isoboroff Ian Soboroff
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: