Java 在linux中使用tess4j部署web应用程序
我必须搜索存储在数据库中的文档,这些文档中有图像,所以我使用tess4j来读取这些图像。 在使用eclipse的windows中,该项目与tess4j配合良好,如果我在windows7中的tomcat 6.35中部署应用程序,该项目也能配合良好,并且我可以使用tess4j进行正确搜索。 苏窗口 1) 我在tomcat lib/shared中添加jar文件 2) 数据和dll文件在存储库中,我在项目中调用它们 在linux环境中,我做了同样的事情,我得到的第一个错误是Java 在linux中使用tess4j部署web应用程序,java,linux,tomcat,tess4j,Java,Linux,Tomcat,Tess4j,我必须搜索存储在数据库中的文档,这些文档中有图像,所以我使用tess4j来读取这些图像。 在使用eclipse的windows中,该项目与tess4j配合良好,如果我在windows7中的tomcat 6.35中部署应用程序,该项目也能配合良好,并且我可以使用tess4j进行正确搜索。 苏窗口 1) 我在tomcat lib/shared中添加jar文件 2) 数据和dll文件在存储库中,我在项目中调用它们 在linux环境中,我做了同样的事情,我得到的第一个错误是 - Native libra
- Native library (linux-x86/libtesseract.so) not found in resource lib/shared/*
我将libtesseract.so和tesserData添加到此路径,现在我得到另一个错误:
java.lang.UnsatifiedLinkError:查找函数“TessBaseAPICreate”时出错:/usr/lib/libtesseract.so.3.0.2:未定义符号:TessBaseAPICreate
位于com.sun.jna.Function.(Function.java:208)
位于com.sun.jna.nativellibrary.getFunction(nativellibrary.java:536)
位于com.sun.jna.nativellibrary.getFunction(nativellibrary.java:513)
位于com.sun.jna.nativellibrary.getFunction(nativellibrary.java:499)
位于com.sun.jna.Library$Handler.invoke(Library.java:199)
位于com.sun.proxy.$Proxy5.TessBaseAPICreate(未知源)
位于net.sourceforge.tess4j.Tesseract.init(未知源)
位于net.sourceforge.tess4j.Tesseract.doOCR(未知源)
位于net.sourceforge.tess4j.Tesseract.doOCR(未知源)
位于net.sourceforge.tess4j.Tesseract.doOCR(未知源)
位于org.coin.bean.ged.Tess4j.extractTextFromImage(Tess4j.java:55)
位于org.coin.bean.ged.IndexDocument.CreateIndex(IndexDocument.java:158)
在org.coin.bean.ged.searchlucene.setKeyword上(searchlucene.java:40)
在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处
在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)中
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)中
位于java.lang.reflect.Method.invoke(Method.java:606)
位于org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34)
位于org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428)
位于org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431)
位于org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)
位于org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
位于org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
位于org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)
位于javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
位于javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
位于org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
位于org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
位于org.coin.servlet.filter.PreventInjectionFilter.doFilter(PreventInjectionFilter.java:30)
位于org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
位于org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
位于org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
位于org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
位于org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
位于org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
位于org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
位于org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
位于org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
位于org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
位于org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
运行(Thread.java:745)
---Erroring:batchId[7]message[java.lang.UnsatifiedLinkError:Error查找函数'TesserBaseApiCreate':/usr/lib/libtesseract.so.3.0.2:未定义符号:TesserBaseApiCreate]我刚刚开始使用Tesser4j,但您可能需要先安装“tesseract”。我打赌它会把丢失的二进制文件复制到那个目录中
您好,您解决问题了吗?我在Linux Centos中也遇到了与Tess4j相同的问题。非常感谢。