You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Ahmed El-dawy <as...@gmail.com> on 2009/12/16 22:54:39 UTC

Re: Using solr with the new TokenStream API

I think the problem is that my jar file is added to the class path at run
time. This causes Class.forName to be not working correctly. Is there a way
to add this jar file to classpath during tomcat startup?

On Tue, Dec 15, 2009 at 8:42 PM, Ahmed El-dawy <as...@gmail.com> wrote:

> Hi,
>  I'm using the new API provided with Lucene 2.9.1 for TokenStream. I mean
> the one that is using the decorator pattern. I made a new attribute called
> GlossAttribute with its implementation called GlossAttributeImpl. When I run
> it in a desktop application of mine it works correctly in both indexing and
> searching. However, when I used the same jar file with solr it throws an
> exception when trying to instantiate the attribute.
> I'm sure that the implementing class is there in the jar file but it seems
> to be looking in somewhere else. Do you have any solution?
>
>
> Here's the exception stack trace
>
> HTTP Status 500 - Could not find implementing class for
> gpl.pierrick.brihaye.aramorph.lucene.GlossAttribute java.lang.IllegalArgumentException:
> Could not find implementing class for
> gpl.pierrick.brihaye.aramorph.lucene.GlossAttribute at org.apache.lucene.util.AttributeSource$AttributeFactory$DefaultAttributeFactory.getClassForInterface(AttributeSource.java:79)
> at
> org.apache.lucene.util.AttributeSource$AttributeFactory$DefaultAttributeFactory.createAttributeInstance(AttributeSource.java:64)
> at
> org.apache.lucene.analysis.TokenStream$TokenWrapperAttributeFactory.createAttributeInstance(TokenStream.java:149)
> at
> org.apache.lucene.util.AttributeSource.addAttribute(AttributeSource.java:224)
> at
> gpl.pierrick.brihaye.aramorph.lucene.ArabicStemmerReplicator.<init>(ArabicStemmerReplicator.java:69)
> at
> gpl.pierrick.brihaye.aramorph.solr.ArabicStemmerReplicatorFactory.create(ArabicStemmerReplicatorFactory.java:18)
> at org.apache.solr.analysis.TokenizerChain.getStream(TokenizerChain.java:72)
> at
> org.apache.solr.analysis.SolrAnalyzer.reusableTokenStream(SolrAnalyzer.java:74)
> at
> org.apache.solr.schema.IndexSchema$SolrIndexAnalyzer.reusableTokenStream(IndexSchema.java:364)
> at
> org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:567)
> at
> org.apache.solr.search.SolrQueryParser.getFieldQuery(SolrQueryParser.java:153)
> at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1449) at
> org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1337) at
> org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1265) at
> org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1254)
> at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:200) at
> org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:78) at
> org.apache.solr.search.QParser.getQuery(QParser.java:131) at
> org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:89)
> at
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:174)
> at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
> at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316) at
> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
> 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:191)
> 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:845)
> 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:636)
>
> --
> regards,
> Ahmed Saad
>



-- 
regards,
Ahmed Saad

Re: Using solr with the new TokenStream API

Posted by AHMET ARSLAN <io...@yahoo.com>.
> Is there a way
> to add this jar file to classpath during tomcat startup?

You can put your jar file into $CATALINA_HOME/lib directory.