On 1/15/2016 5:36 AM, Callum Lamb wrote: > Good to know Solr already loads them, that removed a bunch of lines from my > solrconfig.xml. > > Having to copy the required jars from dist/ to lib/ isn't ideal but if > that's the only solution then at least I can stop searching for a solution > and figure out how best to deal with this limitation. > > I assume the reason for this is that the libs in solr.home.home/lib are > loaded at runtime? I don't know much about how this works in Java but i'm > guessing Solr can access the classes in the Jars but not the other way > around?
Classloaders in Java are a complex topic that I do not fully understand. The contents of the $SOLR_HOME/lib directory are loaded by the main Solr classloader before any cores are started, and all of the cores that get started afterwards are able to use those classes. If the core-level classloader chooses to load one of the jars a second time, then there can be problems. Rather than try and understand all the complexities of class loading, I find it better to simply place all the jars in the one location that Solr loads automatically and take the decision away from the individual cores. It makes everything easier. Thanks, Shawn