0
votes

I am new to Apache Nutch(2.3.1) and mongodb(3.4.7). After instalation steps I want to inject urls and crawl wikipedia website. when I run "./nutch inject urls" in terminal I faced to this error.

~/apache-nutch-2.3.1/runtime/local/bin$ ./nutch inject urls InjectorJob: starting at 2017-11-26 19:07:35 InjectorJob: Injecting urlDir: urls InjectorJob: org.apache.gora.util.GoraException: java.lang.NullPointerException at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:167) at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:135) at org.apache.nutch.storage.StorageUtils.createWebStore(StorageUtils.java:78) at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:218) at org.apache.nutch.crawl.InjectorJob.inject(InjectorJob.java:252) at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:275) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.apache.nutch.crawl.InjectorJob.main(InjectorJob.java:284) Caused by: java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:964) at org.apache.gora.mongodb.store.MongoStore.getDB(MongoStore.java:192) at org.apache.gora.mongodb.store.MongoStore.initialize(MongoStore.java:122) at org.apache.gora.store.DataStoreFactory.initializeDataStore(DataStoreFactory.java:102) at org.apache.gora.store.DataStoreFactory.createDataStore(DataStoreFactory.java:161) ... 7 more

1
Does the urls file exist? Does it contain any URLs?MatsLindh
thanks for your responce. I installed using this link:lobster1234.github.io/2017/08/14/search-with-nutch-mongodb-solr. Actually i create a .txt in urls directory and put this link"wikipedia.org." on to it . By the way "nutch" is a file but in this user guid the writer work with it as a directory(this part:$ runtime/local/bin/nutch inject urls/)Sajjad Rostami
Since it's barfing on createDataStore from MongoDB, my guess is that you're missing some configuration settings for Mongo?MatsLindh
I used this link to install mongoDB:digitalocean.com/community/tutorials/…Sajjad Rostami
I'm thinking about nutch settings for connecting to Mongo. You've got to try to debug it some way and not just reference what you've done.MatsLindh

1 Answers

0
votes

Actually I had set wrong Mongo database'name in $NUTCH_HOME/conf/gora.properties file. After fix it , Apache nutch work correctly.