Java Mailing List Archive

http://www.java2.5341.com/

Home » nutch-user.lucene »

Nutch Exception

Vineet Garg

2008-05-07

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,

I have crawled and indexed the local filesystem by using nutch 0.9. Then
i tried to run the following code just to test the nutch search:

    import org.apache.nutch.searcher.*;
    import org.apache.nutch.util.*;
   import org.apache.hadoop.conf.Configuration;
   import org.apache.hadoop.fs.Path;
    import java.io.*;
class Test{
    public static void main(String arg[])throws IOException{
   IndexSearcher IS;
   Configuration conf;
     Path oPath = new Path("/hm/vineetg/nutch-0.9/crawl_test");
    conf = NutchConfiguration.create();
    IS = new IndexSearcher(oPath, conf);
        //Construct query
    Query newQuery = Query.parse("search_query", conf);
        Hits hits = IS.search(newQuery, 300, null, null, false);
        int TotalResults = (int)hits.getTotal();
    for (int iCounter = 0; iCounter < TotalResults; iCounter++)
    {
      Hit hit = hits.getHit(iCounter);
      HitDetails details = IS.getDetails(hit);
             String sTitle = details.getValue("title");
      String sURL = details.getValue("url");
    }
    }
}

But it is throwing following exception:

Exception in thread "main" java.lang.InternalError: unexpected exception
during linking: java.lang.ClassNotFoundException: java.net.URI
 at 0x005d5ca3: java.lang.Throwable.Throwable(java.lang.String)
(/usr/lib/./libgcj.so.3)
 at 0x005c8b1e: java.lang.Error.Error(java.lang.String)
(/usr/lib/./libgcj.so.3)
 at 0x005d6086:
java.lang.VirtualMachineError.VirtualMachineError(java.lang.String)
(/usr/lib/./libgcj.so.3)
 at 0x005ca4be:
java.lang.InternalError.InternalError(java.lang.String)
(/usr/lib/./libgcj.so.3)
 at 0x005c7c12: java.lang.ClassLoader.resolveClass0(java.lang.Class)
(/usr/lib/./libgcj.so.3)
 at 0x005b33fc: java.lang.Class.initializeClass() (/usr/lib/./libgcj.so.3)
 at 0x0059d882: _Jv_InterpMethod.continue1(_Jv_InterpMethodInvocation)
(/usr/lib/./libgcj.so.3)
 at 0x0059df64: _Jv_InterpMethod.run(ffi_cif, void, ffi_raw,
_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
 at 0x0059b474: _Jv_InterpMethod.run_normal(ffi_cif, void, ffi_raw,
void) (/usr/lib/./libgcj.so.3)
 at 0x006efe6c: ?? (??:0)
 at 0x005afd68: gnu.gcj.runtime.FirstThread.call_main()
(/usr/lib/./libgcj.so.3)
 at 0x00619e91: gnu.gcj.runtime.FirstThread.run() (/usr/lib/./libgcj.so.3)
 at 0x005bcaec: _Jv_ThreadRun(java.lang.Thread) (/usr/lib/./libgcj.so.3)
 at 0x0058982c: _Jv_RunMain(java.lang.Class, byte const, int, byte
const, boolean) (/usr/lib/./libgcj.so.3)
 at 0x08048930: ?? (??:0)
 at 0x0012979d: __libc_start_main (/lib/tls/libc.so.6)
 at 0x080486e1: ?? (??:0)

Files are indexed at /hm/vineetg/nutch-0.9/crawl_test.

Does anybody have any idea why it is throwing this exception??

Regards,
Vineet Garg
©2008 java2.5341.com - Jax Systems, LLC, U.S.A.