PDF 提取中的 NoClassDefFoundError MimeTypeException
我在尝试对 PDF 文件使用更新/提取时遇到异常
我的设置是:- Ubuntu服务器11.10 雄猫6 Solr 3.5.0.2011.11.22.15.54.38
我可以浏览到 solr/admin 好的
我已将所有 contrib/extract 和 apache-solr-cell3.5.0.jar 库放入 tomcat 文件夹 webapps/solr/WEB-INF/lib
我正在调用 extract 使用:-
curl "http://localhost:8080/solr/update/extract?uprefix=attr_&fmap.content=attr_content&commit=true" -F "file=/path/to/my.pdf"
错误是
java.lang.NoClassDefFoundError: org/apache/tika/mime/MimeTypeException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:383)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:425)
at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:461)
at org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.getWrappedHandler(RequestHandlers.java:248)
at org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:239)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1372)
希望任何指针 - 此错误似乎在其他地方出现的唯一一次是使用 Nutch 和缓存结果。
我尝试在查询字符串中发送 mimetype 以及 *.doc 文件,但遇到了相同的错误。
I am getting an exception trying to use update/extract with PDF files
My Set up is:-
Ubuntu Server 11.10
Tomcat 6
Solr 3.5.0.2011.11.22.15.54.38
I can browse to solr/admin OK
I have put all the contrib/extract and apache-solr-cell3.5.0.jar libraries into the tomcat folder webapps/solr/WEB-INF/lib
I am calling extract using:-
curl "http://localhost:8080/solr/update/extract?uprefix=attr_&fmap.content=attr_content&commit=true" -F "file=/path/to/my.pdf"
error is
java.lang.NoClassDefFoundError: org/apache/tika/mime/MimeTypeException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:383)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:425)
at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:461)
at org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.getWrappedHandler(RequestHandlers.java:248)
at org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:239)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1372)
Would appreciate any pointers - the only time this error seems to come up elsewhere is with Nutch and cached results.
I have tried sending the mimetype in the querystring and also a *.doc file but got the same error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据错误消息,您得到的不是
MimeTypeException
异常:问题是NoClassDefFoundError
,因为 Solr 无法加载类MimeTypeException
。通常这个类存在于
tika-core.jar
中。确保您确实拥有该文件,并检查
solrconfig.xml
中是否有指向正确目录的lib
语句。According to the error message it is not a
MimeTypeException
exception you get: The problem is aNoClassDefFoundError
, because Solr cannot load the classMimeTypeException
.Normally this class is present in
tika-core.jar
.Make sure you actually have that file and also check if you have a
lib
statement in yoursolrconfig.xml
pointing to the right directory.这是由于复制必要的 tika 库(到 tomcat6/webapps/solr/WEB-INF/lib)但将 jar 文件的所有权保留为 ROOT 而不是将它们 chown 到 TOMCAT6 时出现的基本错误。设置正确的权限并重新启动 Tomcat 后,它开始正常工作
This was due to the basic error of copying the necessary tika libraries (to tomcat6/webapps/solr/WEB-INF/lib) but leaving ownership of the jar files as ROOT instead of chown-ing them to TOMCAT6. After setting the right permission and restarting Tomcat it started working OK
找到了这个问题的解决方案,我正在使用 SolrJ 来更新我的 pdf 索引。
将 solr 部署到 tomcat 后,我没有将以下库包含到 tomcat/webapp 中
,并且遇到所有延迟加载问题等
我什至尝试获取 apache tika...
直到我这样做...
关闭 tomcat
\apache-solr-3.5.0\contrib\extract
将上面的库复制到下面
\apache-tomcat-7.0.26\webapps\solr\WEB-INF\lib
启动 tomcat
欢呼
Found the solution of this problem, I was using SolrJ to update my pdf indexing.
after deploy solr to tomcat, I didn't include the following libraries into the tomcat/webapp
and I get all the lazy loading problem, etc etc
I even try to get apache tika...
until I do this...
shutdown tomcat
\apache-solr-3.5.0\contrib\extraction
copy the libraries above to below
\apache-tomcat-7.0.26\webapps\solr\WEB-INF\lib
startup tomcat
cheers