[ 
https://issues.apache.org/jira/browse/SOLR-5088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13723521#comment-13723521
 ] 

Pavel Yaskevich commented on SOLR-5088:
---------------------------------------

It's Solr+Jetty, also tried using EmbeddedSolrServer with the same result. I 
thought about classloader not picking up the class myself, but if I tell it the 
wrong class it throws expected ClassNotFoundException in Class.forName, where 
with existing class it actually fails in "asSubclass" method with 
ClassCastException, which means that the custom class was found. 

Looking at the code of SolrResourceLoader.java:443 it has trace in place, I 
will try to run with log level set to trace tomorrow and post results here, 
maybe that will give more clarity...
                
> ClassCastException is thrown when trying to use custom SearchHandler.
> ---------------------------------------------------------------------
>
>                 Key: SOLR-5088
>                 URL: https://issues.apache.org/jira/browse/SOLR-5088
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.4
>            Reporter: Pavel Yaskevich
>
> Hi guys,
>   I'm trying to replace solr.SearchHandler to custom one in solrconfig.xml 
> for one of the stores, and it's throwing following exception: 
> {noformat}
> Caused by: org.apache.solr.common.SolrException: RequestHandler init failure
>       at 
> org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:167)
>       at org.apache.solr.core.SolrCore.<init>(SolrCore.java:772)
>       ... 13 more
> Caused by: org.apache.solr.common.SolrException: Error Instantiating Request 
> Handler, org.my.solr.index.CustomSearchHandler failed to instantiate 
> org.apache.solr.request.SolrRequestHandler
>       at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:551)
>       at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:603)
>       at 
> org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:153)
>       ... 14 more
> Caused by: java.lang.ClassCastException: class 
> org.my.solr.index.CustomSearchHandler
>       at java.lang.Class.asSubclass(Class.java:3116)
>       at 
> org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:433)
>       at 
> org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:381)
>       at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:530)
>       ... 16 more
> {noformat}
> I actually tried extending SearchHandler, and implementing SolrRequestHandler 
> as well as extending RequestHandlerBase and it's all the same 
> ClassCastException result...
> org.my.solr.index.CustomSearchHandler is definitely in class path and 
> recompiled every retry. 
> Maybe I'm doing something terribly wrong?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to