Announcement Announcement Module

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions ( project, this forum has been decommissioned in favour of Spring Extensions one at:

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Costin Leau
SpringSource - Spring Training, Consulting, and Support - "From the Source"
See more
See less
Lucene problem: No document handler defined for the name "test" Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lucene problem: No document handler defined for the name "test"

    Hi, I have downloaded the springmodule for lucene, version 0.9 and tried to test the sample

    I have used the lucene core library 2.4.1

    The first problem I found is that with the initial configuration

    <bean id="searcherFactory" class=" pleSearcherFactory">
    <property name="directory" ref="fsDirectory"/>
    <bean id="searcherFactory" class=" gleSearcherFactory">
    <property name="directory" ref="fsDirectory"/>

    With SingleSearcherFactory, in the startup I have an error because there is no segment* file created and the context inizialization fails. I tried with SimpleSearcherFactory and the server starts up

    I then tried to add a document

    FileDocumentHolder holder = new FileDocumentHolder();
    holder.setCategory("Categoria nueva");


    and have the following exception

    > indexFactory = org.springmodules.lucene.index.factory.concurrent. [email protected]
    > reader = org.springmodules.lucene.index.factory.SimpleLucen [email protected]
    Indice purgado
    org.springmodules.lucene.index.DocumentHandlerExce ption: No document handler defined for the name test
    at org.springmodules.lucene.index.document.handler.De faultDocumentHandlerManager.getDocumentHandler(Def
    at org.springmodules.lucene.index.core.InputStreamDoc umentCreatorWithManager.createDocumentFromInputStr eam( )
    at org.springmodules.lucene.index.core.DefaultLuceneI ndexTemplate.addDocument(DefaultLuceneIndexTemplat
    at org.springmodules.lucene.index.core.DefaultLuceneI ndexTemplate.addDocument(DefaultLuceneIndexTemplat
    at es.xunta.cptopt.framework.lucene.dao.impl.IndexAcc essorDaoImpl.addDocument( :72)
    at es.xunta.cptopt.framework.lucene.service.impl.Inde xAccessorServiceImpl.addDocument(IndexAccessorServ
    at es.xunta.cptopt.framework.webadmin.view.impl.modul es.BBModule.executeSearch(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)

    I have defined my context as

    <bean id="documentHandlerManager" class="org.springmodules.lucene.index.document.han dler.DocumentHandlerManagerFactoryBean">
    <property name="documentHandlerManagerClass" value="org.springmodules.lucene.index.document.han dler.file.ExtensionDocumentHandlerManager"/>
    <property name="documentMatchingClass" value="org.springmodules.lucene.index.document.han dler.file.ExtensionDocumentMatching"/>

    <bean id="indexAccessorDao" class="es.xunta.cptopt.framework.lucene.dao.impl.I ndexAccessorDaoImpl">
    <property name="indexFactory" ref="indexFactory"/>
    <property name="documentHandlerManager" ref="documentHandlerManager"/>

    <bean id="documentIdDao" class="es.xunta.cptopt.framework.lucene.dao.impl.D ocumentIdDaoImpl">
    <property name="dataSource" ref="dataSource"/>

    <bean id="indexAccessorService" class=" pl.IndexAccessorServiceImpl">
    <property name="documentIdDao" ref="documentIdDao"/>
    <property name="indexAccessorDao" ref="indexAccessorDao"/>

    Could anyone help me?


  • #2
    Just a noob issue. I have tried to put "pdf" for the fieldname field and it works