Hot questions for Using Ubuntu in solr

Question:

After running apt-get update && apt-get upgrade on an ubuntu 12.04 box and rebooting, the Solr service that had previously been running without issue under tomcat6 fails to start, with the following error:

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)

I tried switching to Tomcat7/OpenJDK7, but received exactly the same error. Tomcat itself runs fine, but solr doesn't start and returns a 503 when you try to access the /solr path.

So this was an instance of Solr that was working perfectly prior to the apt-get upgrade, and now isn't... I'm not sure what to do aside from trying the Oracle JDK instead, but I've never had to do that before on Ubuntu and I'm not sure why it should be necessary in this case.

java -version reports:

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)

Thanks for any thoughts you may have!


Answer:

Figured it out... Turned out that I just needed to totally remove and reinstall tomcat6, and all associated packages, via:

apt-get remove tomcat6
apt-get autoremove

I also had OpenJDK7 installed due to that attempt to fix the issue, so I also ran:

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

After that I just did:

apt-get install tomcat6

And it worked as expected. All of the prior solr setup was already present, so everything came back immediately, no indexing required. As Marvin said above, CryptoPrimitive should have only come with 1.7, so I have no idea why it had this issue after the upgrade, since we had been running 1.6 the whole time.

Anyway, hopefully this helps someone else in the future, thanks for the comments, all!

Question:

Was just restarted the machine due to instance password reset, the solr turn out to be unable to function properly. The server was created by previous developer and it was fine before restart. What's the possible issue?

org.apache.solr.common.SolrException: undefined field subtitle
	at org.apache.solr.schema.IndexSchema.getDynamicFieldType(IndexSchema.java:1292)
	at org.apache.solr.schema.IndexSchema.getFieldType(IndexSchema.java:1244)
	at org.apache.solr.parser.SolrQueryParserBase.getWildcardQuery(SolrQueryParserBase.java:1189)
	at org.apache.solr.parser.SolrQueryParserBase.handleBareTokenQuery(SolrQueryParserBase.java:779)
	at org.apache.solr.parser.QueryParser.Term(QueryParser.java:421)
	at org.apache.solr.parser.QueryParser.Clause(QueryParser.java:278)
	at org.apache.solr.parser.QueryParser.Query(QueryParser.java:222)
	at org.apache.solr.parser.QueryParser.Clause(QueryParser.java:282)
	at org.apache.solr.parser.QueryParser.Query(QueryParser.java:162)
	at org.apache.solr.parser.QueryParser.TopLevelQuery(QueryParser.java:131)
	at org.apache.solr.parser.SolrQueryParserBase.parse(SolrQueryParserBase.java:254)
	at org.apache.solr.search.LuceneQParser.parse(LuceneQParser.java:49)
	at org.apache.solr.search.QParser.getQuery(QParser.java:169)
	at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:160)
	at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:269)
	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:177)
	at org.apache.solr.core.SolrCore.execute(SolrCore.java:2503)
	at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:710)
	at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:516)
	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:382)
	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:326)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1751)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
	at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
	at org.eclipse.jetty.server.Server.handle(Server.java:534)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
	at java.lang.Thread.run(Thread.java:748)

Answer:

Solved by adding a field in the schema page of admin panel.