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 Andrew Ingram <an...@andrewingram.net> on 2009/07/01 15:33:31 UTC

Compiling TermsComponent for use with Solr 1.3

Hi all,

I'm interested in exploring the use of TermsComponent, but I don't want to
upgrade Solr to 1.4 until it's been officially released. I've tried
extracting the component and building it as an external lib but I'm having
problems getting it working.

I've copied TermsComponent and TermsParams from trunk into my own package
and Eclipse isn't reporting any build errors

The libs I'm using are:

apache-solr-common-1.3.0.jar
apache-solr-core-1.3.0.jar
lucene-core-2.4-dev.jar


I'm building the jar by exporting it from Eclipse.

But when I try and use it, solr gives an error at startup when it tries to
access the plugin.

Relevant solr conf;

<searchComponent name="termsComponent" class="my.package.TermsComponent" />


The error is:

SEVERE: java.lang.ClassCastException:
com.titanpublishing.solr.TermsComponent cannot be cast to
org.apache.solr.util.plugin.NamedListInitializedPlugin


Any help would be much appreciated.

Regards,
Andrew Ingram

Re: Compiling TermsComponent for use with Solr 1.3

Posted by Chris Hostetter <ho...@fucit.org>.
: I've copied TermsComponent and TermsParams from trunk into my own package
: and Eclipse isn't reporting any build errors
	...
: SEVERE: java.lang.ClassCastException:
: com.titanpublishing.solr.TermsComponent cannot be cast to
: org.apache.solr.util.plugin.NamedListInitializedPlugin

TermsComponent extends SearchComponent which implements 
NamedListInitializedPlugin ... so if you are getting that error t run 
time, but you aren't getting any errors at compile time, that typically 
suggests that the classpath you compiled against isn't the same as your 
run time classpath -- there are probably differences in the 
NamedListInitializedPlugin between the version you are compiling against, 
and the version you are using at run time.


-Hoss