问题
I am getting following error even after starting forreman and starting sunspot:solr :
RSolr::Error::InvalidRubyResponse - 200 OK
Error: <result status="1">java.lang.NullPointerException
at org.apache.solr.handler.XmlUpdateRequestHandler.doLegacyUpdate(XmlUpdateRequestHandler.java:129)
at org.apache.solr.servlet.SolrUpdateServlet.doPost(SolrUpdateServlet.java:87)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1221)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:297)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><add><doc><field name=\"id\">User 1</field><field name=\"type\">User</field><field name=\"type\">ActiveRecord::Base</field><field name=\"class_name\">User</field><field name=\"name_s\">K12 Administrator</field><field name=\"username_s\">admin</field><field name=\"id_i\">1</field><field name=\"role_s\">admin</field><field boost=\"1.5\" name=\"name_text\">K12 Administrator</field><field name=\"username_text_text\">admin</field></doc></add>"
Does anyone know why am I getting this this error? Please help me.
Thank you
回答1:
I was getting this as well. My background was that I installed Solr locally and ignored everything in the solr subdirectories. So the contents of solr/pids where ignored but the file structure of solr/pids remained.
I deployed this to our dev server and encountered the above errors.
The solution turned out to be simple. The solr directory needs to be created fresh in a new environment.
- rake sunspot:solr:stop
- Delete your /solr directory.
- rake sunspot:solr:start
- rake sunspot:solr:reindex
courtesy of Can't reindex Sunspot SOLR - Error - RSolr::Error::Http - 500 Internal Server Error
来源:https://stackoverflow.com/questions/16651829/rsolrerrorinvalidrubyresponse-200-ok