Question

I'm trying to use mongo as a data source for solr so I followed James for his DIH to use it in my solr application, I've added the following in my lib Folder

  1. solr-dataimporthandler-1.4.1
  2. solr-mongo-importer-1.0.0
  3. nlog4j-1.2.17 // because it asked for LoggerFactory class
  4. mongo-2.10.1

and in my data-config file simply the following :

<?xml version="1.0"?>
<dataConfig>
    <dataSource name="MyMongo" type="MongoDataSource" database="tracker" />
    <document name="hits">
         <entity processor="MongoEntityProcessor"
                 query="{}"
                 collection="hits"
                 datasource="MyMongo"
                 transformer="MongoMapperTransformer" >
             <field column="_id"           name="_id"       mongoField="_id"/>
         </entity>
     </document>
</dataConfig>

and when ever I try to make full import, Exception is thrown like the following :

SEVERE: Full Import failed:java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to load EntityProcessor implementation for entity:19099085523711 Processing Document # 1
at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:264)
at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:375)
at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:445)
at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:426)
Caused by: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to load EntityProcessor implementation for entity:19099085523711 Processing Document # 1
    at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:621)
    at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:327)
    at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:225)
    ... 3 more

Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to load EntityProcessor implementation for entity:19099085523711 Processing Document # 1
    at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:72)
    at org.apache.solr.handler.dataimport.DocBuilder.getEntityProcessor(DocBuilder.java:915)
    at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:635)
    at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:619)
    ... 5 more
Caused by: java.lang.ClassCastException: org.apache.solr.handler.dataimport.MongoEntityProcessor cannot be cast to org.apache.solr.handler.dataimport.EntityProcessor
    at org.apache.solr.handler.dataimport.DocBuilder.getEntityProcessor(DocBuilder.java:912)
    ... 7 more

can anyone tell me what i'm messing and how to solve this issue?

Was it helpful?

Solution

The core of the issue is:

Caused by: java.lang.ClassCastException: org.apache.solr.handler.dataimport.MongoEntityProcessor cannot be cast to org.apache.solr.handler.dataimport.EntityProcessor

I suspect you are not using the same version of Solr as he does. Based on the jars, you seem to be using Solr 1.4.1. Based on timestamps at GitHub, the integration project is 6 months old and might be using more recent Solr (3.6 or - less likely - 4+).

Unless your Solr is well-established system, I would download Solr 4 and try again, using the DIH jars that come with the installation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top