我正在尝试将其mongo
用作数据源,solr
因此我跟随James的 DIH 在我的 solr 应用程序中使用它,我在我的lib
文件夹中添加了以下内容
- solr-dataimporthandler-1.4.1
- solr-mongo-importer-1.0.0
- nlog4j-1.2.17 // 因为它要求 LoggerFactory 类
- mongo-2.10.1
在我的数据配置文件中,只需以下内容:
<?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>
每当我尝试进行完全导入时,都会抛出如下异常:
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
谁能告诉我我在搞砸什么以及如何解决这个问题?