Instead of solr.TestStemFilterFactory, put the fully qualified
classname for the TestStemFilterFactory, i.e.
com.my.great.stemmer.TestStemFilterFactory. The solr.FactoryName
notation is just shorthand for org.apache.solr.BlahBlahBlah
-Grant
On Aug 27, 2008, at 3:27 PM, Jaco wrote:
Hello,
I'm pretty new to Solr, and not a Java expert, and trying to create
my own
plug in according to the instructions given in
http://wiki.apache.org/solr/SolrPlugins. I want to integrate an
external
stemmer for the Dutch language by creating a new FilterFactory that
will
invoke the external stemmer for a TokenStream.
First thing I want to do is just make sure I can get the plug in
running.
Here's what I did:
- Take a copy of DutchStemFilterFactory.java, rename it to
TestStemFilterFactory, renamed the class to TestStemFilterFactory
- Successfully compiled the java using javac, and add the .class
file to a
jar file
- Put the jar file in SOLR_HOME/lib
- Put a line <filter class="solr.TestStemFilterFactory" /> in my
analyzer
definition in schema.xml
- Restart tomcat
In the Tomcat log, there is an indication that the file is found:
27-Aug-2008 20:58:25 org.apache.solr.core.SolrResourceLoader
createClassLoader
INFO: Adding 'file:/D:/Programs/Solr/lib/Test.jar' to Solr classloader
But then I get errors being reported by Tomcat further down the log
file:
SEVERE: org.apache.solr.common.SolrException: Error loading class
'solr.TestStemFilterFactory'
at
org
.apache
.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:256)
at
org
.apache
.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:261)
at
org
.apache
.solr
.util.plugin.AbstractPluginLoader.create(AbstractPluginLoader.java:83)
at
org
.apache
.solr
.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:140)
<....>
Caused by: java.lang.ClassNotFoundException:
solr.TestStemFilterFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
<.....>
Probably some configuration issue somewhere, but I am in the dark
here (as
said: not a Java expert...). I've tried to find information in
mailing list
archives on this, but no luck so far. I'm Running Solr nightly build
of
20.08.2008, tomcat 5.5.26 on Windows.
Any help would be much appreciated!
Cheers,
Jaco.
--------------------------
Grant Ingersoll
http://www.lucidimagination.com
Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ