tjake / Solandra

Solandra = Solr + Cassandra
Apache License 2.0
882 stars 150 forks source link

Add Document NPE #93

Closed jschappet closed 13 years ago

jschappet commented 13 years ago

Jake,

When trying to use addDoc via the JDBC DataImporter I get the following Exception:

WARN [Thread-11] 2011-05-31 15:36:04,849 SolrWriter.java (line 75) Error creating document : SolrInputDocument[{combo=combo(1.0)={kharmat b? haf?fah b??in?yah,b? gh?r,costa rica|Kharmat B? Haf?fah B??in?yah,B? Gh?r,Costa Rica}}] java.lang.NullPointerException at solandra.SolandraIndexWriter.addDoc(SolandraIndexWriter.java:217) at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61) at org.apache.solr.handler.dataimport.SolrWriter.upload(SolrWriter.java:73) at org.apache.solr.handler.dataimport.DataImportHandler$1.upload(DataImportHandler.java:294) at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:631) at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:267) at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:186) at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:353) at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:411) at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:392)

After looking at the code, it looks like I am missing a "batch" setting.

Any ideas?

tjake commented 13 years ago

what URL are you pointing the DIH at?

jschappet commented 13 years ago

http://localhost:8983/solandra/geonames/dataimport?command=full-import&clean=false

jschappet commented 13 years ago

Added to the solrconfig.xml

<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="config">data-config.xml</str> </lst> </requestHandler>

Dropped apache-solr-dataimporthandler-3.1.0.jar into Lib.

tjake commented 13 years ago

try that, the offending code isn't in use anymore anyway :)

jschappet commented 13 years ago

Looks like I had the wrong code:

SolandraCoreInfo coreInfo = SolandraCoreContainer.coreInfo.get(); if (coreInfo == null) logger.error("CoreInfo Is Null");

ERROR [Thread-11] 2011-06-01 07:29:15,587 SolandraIndexWriter.java (line 212) CoreInfo Is Null WARN [Thread-11] 2011-06-01 07:29:15,587 SolrWriter.java (line 75) Error creating document : SolrInputDocument[{combo=combo(1.0)={kharmat b? haf?fah b??in?yah,sabkhat b? haf?fah,kazakhstan|Kharmat B? Haf?fah B??in?yah,Sabkhat B? Haf?fah,Kazakhstan}}] java.lang.NullPointerException at solandra.SolandraIndexWriter.addDoc(SolandraIndexWriter.java:220)

tjake commented 13 years ago

That may be the fix. DIH spawns threads to import

jschappet commented 13 years ago

Worked. Thanks