2008-11-11 16:47:36 org.apache.solr.handler.dataimport.SolrWriter upload : Error creating document : SolrInputDocumnt[{}] org.apache.solr.common.SolrException: Document [null] missing required field: id at org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:289) at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:58) at org.apache.solr.handler.dataimport.SolrWriter.upload(SolrWriter.java:69) at org.apache.solr.handler.dataimport.DataImportHandler$1.upload(DataImportHandler.java:288) at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:319) at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:178) at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:136) at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:334) at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:386) at org.apache.solr.handler.dataimport.DataImportHandler.handleRequestBody(DataImportHandler.java:190) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1204) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:303) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:232) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619)
org.apache.solr.common.SolrException: Document [null] missing required field: id <db-data-config.xml> <document name="search_product"> <entity name="search_product" pk="id" query="select id,pid,pname from search_product"> <field column="id" name="id" /> <field column="pid" name="pid" /> <field column="pname" name="pname" /> </entity> </document> <schema.xml> <fields> <!-- general --> <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/> <field name="pid" type="string" indexed="true" stored="true" multiValued="false" /> <field name="pname" type="text_mm" indexed="true" stored="true" multiValued="false" /> </fields> 2008/11/11 Marc Sturlese <[EMAIL PROTECTED]> > > Hey there, > I am trying to use the DataImportHandler to index data from a mysql > database. I am having the same error all the time just when I start tomcat: > > Nov 10, 2008 7:39:49 PM org.apache.solr.handler.dataimport.DataImporter > loadDataConfig > INFO: Data Configuration loaded successfully > Nov 10, 2008 7:39:49 PM > org.apache.solr.handler.dataimport.DataImportHandler > inform > SEVERE: Exception while loading DataImporter > java.lang.NullPointerException > at > > org.apache.solr.handler.dataimport.DataImporter.<init>(DataImporter.java:95) > at > > org.apache.solr.handler.dataimport.DataImportHandler.inform(DataImportHandler.java:106) > ... > > I am using the oficial release of solar 1.3. First I tried to add the > compiled DataImportHandler jar. As it didn't work what I did was: > I downloaded the package org/apache/solr/handler/dataimport from a nightly > build and have added it and compiled to my solr 1.3 oficial source release. > This way I have my solr1.3 release with the DataImporthandler > > In solrconfig.xml I have created a request handler to make the import: > > <requestHandler name="/dataimport" > class="org.apache.solr.handler.dataimport.DataImportHandler"> > <lst name="defaults"> > > <str name="config">/path_to_/data-config.xml</str> > </lst> > </requestHandler> > > To connect to the database , in data-config.xml I am doing: > <dataConfig> > <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" > url="jdbc:mysql://localhost/db_name" user="root" password=""/> ...and here > I > do the select and the mapping db_field - index_field > > *The mysql connector is correctly added in the classpath > > I think I must be missing something in my configuration but can't find > what... > Anyone can give me a hand? I am a bit lost with this problem... > Thanks in advanced > > Marc Sturlese > > > > -- > View this message in context: > http://www.nabble.com/Using-DataImportHandler-with-mysql-database-tp20425791p20425791.html > Sent from the Solr - User mailing list archive at Nabble.com. > >