You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Pablo Mosquera Saenz <pa...@gmail.com> on 2009/07/16 12:20:21 UTC
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="org.springmodules.lucene.search.factory.SimpleSearcherFactory">
<property name="directory" ref="fsDirectory"/>
</bean>
<!--
<bean id="searcherFactory"
class="org.springmodules.lucene.search.factory.SingleSearcherFactory">
<property name="directory" ref="fsDirectory"/>
</bean>
-->
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");
holder.setFilename("test");
holder.setId("555");
holder.setFile(bs);
getIndexAccessorService().addDocument(holder);
and have the following exception
> indexFactory =
org.springmodules.lucene.index.factory.concurrent.LockIndexFactory@40979b
> reader =
org.springmodules.lucene.index.factory.SimpleLuceneIndexReader@184de18
Indice purgado
org.springmodules.lucene.index.DocumentHandlerException: No document handler
defined for the name test
at
org.springmodules.lucene.index.document.handler.DefaultDocumentHandlerManager.getDocumentHandler(DefaultDocumentHandlerManager.java:75)
at
org.springmodules.lucene.index.core.InputStreamDocumentCreatorWithManager.createDocumentFromInputStream(InputStreamDocumentCreatorWithManager.java:109)
at
org.springmodules.lucene.index.core.DefaultLuceneIndexTemplate.addDocument(DefaultLuceneIndexTemplate.java:273)
at
org.springmodules.lucene.index.core.DefaultLuceneIndexTemplate.addDocument(DefaultLuceneIndexTemplate.java:265)
at
es.xunta.cptopt.framework.lucene.dao.impl.IndexAccessorDaoImpl.addDocument(IndexAccessorDaoImpl.java:72)
at
es.xunta.cptopt.framework.lucene.service.impl.IndexAccessorServiceImpl.addDocument(IndexAccessorServiceImpl.java:77)
at
es.xunta.cptopt.framework.webadmin.view.impl.modules.BBModule.executeSearch(BBModule.java:184)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
I have defined my context as
<bean id="documentHandlerManager"
class="org.springmodules.lucene.index.document.handler.DocumentHandlerManagerFactoryBean">
<property name="documentHandlerManagerClass"
value="org.springmodules.lucene.index.document.handler.file.ExtensionDocumentHandlerManager"/>
<property name="documentMatchingClass"
value="org.springmodules.lucene.index.document.handler.file.ExtensionDocumentMatching"/>
</bean>
<bean id="indexAccessorDao"
class="es.xunta.cptopt.framework.lucene.dao.impl.IndexAccessorDaoImpl">
<property name="indexFactory" ref="indexFactory"/>
<property name="documentHandlerManager"
ref="documentHandlerManager"/>
</bean>
<bean id="documentIdDao"
class="es.xunta.cptopt.framework.lucene.dao.impl.DocumentIdDaoImpl">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="indexAccessorService"
class="es.xunta.cptopt.framework.lucene.service.impl.IndexAccessorServiceImpl">
<property name="documentIdDao" ref="documentIdDao"/>
<property name="indexAccessorDao" ref="indexAccessorDao"/>
</bean>
Could anyone help me?
Thanks
Re: Lucene problem:No document handler defined for the name "test"
Posted by Pablo Mosquera Saenz <pa...@gmail.com>.
Ok, thanks, I will try in the spring users mailing list
2009/7/16 Simon Willnauer <si...@googlemail.com>
> I guess you will get much more help on the spring mailinglist than you
> will get from java-users.
> you problem is related to your configuration and not to lucene as far
> as I can tell.
>
> simon
>
> On Thu, Jul 16, 2009 at 12:20 PM, Pablo Mosquera
> Saenz<pa...@gmail.com> wrote:
> > 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="org.springmodules.lucene.search.factory.SimpleSearcherFactory">
> > <property name="directory" ref="fsDirectory"/>
> > </bean>
> > <!--
> > <bean id="searcherFactory"
> > class="org.springmodules.lucene.search.factory.SingleSearcherFactory">
> > <property name="directory" ref="fsDirectory"/>
> > </bean>
> > -->
> >
> > 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");
> > holder.setFilename("test");
> > holder.setId("555");
> > holder.setFile(bs);
> >
> >
> > getIndexAccessorService().addDocument(holder);
> >
> > and have the following exception
> >
> >> indexFactory =
> > org.springmodules.lucene.index.factory.concurrent.LockIndexFactory@40979b
> >> reader =
> > org.springmodules.lucene.index.factory.SimpleLuceneIndexReader@184de18
> > Indice purgado
> > org.springmodules.lucene.index.DocumentHandlerException: No document
> handler
> > defined for the name test
> > at
> >
> org.springmodules.lucene.index.document.handler.DefaultDocumentHandlerManager.getDocumentHandler(DefaultDocumentHandlerManager.java:75)
> > at
> >
> org.springmodules.lucene.index.core.InputStreamDocumentCreatorWithManager.createDocumentFromInputStream(InputStreamDocumentCreatorWithManager.java:109)
> > at
> >
> org.springmodules.lucene.index.core.DefaultLuceneIndexTemplate.addDocument(DefaultLuceneIndexTemplate.java:273)
> > at
> >
> org.springmodules.lucene.index.core.DefaultLuceneIndexTemplate.addDocument(DefaultLuceneIndexTemplate.java:265)
> > at
> >
> es.xunta.cptopt.framework.lucene.dao.impl.IndexAccessorDaoImpl.addDocument(IndexAccessorDaoImpl.java:72)
> > at
> >
> es.xunta.cptopt.framework.lucene.service.impl.IndexAccessorServiceImpl.addDocument(IndexAccessorServiceImpl.java:77)
> > at
> >
> es.xunta.cptopt.framework.webadmin.view.impl.modules.BBModule.executeSearch(BBModule.java:184)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > at java.lang.reflect.Method.invoke(Unknown Source)
> >
> >
> > I have defined my context as
> >
> > <bean id="documentHandlerManager"
> >
> class="org.springmodules.lucene.index.document.handler.DocumentHandlerManagerFactoryBean">
> > <property name="documentHandlerManagerClass"
> >
> value="org.springmodules.lucene.index.document.handler.file.ExtensionDocumentHandlerManager"/>
> > <property name="documentMatchingClass"
> >
> value="org.springmodules.lucene.index.document.handler.file.ExtensionDocumentMatching"/>
> > </bean>
> >
> > <bean id="indexAccessorDao"
> > class="es.xunta.cptopt.framework.lucene.dao.impl.IndexAccessorDaoImpl">
> > <property name="indexFactory" ref="indexFactory"/>
> > <property name="documentHandlerManager"
> > ref="documentHandlerManager"/>
> > </bean>
> >
> > <bean id="documentIdDao"
> > class="es.xunta.cptopt.framework.lucene.dao.impl.DocumentIdDaoImpl">
> > <property name="dataSource" ref="dataSource"/>
> > </bean>
> >
> > <bean id="indexAccessorService"
> >
> class="es.xunta.cptopt.framework.lucene.service.impl.IndexAccessorServiceImpl">
> > <property name="documentIdDao" ref="documentIdDao"/>
> > <property name="indexAccessorDao" ref="indexAccessorDao"/>
> > </bean>
> >
> >
> > Could anyone help me?
> >
> >
> > Thanks
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
Re: Lucene problem:No document handler defined for the name "test"
Posted by Simon Willnauer <si...@googlemail.com>.
I guess you will get much more help on the spring mailinglist than you
will get from java-users.
you problem is related to your configuration and not to lucene as far
as I can tell.
simon
On Thu, Jul 16, 2009 at 12:20 PM, Pablo Mosquera
Saenz<pa...@gmail.com> wrote:
> 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="org.springmodules.lucene.search.factory.SimpleSearcherFactory">
> <property name="directory" ref="fsDirectory"/>
> </bean>
> <!--
> <bean id="searcherFactory"
> class="org.springmodules.lucene.search.factory.SingleSearcherFactory">
> <property name="directory" ref="fsDirectory"/>
> </bean>
> -->
>
> 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");
> holder.setFilename("test");
> holder.setId("555");
> holder.setFile(bs);
>
>
> getIndexAccessorService().addDocument(holder);
>
> and have the following exception
>
>> indexFactory =
> org.springmodules.lucene.index.factory.concurrent.LockIndexFactory@40979b
>> reader =
> org.springmodules.lucene.index.factory.SimpleLuceneIndexReader@184de18
> Indice purgado
> org.springmodules.lucene.index.DocumentHandlerException: No document handler
> defined for the name test
> at
> org.springmodules.lucene.index.document.handler.DefaultDocumentHandlerManager.getDocumentHandler(DefaultDocumentHandlerManager.java:75)
> at
> org.springmodules.lucene.index.core.InputStreamDocumentCreatorWithManager.createDocumentFromInputStream(InputStreamDocumentCreatorWithManager.java:109)
> at
> org.springmodules.lucene.index.core.DefaultLuceneIndexTemplate.addDocument(DefaultLuceneIndexTemplate.java:273)
> at
> org.springmodules.lucene.index.core.DefaultLuceneIndexTemplate.addDocument(DefaultLuceneIndexTemplate.java:265)
> at
> es.xunta.cptopt.framework.lucene.dao.impl.IndexAccessorDaoImpl.addDocument(IndexAccessorDaoImpl.java:72)
> at
> es.xunta.cptopt.framework.lucene.service.impl.IndexAccessorServiceImpl.addDocument(IndexAccessorServiceImpl.java:77)
> at
> es.xunta.cptopt.framework.webadmin.view.impl.modules.BBModule.executeSearch(BBModule.java:184)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
>
>
> I have defined my context as
>
> <bean id="documentHandlerManager"
> class="org.springmodules.lucene.index.document.handler.DocumentHandlerManagerFactoryBean">
> <property name="documentHandlerManagerClass"
> value="org.springmodules.lucene.index.document.handler.file.ExtensionDocumentHandlerManager"/>
> <property name="documentMatchingClass"
> value="org.springmodules.lucene.index.document.handler.file.ExtensionDocumentMatching"/>
> </bean>
>
> <bean id="indexAccessorDao"
> class="es.xunta.cptopt.framework.lucene.dao.impl.IndexAccessorDaoImpl">
> <property name="indexFactory" ref="indexFactory"/>
> <property name="documentHandlerManager"
> ref="documentHandlerManager"/>
> </bean>
>
> <bean id="documentIdDao"
> class="es.xunta.cptopt.framework.lucene.dao.impl.DocumentIdDaoImpl">
> <property name="dataSource" ref="dataSource"/>
> </bean>
>
> <bean id="indexAccessorService"
> class="es.xunta.cptopt.framework.lucene.service.impl.IndexAccessorServiceImpl">
> <property name="documentIdDao" ref="documentIdDao"/>
> <property name="indexAccessorDao" ref="indexAccessorDao"/>
> </bean>
>
>
> Could anyone help me?
>
>
> Thanks
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org