Are you compiling your custom request handler against the same version of Solr that you are deploying with? My hunch is that you're compiling against an older version.

        Erik


On Oct 9, 2007, at 9:04 AM, Britske wrote:


I'm trying to add a new requestHandler-plugin to Solr by extending
StandardRequestHandler.
However, when starting solr-server after configuration i get a
ClassCastException:

SEVERE: java.lang.ClassCastException:
wrappt.solr.requesthandler.TopListRequestHandler cannot be cast to
org.apache.solr.request.SolrRequestHandler  at
org.apache.solr.core.RequestHandlers$1.create(RequestHandlers.java: 149)

I can't get my head around what might be wrong, as I am extending
org.apache.solr.handler.StandardRequestHandler which already implements org.apache.solr.request.SolrRequestHandler so it must be able to cast i
figure.

Anyone any ideas? below is the code / setup I used.

My handler:
-------------------
package wrappt.solr.requesthandler;

import org.apache.solr.handler.StandardRequestHandler;
import org.apache.solr.request.SolrRequestHandler;

public class TopListRequestHandler extends StandardRequestHandler implements
SolrRequestHandler
{
        //no code here (so it mimicks StandardRequestHandler)
}
------------------

configured in solrconfig as:
<requestHandler name="toplist"
class="wrappt.solr.requesthandler.TopListRequestHandler"/>

added this handler to a jar called: solrRequestHandler1.jar and added this jar along with apache-solr-nightly.jar to the \lib directory of my server. (It needs the last jar for resolving the StandardRequestHandler. Isnt this
strange btw, because I thought that it would be resolved from solr.war
automatically. )

general solr-info of the server:
        Solr Specification Version: 1.2.2007.10.07.08.05.52
Solr Implementation Version: nightly ${svnversion} - yonik - 2007-10-07
08:05:52

I double-checked that the included apache-solr-nightly.jar are the same
version as the deployed server by getting the latest nightly build and
getting the .jars and .war from it.

Furthermore, I noticed that org.apache.solr.request.StandardRequestHandler
is deprecated. Note that I'm extending
org.apache.solr.handler.StandardRequestHandler. Is it possible that this has
anything to do with it?

with regards,
Geert-Jan


--
View this message in context: http://www.nabble.com/extending- StandardRequestHandler-gives-ClassCastException- tf4594102.html#a13115182
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to