0

I am trying to implement OCR using tess4j.When I am running the application in eclipse its working fine.But when I deployed the WAR file to tomcat or Jboss I am getting below error

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)

pirho
  • 11,565
  • 12
  • 43
  • 70
Shailesh
  • 38
  • 7

1 Answers1

1

I have implemented only for apache that i am posting here

create a folder structure like the below in your apache tomcat. apache-tomcat-8.0.39\temp\tess4j\win32-x86-64

paste the below dlls in your win32-x86-64 folder

  1. gsdll64.dll
  2. liblept174.dll
  3. libtesseract305.dll

Note: eclipse and java i used are 64 bit

below is the screenshot about the path of dlls that added

image link

Community
  • 1
  • 1