【发布时间】:2012-05-01 16:50:29
【问题描述】:
在索引到 solr 时,我收到这样的错误。
HTTP Status 500 - lazy loading error
org.apache.solr.common.SolrException: lazy loading error at
org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.getWrappedHandler(RequestHandlers.java:260)
at org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:242)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1376) at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:365)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:260)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
形成的网址是:http://localhost:8080/solr/update/extract?Latitude=51.9125&Longitude=179.5&commit=true&waitFlush=true&waitSearcher=true&wt=javabin&version=2
(我已经在 Windows 机器上使用 Xampp 配置了 tomcat)
我一直在关注 SOF 和其他各种博客/论坛并尝试调试它,但几个小时我都找不到任何东西。
我在 solr.xml 中添加了以下内容
<maxFieldLength>10000</maxFieldLength>
<writeLockTimeout>60000</writeLockTimeout>
<commitLockTimeout>60000</commitLockTimeout>
<lockType>simple</lockType>
<unlockOnStartup>true</unlockOnStartup>
<reopenReaders>true</reopenReaders>
<requestParsers enableRemoteStreaming="true"
multipartUploadLimitInKB="2048000" />
<lst name="defaults">
<!--str name="echoParams">explicit</str-->
<!--int name="rows">10</int-->
<!--str name="df">text</str-->
<str name="Latitude">Latitude</str>
<str name="Longitude">Longitude</str>
</lst>
甚至尝试将以下内容添加到 solconfig.xml 并重新启动 tomcat 我明白了
<requestHandler name="/update/extract" class="org.apache.solr.handler.extraction.ExtractingRequestHandler">
<lst name="defaults">
<str name="ext.map.Last-Modified">last_modified</str>
<bool name="ext.ignore.und.fl">true</bool>
</lst>
</requestHandler>
在 Java 控制台上显示错误: org.apache.solr.common.SolrException:内部服务器错误
我意识到问题可能是因为我的 solr 主路径。我创建了一个新目录并在那里复制了所有配置文件并提到它作为我的 solr 路径。但是,我后来更新了 solrconfig.xml,更正了所有 jar 的路径。
还尝试将“pdfbox 和 fontbox”jar 添加到 solr lib 文件夹并重新启动 Tomcat
我的 Java 代码是:
String urlString = "http://localhost:8080/solr";
SolrServer server = new CommonsHttpSolrServer(urlString);
ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update/extract");
String fileName=f.toString();
up.addFile(new File(fileName));
up.setParam("Latitude", Latitude);
up.setParam("Longitude", Longitude);
up.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
server.request(up);
(8080端口是我配置的)
solr 索引仍然无法在我的最后工作.. 我已经尝试了几个小时调试这个并弄清楚了。如果您能给我一些提示或建议我做错了什么,那就太好了。
至于您的参考我已经尝试过: http://wiki.apache.org/solr/FrontPage http://wiki.apache.org/solr/ContentStreamUpdateRequestExample http://wiki.apache.org/solr/UpdateRichDocuments http://wiki.apache.org/solr/ExtractingRequestHandler#Configuration http://lucene.472066.n3.nabble.com/Problem-using-ExtractingRequestHandler-with-tomcat-td494930.html http://lucene.472066.n3.nabble.com/Internal-Server-Error-td715713.html How to index pdf's content with SolrJ?
【问题讨论】: