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

Ryan Ernst commented on SOLR-4652:
----------------------------------

{quote}
Separately about the refactoring, i think Uwe mentioned (then deleted) a key 
step for a future issue: in order to be able to guarantee its correct in the 
future, a good rote refactoring step after this issue would be to remove the 
'treat null as context classloader' (instead throw exception if its null!) from 
SolrResourceLoader and remove the ctor that takes no parent classloader: this 
way its explicit what is happening everywhere and would reduce the confusion.
{quote}

Yeah, this is the route I had started going down when I realized it was a 
sizable undertaking.  I've created a separate issue:
https://issues.apache.org/jira/browse/SOLR-4659
                
> Resource loader has broken behavior for solr.xml plugins (basically 
> ShardHandlerFactory)
> ----------------------------------------------------------------------------------------
>
>                 Key: SOLR-4652
>                 URL: https://issues.apache.org/jira/browse/SOLR-4652
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Ryan Ernst
>         Attachments: SOLR-4652.patch
>
>
> I have the following scenario:
> MyShardHandlerFactory is plugged in via solr.xml.  The jar containing 
> MyShardHandlerFactory is in the shared lib dir.  There are a couple issues:
> 1. From within a per core handler (that is loaded within the core's lib dir), 
> you grab the ShardHandlerFactory from CoreContainer, casting to 
> MyShardHandlerFactory will results in a ClassCastException with a message 
> like "cannot cast instance of MyShardHandlerFactory to MyShardHandlerFactory".
> 2. Adding a custom dir for shared lib (for example "mylib") does not work.  
> The ShardHandlerFactory is initialized before sharedLib is loaded.
> I've been pouring through the code on this and I don't see an easy fix.  I'll 
> keep looking at it, but I wanted to get this up so hopefully others have some 
> thoughts on how best to fix.  IMO, it seems like there needs to be a clear 
> chain of resource loaders (one for loading solr.xml, a child for loading the 
> lib dir, used for solr.xml plugins, a grandchild for per core config, and a 
> great grandchild for per core lib dir based plugins).  Right now there are 
> some siblings, because any place a SolrResourceLoader is created with a null 
> parent classloader, it gets the jetty thread's classloader as the parent.

--
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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to