what is the package of LiveCoresHandler ? I guess the requestHandler name should be name="/livecores"
On Tue, Aug 4, 2009 at 5:04 PM, James Brady<james.colin.br...@gmail.com> wrote: > Solr version: 1.3.0 694707 > > solrconfig.xml: > <requestHandler name="livecores" class="LiveCoresHandler" /> > > public class LiveCoresHandler extends RequestHandlerBase { > public void init(NamedList args) { } > public String getDescription() { return ""; } > public String getSource() { return ""; } > public String getSourceId() { return ""; } > public NamedList getStatistics() { return new NamedList(); } > public String getVersion() { return ""; } > > public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse > rsp) { > Collection<String> names = > req.getCore().getCoreDescriptor().getCoreContainer().getCoreNames(); > rsp.add("cores", names); > // if the cores are dynamic, you prob don't want to cache > rsp.setHttpCaching(false); > } > } > > 2009/8/4 Avlesh Singh <avl...@gmail.com> > >> > >> > I'm sure I have the class name right - changing it to something patently >> > incorrect results in the expected "org.apache.solr.common.SolrException: >> > Error loading class ...", rather thanthe ClassCastException. >> > >> You are right about that, James. >> >> Which Solr version are you using? >> Can you please paste the relevant pieces in your solrconfig.xml and the >> request handler class you have created? >> >> Cheers >> Avlesh >> >> On Mon, Aug 3, 2009 at 10:51 PM, James Brady <james.colin.br...@gmail.com >> >wrote: >> >> > Hi, >> > Thanks for your suggestions! >> > >> > I'm sure I have the class name right - changing it to something patently >> > incorrect results in the expected >> > "org.apache.solr.common.SolrException: Error loading class ...", rather >> > than >> > the ClassCastException. >> > >> > I did have some problems getting my class on the app server's classpath. >> > I'm >> > running with solr.home set to "multicore", but creating a multicore/lib >> > directory and putting my request handler class in there resulted in >> "Error >> > loading class" errors. >> > >> > I found that setting jetty.class.path to include multicore/lib (and also >> > explicitly point at Solr's core and common JARs) fixed the "Error loading >> > class" errors, leaving these ClassCastExceptions... >> > >> > 2009/8/3 Avlesh Singh <avl...@gmail.com> >> > >> > > Can you cross check the class attribute for your handler in >> > solrconfig.xml? >> > > My guess is that it is specified as "solr.LiveCoresHandler". It should >> be >> > > fully qualified class name - com.foo.path.to.LiveCoresHandler instead. >> > > >> > > Moreover, I am damn sure that you did not forget to drop your jar into >> > > solr.home/lib. Checking once again might not be a bad idea :) >> > > >> > > Cheers >> > > Avlesh >> > > >> > > On Mon, Aug 3, 2009 at 9:11 PM, James Brady < >> james.colin.br...@gmail.com >> > > >wrote: >> > > >> > > > Hi, >> > > > I'm creating a custom request handler to return a list of live cores >> in >> > > > Solr. >> > > > >> > > > On startup, I get this exception for each core: >> > > > >> > > > Jul 31, 2009 5:20:39 PM org.apache.solr.common. SolrException log >> > > > SEVERE: java.lang.ClassCastException: LiveCoresHandler >> > > > at >> > > > >> org.apache.solr.core.RequestHandlers$1.create(RequestHandlers.java:152) >> > > > at >> > > > >> org.apache.solr.core.RequestHandlers$1.create(RequestHandlers.java:161) >> > > > at >> > > > >> > > > >> > > >> > >> org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:140) >> > > > at >> > > > >> > > > >> > > >> > >> org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:169) >> > > > at org.apache.solr.core.SolrCore.<init>(SolrCore.java:444) >> > > > >> > > > I've tried a few variations on the class definition, including >> > extending >> > > > RequestHandlerBase (as suggested here: >> > > > >> > > > >> > > >> > >> http://wiki.apache.org/solr/SolrRequestHandler#head-1de7365d7ecf2eac079c5f8b92ee9af712ed75c2 >> > > > ) >> > > > and implementing SolrRequestHandler directly. >> > > > >> > > > I'm sure that the Solr libraries I built against and those I'm >> running >> > on >> > > > are the same version too, as I unzipped the Solr war file and copies >> > the >> > > > relevant jars out of there to build against. >> > > > >> > > > Any ideas on what could be causing the ClassCastException? I've >> > attached >> > > a >> > > > debugger to the running Solr process but it didn't shed any light on >> > the >> > > > issue... >> > > > >> > > > Thanks! >> > > > James >> > > > >> > > >> > >> > >> > >> > -- >> > http://twitter.com/goodgravy >> > 512 300 4210 >> > http://webmynd.com/ >> > Sent from Bury, United Kingdom >> > >> > > > > -- > http://twitter.com/goodgravy > 512 300 4210 > http://webmynd.com/ > Sent from Bury, United Kingdom > -- ----------------------------------------------------- Noble Paul | Principal Engineer| AOL | http://aol.com