SOLR 5: Error loading class 'solr.XsltUpdateRequestHandler'

1.1k Views Asked by At

On Solr 4.2.1, I was able to use the solr post and now I have upgraded to 5.4 and when I used the post method. I am getting Error loading class 'solr.XsltUpdateRequestHandler' error.

Here is the complete error:

null:org.apache.solr.common.SolrException: Error loading class 'solr.XsltUpdateRequestHandler'
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:559)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:490)

Caused by: java.lang.ClassNotFoundException: solr.XsltUpdateRequestHandler
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

I have used the following on the solrconfig and no errors during the solr start.

<requestHandler name="/update/xslt" class="solr.XsltUpdateRequestHandler" startup="lazy" />

Any help is much appreciated.

Thank you

2

There are 2 best solutions below

0
On

Thanks @TMBT for your response. I was able to find the solution by using it UpdateRequestHandler as XsltUpdateRequestHandler is deprecated. After changing it to solr.UpdateRequestHandler, I was able to run the solr POST and it was successful.

<requestHandler name="/update/xslt" class="solr.UpdateRequestHandler" startup="lazy" />
0
On

Looks like that handler was deprecated back in 4.8 or possibly even sooner than that. I wouldn't be surprised if it was removed from Solr completely by 5.0, but I don't see anything in the docs about it. I pulled up the 4.2.1 docs and even those have the deprecated annotation.

You might want to try to downgrade all the way back to 4.10 at the latest to see if you can use that handler, then start upgrading versions one at a time until the error happens again. Jumping from 4.2.1 to 5.4.1 is huge. There have been quite a few changes between these versions.

If you don't want to bother, I did a quick search in my 5.4.1 solrconfig.xml and found the following:

<!-- XSLT response writer transforms the XML output by any xslt file found
       in Solr's conf/xslt directory.  Changes to xslt files are checked for
       every xsltCacheLifetimeSeconds.  
    -->
  <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
    <int name="xsltCacheLifetimeSeconds">5</int>
  </queryResponseWriter>

I don't know how to use this as I've never had a reason to bother with xslt, but it looks like a good place to start.