On 3/6/2018 6:31 AM, sol...@seznam.cz wrote:
> A would like to use Analytisc component.  I configured it by https://lucene.
> apache.org/solr/guide/7_2/analytics.html.
> When I try to send query to solr, exception is thrown.
>
> Reason: <pre> Server Error</pre></p><h3>Caused by:</h3><pre>java.lang.
> IllegalAccessError: tried to access field org.apache.solr.handler.component.
> ResponseBuilder._isOlapAnalytics from class org.apache.solr.handler.
> component.AnalyticsComponent at org.apache.solr.handler.component.
> AnalyticsComponent.prepare(AnalyticsComponent.java:46) at org.apache.solr.
> handler.component.SearchHandler.handleRequestBody(SearchHandler.java:269) at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.
> java:177) at org.apache.solr.core.SolrCore.execute(SolrCore.java:2503) at 
> org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:710) at org.
> apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:516)

Old thread!  Brought to my attention through other means.

I think you've encountered a subtle classloader problem.

The "_isOlapAnalytics" field in the ResponseBuilder class is at default
visibility -- package protected.  The AnalyticsComponent class is in the
same package as ResponseBuilder, so on the surface, this doesn't seem
like it should be a problem, and the compiler doesn't complain about it,
because everything matches up from its perspective.

AnalyticsComponent is in a contrib jar, loaded by a different
classloader than the rest of Solr.  When this happens, Java's
inheritance model can get broken.

A workaround that should work in the field is to remove the <lib> config
line from solrconfig.xml that loads the analaytics jar and copy that jar
to server/solr-webapp/webapp/WEB-INF/lib so that it is loaded by the
same classloader as the rest of Solr.  I have a report that this
actually does work.

There is an issue to move the analytics component into solr-core, which
would also solve the problem.

https://issues.apache.org/jira/browse/SOLR-12045

Thanks,
Shawn

Reply via email to