在Ubuntu 12.04上进行Java更新后,Solr无法启动

时间:2016-02-11 22:51:13

标签: java tomcat ubuntu solr

运行apt-get update&&在ubuntu 12.04盒子上进行apt-get升级并重新启动,以前在tomcat6下运行时没有问题的Solr服务无法启动,出现以下错误:

530  [main] ERROR org.apache.solr.servlet.SolrDispatchFilter  – Could not start Solr. Check solr/home property and the logs
564  [main] ERROR org.apache.solr.core.SolrCore  – null:java.lang.NoClassDefFoundError: sun/security/util/CryptoPrimitive
    at sun.security.ssl.ProtocolVersion.<clinit>(ProtocolVersion.java:113)
    at sun.security.ssl.SSLContextImpl$ConservativeSSLContext.<clinit>(SSLContextImpl.java:464)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:190)
    at java.security.Provider$Service.getImplClass(Provider.java:1277)
    at java.security.Provider$Service.newInstance(Provider.java:1237)
    at sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
    at sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
    at javax.net.ssl.SSLContext.getInstance(SSLContext.java:142)
    at javax.net.ssl.SSLContext.getDefault(SSLContext.java:85)
    at javax.net.ssl.SSLSocketFactory.getDefault(SSLSocketFactory.java:119)
    at org.apache.http.conn.ssl.SSLSocketFactory.getSystemSocketFactory(SSLSocketFactory.java:193)
    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:197)
    at org.apache.solr.client.solrj.impl.HttpClientConfigurer.configure(HttpClientConfigurer.java:33)
    at org.apache.solr.client.solrj.impl.HttpClientUtil.configureClient(HttpClientUtil.java:133)
    at org.apache.solr.client.solrj.impl.HttpClientUtil.createClient(HttpClientUtil.java:109)
    at org.apache.solr.handler.component.HttpShardHandlerFactory.init(HttpShardHandlerFactory.java:152)
    at org.apache.solr.handler.component.ShardHandlerFactory.newInstance(ShardHandlerFactory.java:50)
    at org.apache.solr.core.CoreContainer.load(CoreContainer.java:194)
    at org.apache.solr.servlet.SolrDispatchFilter.createCoreContainer(SolrDispatchFilter.java:183)
    at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:133)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:622)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

我尝试切换到Tomcat7 / OpenJDK7,但收到完全相同的错误。 Tomcat本身运行正常,但是当您尝试访问/ solr路径时,solr无法启动并返回503。

所以这是Solr的一个实例,它在apt-get升级之前完美运行,现在不是......我不知道除了尝试Oracle JDK之外还要做什么,但我已经在Ubuntu之前从来没有这样做过,我不确定为什么在这种情况下它应该是必要的。

java -version报告:

java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.4)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

感谢您的任何想法!

1 个答案:

答案 0 :(得分:1)

想出来......原来我只需要通过以下方式完全删除并重新安装tomcat6和所有相关软件包:

apt-get remove tomcat6
apt-get autoremove

由于试图解决问题,我也安装了OpenJDK7,所以我也跑了:

apt-get remove openjdk-6-jre-headless openjdk-6-jre-lib openjdk-7-jre-headless

之后我就做了:

apt-get install tomcat6

它按预期工作。所有先前的solr设置已经存在,所以一切都立即回来,不需要索引。正如Marvin上面所说,CryptoPrimitive应该只有1.7,所以我不知道升级后为什么会出现这个问题,因为我们一直在运行1.6。

无论如何,希望这对未来的其他人有所帮助,感谢所有评论!