title: SolrException: Internal Server Error
body: <p>I am working on Solr in my application. I am using <em>apache-solr-solrj-1.4.0.jar</em>.</p>
  
  <p>When I try to call <code>add(SolrInputDocument doc)</code> from <code>CommonsHttpSolrServer</code>, I am getting the following exception:</p>
  
  <blockquote>
    <p>org.apache.solr.common.SolrException: Internal Server Error
    Internal Server Error
    at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:424)
            at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:243)
            at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
            at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:64)</p>
  </blockquote>
  
  <p>Can anyone please help me to resolve this problem?  </p>
  
  <p>The following are the attributes in <em>solrconfig.xml</em>:</p>
  
  <pre><code>&lt;lockType&gt;native&lt;/lockType&gt;
  &lt;unlockOnStartup&gt;false&lt;/unlockOnStartup&gt;
  &lt;reopenReaders&gt;true&lt;/reopenReaders&gt;
  </code></pre>
  
  <hr>
  
  <p>I am getting the following exception in the solr server logs:</p>
  
  <blockquote>
    <p>24 May, 2010 2:51:22 AM org.apache.solr.common.SolrException log
    SEVERE: java.lang.NullPointerException
            at org.apache.solr.handler.ReplicationHandler$4.postCommit(ReplicationHandler.java:922)
            at org.apache.solr.update.UpdateHandler.callPostCommitCallbacks(UpdateHandler.java:78)
            at org.apache.solr.update.DirectUpdateHandler2.commit(DirectUpdateHandler2.java:411)
            at org.apache.solr.update.processor.RunUpdateProcessor.processCommit(RunUpdateProcessorFactory.java:85)
            at org.apache.solr.handler.RequestHandlerUtils.handleCommit(RequestHandlerUtils.java:107)
            at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:48)
            at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
            at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)
            at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
            at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:210)
            at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
            at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
            at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
            at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
            at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
            at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
            at java.lang.Thread.run(Thread.java:619)</p>
  </blockquote>
  
  <hr>
  
  <blockquote>
    <p>INFO: {} 0 1039
    24 May, 2010 2:52:29 AM org.apache.solr.common.SolrException log
    SEVERE: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@./solr/data/index/lucene-be18de26b941317e71dc59f9e5ba63c4-write.lock
            at org.apache.lucene.store.Lock.obtain(Lock.java:85)
            at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:1545)
            at org.apache.lucene.index.IndexWriter.(IndexWriter.java:1402)
            at org.apache.solr.update.SolrIndexWriter.(SolrIndexWriter.java:190)
            at org.apache.solr.update.UpdateHandler.createMainIndexWriter(UpdateHandler.java:98)
            at org.apache.solr.update.DirectUpdateHandler2.openWriter(DirectUpdateHandler2.java:173)
            at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:220)
            at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
            at org.apache.solr.handler.XMLLoader.processUpdate(XMLLoader.java:139)
            at org.apache.solr.handler.XMLLoader.load(XMLLoader.java:69)
            at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:54)
            at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
            at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)
            at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
            at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:210)
            at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
            at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
            at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
            at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
            at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
            at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
            at java.lang.Thread.run(Thread.java:619)</p>
  </blockquote>