I am working on Solr in my application. I am using apache-solr-solrj-1.4.0.jar.
When I try to call add(SolrInputDocument doc)
from Common
SolrJ client does not give you the actual error. Try looking at the solr server logs which should be located under tomcat or jetty (or whatever runs solr).
Sounds like a corrupt index or busy lock file.. I had something similar and restarting worked, oddly enough.
I have set following in my solrconfig.xml and it works.
<lockType>simple</lockType>
<unlockOnStartup>true</unlockOnStartup>
Also, set following to avoid write lock exceptions on index directory:
<maxFieldLength>10000</maxFieldLength>
<writeLockTimeout>60000</writeLockTimeout>
<commitLockTimeout>60000</commitLockTimeout>
It comes from failing to remove write.lock file after some update actions. Removing the write.lock in the core's data/index folder will solve this problem temporarily and regain updating action. I know using post.jar to update has more bad luck to cause this problem, whereas url with stream.body rarely cause this problem. Karussel's answer did improves the situation but seems not solve it at all. I doubt it comes from some design issue of Solr. Hope Solr 4 has solved this problem. Also one can refer to the answer in this question: how-to-solve-the-lock-obtain-timed-out-when-using-solr-plainly
I am very unsure, but in this thread
http://www.mail-archive.com/solr-user@lucene.apache.org/msg08048.html
they recommend to use
<unlockOnStartup>true</unlockOnStartup>
and
<lockType>simple</lockType>
I think this should be safe as long as you access the index through solr or solrj (not though lucene!).
Any other ideas?