lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Test Test <andymish...@yahoo.fr>
Subject Re: Custom TokenFilter
Date Thu, 26 Mar 2015 21:27:50 GMT
Hi Erick, 
For me, this classCastException is caused by the wrong use of TokenFilter.In fieldType declaration
(schema.xml), i've put :<tokenizer class="com.tamingtext.texttamer.solr.SentenceTokenizerFactory"/>And
instead using TokenizerFactory in my class, i utilize TokenFilterFactory like this :public
class SentenceTokenizerFactory  extends TokenFilterFactory 
So when solr try to load my class, it expects to load TokenizerFactory class but it has TokenFilterFactory
class. 
Regards,Andry


     Le Jeudi 26 mars 2015 4h13, Erick Erickson <erickerickson@gmail.com> a écrit :
   

 Thanks for letting us know the resolution, the problem was bugging me....

Erick

On Wed, Mar 25, 2015 at 4:21 PM, Test Test <andymishima@yahoo.fr> wrote:
> Re,
> Finally, i think i found where this problem comes.I didn't use the right class extender,
instead using Tokenizers, i'm using Token filter.
> Eric, thanks for your replies.Regards.
>
>
>      Le Mercredi 25 mars 2015 23h55, Test Test <andymishima@yahoo.fr> a écrit
:
>
>
>  Re,
> I have tried to remove all the redundant jar files.Then i've relaunched it but it's blocked
directly on the same issue.
> It's very strange.
> Regards,
>
>
>    Le Mercredi 25 mars 2015 23h31, Erick Erickson <erickerickson@gmail.com> a
écrit :
>
>
>  Wait, you didn't put, say, lucene-core-4.10.2.jar into your
> contrib/tamingtext/dependency directory did you? That means you have
> Lucene (and solr and solrj and ...) in your class path twice since
> they're _already_ in your classpath by default since you're running
> Solr.
>
> All your jars should be in your aggregate classpath exactly once.
> Having them in twice would explain the cast exception. not need these
> in the tamingtext/dependency subdirectory, just the things that are
> _not_ in Solr already..
>
> Best,
> Erick
>
> On Wed, Mar 25, 2015 at 12:21 PM, Test Test <andymishima@yahoo.fr> wrote:
>> Re,
>> Sorry about the image.So, there are all my dependencies jar in listing below :
>>    - commons-cli-2.0-mahout.jar
>>
>>    - commons-compress-1.9.jar
>>
>>    - commons-io-2.4.jar
>>
>>    - commons-logging-1.2.jar
>>
>>    - httpclient-4.4.jar
>>
>>    - httpcore-4.4.jar
>>
>>    - httpmime-4.4.jar
>>
>>    - junit-4.10.jar
>>
>>    - log4j-1.2.17.jar
>>
>>    - lucene-analyzers-common-4.10.2.jar
>>
>>    - lucene-benchmark-4.10.2.jar
>>
>>    - lucene-core-4.10.2.jar
>>
>>    - mahout-core-0.9.jar
>>
>>    - noggit-0.5.jar
>>
>>    - opennlp-maxent-3.0.3.jar
>>
>>    - opennlp-tools-1.5.3.jar
>>
>>    - slf4j-api-1.7.9.jar
>>
>>    - slf4j-simple-1.7.10.jar
>>
>>    - solr-solrj-4.10.2.jar
>>
>>
>> I have put them into a specific repository (contrib/tamingtext/dependency).And my
jar containing my class into another repository (contrib/tamingtext/lib).I added these paths
in solrconfig.xml
>>
>>    - <lib dir="../../../contrib/tamingtext/lib" regex=".*\.jar" />
>>
>>    - <lib dir="../../../contrib/tamingtext/dependency" regex=".*\.jar" />
>>
>>
>> Thanks for advance
>> Regards.
>>
>>
>>
>>      Le Mercredi 25 mars 2015 20h18, Test Test <andymishima@yahoo.fr> a
écrit :
>>
>>
>>  Re,
>> Sorry about the image.So, there are all my dependencies jar in listing below :- commons-cli-2.0-mahout.jar-
commons-compress-1.9.jar- commons-io-2.4.jar- commons-logging-1.2.jar- httpclient-4.4.jar-
httpcore-4.4.jar- httpmime-4.4.jar- junit-4.10.jar- log4j-1.2.17.jar- lucene-analyzers-common-4.10.2.jar-
lucene-benchmark-4.10.2.jar- lucene-core-4.10.2.jar- mahout-core-0.9.jar- noggit-0.5.jar-
opennlp-maxent-3.0.3.jar- opennlp-tools-1.5.3.jar- slf4j-api-1.7.9.jar- slf4j-simple-1.7.10.jar-
solr-solrj-4.10.2.jar
>> I have put them into a specific repository (contrib/tamingtext/dependency).And my
jar containing my class into another repository (contrib/tamingtext/lib).I added these paths
in solrconfig.xml
>> <lib dir="../../../contrib/tamingtext/lib" regex=".*\.jar" /><lib dir="../../../contrib/tamingtext/dependency"
regex=".*\.jar" />
>> Thanks for advance,Regards.
>>
>>
>>
>>    Le Mercredi 25 mars 2015 17h12, Erick Erickson <erickerickson@gmail.com>
a écrit :
>>
>>
>>  Images don't come through the mailing list, can't see your image.
>>
>> Whether or not all the jars in the directory you're working on are
>> consistent is the least of your problems. Are the libs to be found in any
>> _other_ place specified on your classpath?
>>
>> Best,
>> Erick
>>
>> On Wed, Mar 25, 2015 at 12:36 AM, Test Test <andymishima@yahoo.fr> wrote:
>>
>>> Thanks Eric,
>>>
>>> I'm working on Solr 4.10.2 and all my dependencies jar seems to be
>>> compatible with this version.
>>>
>>> [image: Image en ligne]
>>>
>>> I can't figure out which one make this issue.
>>>
>>> Thanks
>>> Regards,
>>>
>>>
>>>
>>>
>>>  Le Mardi 24 mars 2015 23h45, Erick Erickson <erickerickson@gmail.com>
a
>>> écrit :
>>>
>>>
>>> bq: 13 moreCaused by: java.lang.ClassCastException: class
>>> com.tamingtext.texttamer.solr.
>>>
>>> This usually means you have jar files from different versions of Solr
>>> in your classpath.
>>>
>>> Best,
>>> Erick
>>>
>>> On Tue, Mar 24, 2015 at 2:38 PM, Test Test <andymishima@yahoo.fr> wrote:
>>> > Hi there,
>>> > I'm trying to create my own TokenizerFactory (from tamingtext's
>>> book).After setting schema.xml and have adding path in solrconfig.xml, i
>>> start solr.I have this error message : Caused by:
>>> org.apache.solr.common.SolrException: Plugin init failure for [schema.xml]
>>> fieldType "text": Plugin init failure for [schema.xml] analyzer/tokenizer:
>>> class com.tamingtext.texttamer.solr.SentenceTokenizerFactory. Schema file
>>> is .../conf/schema.xmlat
>>> org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:595)at
>>> org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:166)at
>>> org.apache.solr.schema.IndexSchemaFactory.create(IndexSchemaFactory.java:55)at
>>> org.apache.solr.schema.IndexSchemaFactory.buildIndexSchema(IndexSchemaFactory.java:69)at
>>> org.apache.solr.core.ConfigSetService.createIndexSchema(ConfigSetService.java:90)at
>>> org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:62)...
>>> 7 moreCaused by: org.apache.solr.common.SolrException: Plugin init failure
>>> for [schema.xml] fieldType "text": Plugin init failure for [schema.xml]
>>> analyzer/tokenizer: class
>>> com.tamingtext.texttamer.solr.SentenceTokenizerFactoryat
>>> org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:177)at
>>> org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:486)... 12
>>> moreCaused by: org.apache.solr.common.SolrException: Plugin init failure
>>> for [schema.xml] analyzer/tokenizer: class
>>> com.tamingtext.texttamer.solr.SentenceTokenizerFactoryat
>>> org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:177)at
>>> org.apache.solr.schema.FieldTypePluginLoader.readAnalyzer(FieldTypePluginLoader.java:362)at
>>> org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:95)at
>>> org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:43)at
>>> org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)...
>>> 13 moreCaused by: java.lang.ClassCastException: class
>>> com.tamingtext.texttamer.solr.SentenceTokenizerFactoryat
>>> java.lang.Class.asSubclass(Class.java:3208)at
>>> org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:474)at
>>> org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:593)at
>>> org.apache.solr.schema.FieldTypePluginLoader$2.create(FieldTypePluginLoader.java:342)at
>>> org.apache.solr.schema.FieldTypePluginLoader$2.create(FieldTypePluginLoader.java:335)at
>>> org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)
>>> > Someone can help?
>>> > Thanks.Regards.
>>>
>>>
>>>
>>
>>
>>
>>
>
>
>
>

  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message