最近、ローカル プロジェクトの Rails を 3.2.8 にアップグレードしましたが、検索を行うと次のエラーが表示されます。
RSolr::Error::Http - 500 Internal Server Error
Error: java.lang.NullPointerException
at org.apache.solr.servlet.SolrServlet.doGet(SolrServlet.java:91)
at org.apache.solr.servlet.SolrServlet.doPost(SolrServlet.java:76)
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: "fq=type%3ALocation&fq=%7B%21geofilt+sfield%3Dcoordinates_ll+pt%3D29.813142%2C-95.309789+d%3D60%7D&q=gem&fl=%2A+score&qf=name_text%5E3.0+alternate_name_text%5E2.0+business_name_text%5E1.7+category_ids_text%5E1.2+reviews_text%5E0.8+questions_answers_text%5E0.6+simple_name_basic_text+name_without_articles_text+description_text+keywords_text&defType=dismax&pf=name_text%5E5.0+category_ids_text%5E2+reviews_text%5E2.5+questions_answers_text%5E2&mm=2%3C66%25&ps=1&qs=1&tie=0.1&start=0&rows=10&facet=true&f.category_ids_sm.facet.sort=false&f.category_ids_sm.facet.mincount=1&facet.field=category_ids_sm"
Backtrace: /Users/a_user/.rvm/gems/ruby-1.9.2-p320/gems/rsolr-1.0.8/lib/rsolr/client.rb:230:in `adapt_response'
/Users/a_user/.rvm/gems/ruby-1.9.2-p320/gems/rsolr-1.0.8/lib/rsolr/client.rb:167:in `execute'
/Users/a_user/.rvm/gems/ruby-1.9.2-p320/gems/rsolr-1.0.8/lib/rsolr/client.rb:161:in `send_and_receive'
(eval):2:in `post'
/Users/a_user/.rvm/gems/ruby-1.9.2-p320/bundler/gems/sunspot-8f330615edb1/sunspot/lib/sunspot/search/abstract_search.rb:45:in `execute'
/Users/a_user/rails_projects/project_a/lib/location_searchable.rb:132:in `search'
/Users/a_user/rails_projects/project_a/app/controllers/locations_controller.rb:34:in `index'
/Users/a_user/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/Users/a_user/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
/Users/a_user/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
/Users/a_user/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
solr schema.xml を以前のバージョンに変更しましたが、それでも同じエラーが発生します。
私がインストールした宝石:
sunspot (2.0.0.pre.120720)
sunspot_rails (2.0.0.pre.120720)
sunspot_solr (2.0.0.pre.120720)
さらに、solr エラー ログには次のように表示されます。
Sep 5, 2012 9:24:50 PM org.apache.solr.core.SolrResourceLoader locateSolrHome
INFO: JNDI not configured for solr (NoInitialContextEx)
ありがとう!