0

I have a Java Web project using Tess4j. On my local Mac OS it works perfect because probably I already have the Tesseract and Leptonica libraries built from source by

./config, make, make install

Now I want to deploy the project to a remote Linux host(private jvm), I created war file and saw that it contains various tesseract and leptonica jar files for the linux platform for 32 and 64 bit

mvn package -Dplatform.dependencies

But after deploy still I got this error:

 .UnsatisfiedLinkError: Unable to load library 'tesseract': Native library (linux-x86-64/libtesseract.so) not found in resource path ([file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/classes/, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/aopalliance-1.0.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/commons-beanutils-1.8.3.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/commons-io-1.3.1.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/commons-logging-1.1.3.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/ghost4j-0.5.1.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/itext-2.1.7.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/jai-imageio-core-standalone-1.2-pre-dr-b04-2011-07-04.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/jna-4.1.0.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/log4j-1.2.15.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/platform-3.5.2.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-aop-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-beans-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-context-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-core-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-expression-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-web-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-webmvc-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/tess4j-2.0.0.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/xmlgraphics-commons-1.4.jar])

What is the problem here? I don't have a chance to use command line on this remote host, So what is missing here and how do I get the necessaray libraries installed in place?

Spring
  • 11,333
  • 29
  • 116
  • 185

1 Answers1

0

I don't know these libraries but from your error it looks like your linux don't have the required binairies.

If you are on Ubuntu you can try:

sudo apt-get install libtesseract-dev leptonica-progs
bodyjares
  • 440
  • 1
  • 4
  • 16
  • 1
    Well you are asking what is missing and I say that your server don't have these Linux libraries libtesseract-dev and leptonica-progs. You need to find a way to install them. – bodyjares Jun 20 '15 at 21:00
  • I can try to download the library (http://packages.ubuntu.com/precise/libtesseract-dev) and extract from the deb the so file and add it to your application so it can be find in /WEB-INF/classes/ – bodyjares Jun 20 '15 at 21:10
  • could you tell me how/where can I add a .so file on a java project? on a remote host – Spring Jun 20 '15 at 21:18
  • Assuming that you are using Maven. You can put your so file in src/main/resources/ – bodyjares Jun 20 '15 at 21:28
  • I have libtesseract.so.3 and libjnitesseract.so files, is it ok? – Spring Jun 20 '15 at 21:37
  • Your error message is asking for libtesseract.so, so, at least, you need that file. You can try to add more files than less. – bodyjares Jun 20 '15 at 21:41
  • well then I dont have that file, I have mac, and it didn't work – Spring Jun 20 '15 at 21:47
  • @Spring Did you able to fix this issue at the end? I am facing the same issue like you. Could you please help me. – gashu Aug 24 '17 at 19:44
  • @gashu I changed my hosting company where I have ssh root access and installed missing libraries on server, tho dont remember the details – Spring Aug 25 '17 at 08:22