HTTP Status 500 - Handler processing failed; nested exception is java.lang.UnsatisfiedLinkError: The specified module could not be found
HTTP Status 500 - Handler processing failed; nested exception is java.lang.UnsatisfiedLinkError: The specified module could not be found
我正在尝试使用 tess4j.When 实现 OCR 当我将 WAR 文件部署到 tomcat 或 Jboss 我低于错误
HTTP Status 500 - Handler processing failed; nested exception is
java.lang.UnsatisfiedLinkError: The specified module could not be
found.
type Exception report
message Handler processing failed; nested exception is
java.lang.UnsatisfiedLinkError: The specified module could not be
found.
description The server encountered an internal error that prevented it
from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Handler
processing failed; nested exception is java.lang.UnsatisfiedLinkError:
The specified module could not be found.
org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1303)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:977)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
java.lang.UnsatisfiedLinkError: The specified module could not be
found.
com.sun.jna.Native.open(Native Method)
com.sun.jna.Native.open(Native.java:1759)
com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:260)
com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
com.sun.jna.Library$Handler.(Library.java:147)
com.sun.jna.Native.loadLibrary(Native.java:412)
com.sun.jna.Native.loadLibrary(Native.java:391)
net.sourceforge.tess4j.util.LoadLibs.getTessAPIInstance(LoadLibs.java:75)
net.sourceforge.tess4j.TessAPI.(TessAPI.java:42)
net.sourceforge.tess4j.Tesseract.init(Tesseract.java:367)
net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:280)
net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:212)
net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:196)
org.infotech.jdol.pdfjs.Utils.doOCRSample(Utils.java:77)
org.infotech.jdol.pdfjs.Utils.imageAsPDF(Utils.java:54)
org.infotech.jdol.pdfjs.controllers.PdfViewerController.getViewer(PdfViewerController.java:25)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:111)
我只为我在这里发布的 apache 实现了
在您的 Apache tomcat 中创建如下所示的文件夹结构。
阿帕奇-tomcat-8.0.39\temp\tess4j\win32-x86-64
将以下 dll 粘贴到您的 win32-x86-64 文件夹中
- gsdll64.dll
- liblept174.dll
- libtesseract305.dll
注意:我用的eclipse和java都是64位的
下面是添加的dll路径截图
image link
我正在尝试使用 tess4j.When 实现 OCR 当我将 WAR 文件部署到 tomcat 或 Jboss 我低于错误
HTTP Status 500 - Handler processing failed; nested exception is java.lang.UnsatisfiedLinkError: The specified module could not be found.
type Exception report
message Handler processing failed; nested exception is java.lang.UnsatisfiedLinkError: The specified module could not be found.
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.UnsatisfiedLinkError: The specified module could not be found.
org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1303) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:977) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:622) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause
java.lang.UnsatisfiedLinkError: The specified module could not be found.
com.sun.jna.Native.open(Native Method) com.sun.jna.Native.open(Native.java:1759) com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:260) com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398) com.sun.jna.Library$Handler.(Library.java:147) com.sun.jna.Native.loadLibrary(Native.java:412) com.sun.jna.Native.loadLibrary(Native.java:391) net.sourceforge.tess4j.util.LoadLibs.getTessAPIInstance(LoadLibs.java:75) net.sourceforge.tess4j.TessAPI.(TessAPI.java:42) net.sourceforge.tess4j.Tesseract.init(Tesseract.java:367) net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:280) net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:212) net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:196) org.infotech.jdol.pdfjs.Utils.doOCRSample(Utils.java:77) org.infotech.jdol.pdfjs.Utils.imageAsPDF(Utils.java:54) org.infotech.jdol.pdfjs.controllers.PdfViewerController.getViewer(PdfViewerController.java:25) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:111)
我只为我在这里发布的 apache 实现了
在您的 Apache tomcat 中创建如下所示的文件夹结构。 阿帕奇-tomcat-8.0.39\temp\tess4j\win32-x86-64
将以下 dll 粘贴到您的 win32-x86-64 文件夹中
- gsdll64.dll
- liblept174.dll
- libtesseract305.dll
注意:我用的eclipse和java都是64位的
下面是添加的dll路径截图
image link