Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr 4.2.1 SSLinitializationException

Tags:

solr

After upgrading to Solr 4.2.1, deploying the Solr war file to GlassFish version 3.1.1 results in the following error:

    2013-04-09 10:45:06,144 [main] ERROR org.apache.solr.servlet.SolrDispatchFilter - Could not start Solr. Check solr/home property and the logs
    2013-04-09 10:45:06,224 [main] ERROR org.apache.solr.core.SolrCore - null:org.apache.http.conn.ssl.SSLInitializationException: Failure initializing default system SSL context
    at org.apache.http.conn.ssl.SSLSocketFactory.createSystemSSLContext(SSLSocketFactory.java:368)
    at org.apache.http.conn.ssl.SSLSocketFactory.getSystemSocketFactory(SSLSocketFactory.java:204)
    at org.apache.http.impl.conn.SchemeRegistryFactory.createSystemDefault(SchemeRegistryFactory.java:82)
    at org.apache.http.impl.client.SystemDefaultHttpClient.createClientConnectionManager(SystemDefaultHttpClient.java:118)
    at org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(AbstractHttpClient.java:466)
    at org.apache.solr.client.solrj.impl.HttpClientUtil.setMaxConnections(HttpClientUtil.java:179)
Caused by: java.io.IOException: Keystore was tampered with, or password was incorrect
  at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:772)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:55)
    at java.security.KeyStore.load(KeyStore.java:1214)
    at org.apache.http.conn.ssl.SSLSocketFactory.createSystemSSLContext(SSLSocketFactory.java:281)
    at org.apache.http.conn.ssl.SSLSocketFactory.createSystemSSLContext(SSLSocketFactory.java:366)     
    ... 50 more
Caused by: java.security.UnrecoverableKeyException: Password verification failed
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:770)
    ... 54 more

It seems like people have had this problem when using Solr version 4.2 and the bug fix release 4.2.1 was supposed to fix it (?). Any pointers will be greatly appreciated.

like image 243
cer_albastru Avatar asked Apr 09 '13 15:04

cer_albastru


1 Answers

Had the same problems a few days ago. Solved it by downgrading to solr 4.1.0. But there is a solution (found it by googling my personally well known search terms once again ;) Just add two JVM options. Start glassfish with:

asadmin start-domain

and enter:

asadmin create-jvm-options -- -Djavax.net.ssl.keyStorePassword=changeit
asadmin create-jvm-options -- -Djavax.net.ssl.trustStorePassword=changeit

Don't forget to restart glassfish:

asadmin restart-domain

Tried it for myself and works like a charm. Obviously this is working only if you never changed those passwords before.

like image 151
Campfire Avatar answered Oct 15 '22 03:10

Campfire