1、
报错内容:
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.UnsatisfiedLinkError: Unable to load library 'tesseract':libtesseract.so: cannot open shared object file: No such file or directory
Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'tesseract':
libtesseract.so: cannot open shared object file: No such file or directory
解决方法:将linux-x86-64放到Java工程的classpath根目录。这样在运行时,Tess4J就可以找到库了。因此将这些文件放到了src/main/resources下。
2、
报错内容:
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.UnsatisfiedLinkError: liblept.so.5: cannot open shared object file: No such file or directory
Caused by: java.lang.UnsatisfiedLinkError: liblept.so.5: cannot open shared object file: No such file or directory
解决方法:Java工程的classpath根目录linux-x86-64文件下的liblept.so,更名为liblept.so.5。
3、
报错内容:
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.tess4j.TessAPI
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.tess4j.TessAPI
解决方法:将linux-x86-64下的liblept.so.5文件,上传到Linux服务器 /usr/lib64 路径下即可解决。