我正在努力将大约3 TB的数据索引到apache solr中。当数据大小达到14 GB时,我在tomcat日志中遇到错误。有可能对其进行故障排除吗?我打算稍后将我的索引移到solr cloud。
> SEVERE: Servlet.service() for servlet [default] in context with path
> [/solr] threw exception java.lang.IllegalStateException: Cannot call
> sendError() after the response has been committed
> at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:451)
> at org.apache.solr.servlet.SolrDispatchFilter.sendError(SolrDispatchFilter.java:757)
> at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:438)
> at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:201)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
> at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
> at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
> at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
答案 0 :(得分:2)
当Solr开始编写响应然后抛出异常时会发生这种情况。然后在尝试处理该异常时,它会抛出另一个异常。 Solr在这种情况下的后退是基本上抛出手并调用HttpServletResponse#sendError()
,因为Solr已经写了部分响应,因此抛出IllegalStateException
。作为副作用,原始异常将丢失。万岁!
如果你很幸运,其他一些组件会在将异常扔到堆栈之前记录异常。在这种情况下,此错误的实际原因将出现在IllegalStateException
之前的日志中。否则,是时候在SolrDispatchFilter#sendError()
内设置断点并在Solr吞下它之前查看异常。