Search code examples
solrlog4jdataimporthandler

Solr 4 Data Import Handler doesn't work


I am deploying Solr 4.3.0 in Tomcat 7. Everything works fine but DataImportHandler. I can go to the

http://localhost:8080/solr/#/collection1/dataimport//dataimport

screen and see the dataimport options load at the UI.

Still, I can see any of my entities load in the "entity" combo box. Inside the configuration box, at the right side I can see the error below.

Apache Tomcat/7.0.41 - Error report

525D76;}--> HTTP Status 500 - Filter execution threw an exception

noshade="noshade">

type Exception report

message Filter execution threw an exception

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Filter execution threw an
exception 

root cause

java.lang.NoClassDefFoundError: org/apache/log4j/spi/LoggingEvent
  org.apache.solr.logging.log4j.EventAppender.append(EventAppender.java:35)
  org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
  org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
  org.apache.log4j.Category.callAppenders(Category.java:206)
  org.apache.log4j.Category.forcedLog(Category.java:391)
  org.apache.log4j.Category.log(Category.java:856)
  org.slf4j.impl.Log4jLoggerAdapter.error(Log4jLoggerAdapter.java:498)
  org.apache.solr.common.SolrException.log(SolrException.java:119)
  org.apache.solr.servlet.ResponseUtils.getErrorInfo(ResponseUtils.java:58)
  org.apache.solr.servlet.SolrDispatchFilter.sendError(SolrDispatchFilter.java:691)
  org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:380)
  org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:155)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.41 logs.

Apache Tomcat/7.0.41

Problem is that I have the "log4j-1.2.16.jar" loaded in the classpath (it's on Tomcat lib dir).

Anyone have stepped in this problem?


Solution

  • Try following the steps outlined in Using the example logging setup in containers other than Jetty. I have encountered this same error when running Solr 4.3 until I followed these steps to configure logging.