Hi Zahra,
I think your guessing it's right: I see some mess in libraries versions.
If I got you
* the target platform is Solr 6.6.1
* the compile classpath includes solr-core-4.1.0, 1.4.0 (!) and lucene
7.4.0?
If that is correct, with a ClassCastException you're just scraping the
surface of all errors you can get :) As a rule of thumb you should
always work with the same version of the target Solr (because that
version will be the runtime container of your plugin).
I suggest you to avoid putting libraries manually in the classpath; you
should use a dependency management tool like Maven or Gradle, set the
target Solr version once and have the required dependencies
automatically set up.
Let me know if you need some help with the last point.
Best,
Andrea
On 24/06/18 14:07, Zahra Aminolroaya wrote:
I am using solr 6.6.1. I want to write my own analyzer for the field type
"text_general" in schema. the field type in schema is as follows:
<fieldType name="text_general" class="solr.TextField"
positionIncrementGap="100" multiValued="true">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" words="stopwords.txt"
ignoreCase="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="normalizing.myNormalizerFilterFactory" />
</analyzer>
When I test the filter in Java, everything is alright; However, when I start
my solr I get the following error:
Caused by: java.lang.ClassCastException: class
normalizing.myNormalizerFilterFactory
at java.lang.Class.asSubclass(Unknown Source)
at
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:539)
at
org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:624)
at
org.apache.solr.schema.FieldTypePluginLoader$3.create(FieldTypePluginLoader.java:397)
at
org.apache.solr.schema.FieldTypePluginLoader$3.create(FieldTypePluginLoader.java:390)
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:152)
... 20 more
I used the jar files in my lib as follows: solr-core-4.1.0,
slf4j-api-1.6.6, lucene-core-7.4.0, apache-solr-core-1.4.0, apache-lucene.
Why do I get this error? Is it becuase of the wrong jar file versions
especially the lucene-core-7.4.0 as my lucene version is 6.6.1?
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html