Yeah, I'm compiling with a reference to apache-solr-nightly.jar wich is from the same nightly builld (7 october 2007) as the apache.solr-nightly.war I'm deploying against. I include this same apache-solr-nightly.jar in the lib folder of my deployed server.
It still seems odd that I have to include the jar, since the StandardRequestHandler should be picked up in the war right? Is this also a sign that there must be something wrong with the deployment? btw: I deployed by copying a directory which contains the example deployment, and swapped in the apache.solr-nightly.war in the 'webapps'-dir after renaming it to solr.war. This enables me to start the new server using: java -jar start.jar. I don't know if this is common practice or considered 'exotic', but it might just be causing the problem.. Anyway, after deploying the server picks up the correct war, as solr/admin shows the correct Solr Specification Version: 1.2.2007.10.07.08.05.52. other options? Geert-Jan Erik Hatcher wrote: > > 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. > > > -- View this message in context: http://www.nabble.com/extending-StandardRequestHandler-gives-ClassCastException-tf4594102.html#a13118296 Sent from the Solr - User mailing list archive at Nabble.com.