https://issues.apache.org/jira/browse/SOLR-8970 https://issues.apache.org/jira/browse/SOLR-8971
: Date: Mon, 11 Apr 2016 20:35:22 -0400 : From: Joe Lawson <jlaw...@opensourceconnections.com> : Reply-To: solr-user@lucene.apache.org : To: solr-user@lucene.apache.org : Subject: Re: Solr 6 - AbstractSolrTestCase Error Unable to build KeyStore from : file: null : : Thanks for the insight. I figured that it was something like that and : perhaps I has thread contention on a resource that wasn't really thread : safe. : : I'll give your suggestions a shot tomorrow. : : Regards, : : Joe Lawson : On Apr 11, 2016 8:24 PM, "Chris Hostetter" <hossman_luc...@fucit.org> wrote: : : > : > : I'm upgrading a plugin and use the AbstractSolrTestCase for tests. My : > tests : > : work fine in 5.X but when I upgraded to 6.X the tests sometimes throw an : > : error during initialization. Basically it says, : > : "org.apache.solr.common.SolrException: Error instantiating : > : shardHandlerFactory class : > : [org.apache.solr.handler.component.HttpShardHandlerFactory]: Unable to : > : build KeyStore from file: null" : > : > Ugh. and of course there are no other details to troubleshoot that : > because the stupid error handling doesn't wrap the original exception -- : > it just throws it away. : > : > I'm pretty sure the problem you are seeing (unfortunately manifested in : > a really confusing way) is that SolrTestCaseJ4 (and AbstractSolrTestCase : > which subclasses it) has randomized the use of SSL for a while, but at : > some point it also started randomizing the use of client auth -- but this : > randomization happens very infrequently. : > : > (for details, check out the SSLTestConfig and it's usage in : > SolrTestCaseJ4) : > : > The bottom line is, in order for the (randomized) clientAuth stuff to : > work, SolrTestCaseJ4 assumes it can find an : > "../etc/test/solrtest.keystore" realtive to ExternalPaths.SERVER_HOME. : > : > If you don't have that in your test setup, bad things happen. : > : > I believe the quickest way for you to resolve this failure in your own : > usage of AbstractSolrTestCase is to just add the @SupressSSL annotation to : > your tests -- assuming you don't care about randomly testing your plugin : > with SSL authentication (for 99.999% of solr plugins, wether solr is being : > used over http or https shouldn't matter for test purposes) : > : > If you do want to include randomized SSL testing, then you need to make : > sure your that when/how you run your tests, ExternalPaths.SERVER_HOME : > resolves to the correct place, and "../etc/test/solrtest.keystore" : > resolves to a real file solr can use as the keystore. : > : > I'll file some Jiras to try and improve the error handline in these : > situations. : > : > : > : > -Hoss : > http://www.lucidworks.com/ : > : -Hoss http://www.lucidworks.com/