java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.tess4j.TessAPI

670 views
Skip to first unread message

sanogo sy

unread,
Nov 21, 2023, 3:23:41 PM11/21/23
to WildFly
Hi every one. I'm new on wildfly. I use Wildfly 24. In local my project works fine, but I'm using a Windows. The problem occurs when I deploy and run on Linux centos 7. I get an error when I try to use tesseract-OCR like that: java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.tess4j.TessAPI

I already install tesseract, I checked that I had in location usr/share/local/ the folder tessdata exists. I tried to add in wildfly server a module called net.sourceforge.tess4j also, but still not working.
I've been working on it for 3 days without success, please.

Any help will be appreciated!


log.txt

Jose Socola

unread,
Nov 21, 2023, 6:22:14 PM11/21/23
to sanogo sy, WildFly
The error It's a reference path because use native, System.load the .so file, can u share screenshot of module structure folder, sometimes u need put .so files inside.


Regards,
JS

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/df55b09b-a2c7-457e-be14-2f274c080de3n%40googlegroups.com.

sanogo sy

unread,
Nov 22, 2023, 3:09:54 AM11/22/23
to WildFly
screenshot_module_wildfly.PNG

In my module.xml, I added code below:
<?xml version='1.0' encoding='UTF-8'?>

<module xmlns="urn:jboss:module:1.9" name="net.sourceforge.tess4j">

    <resources>
        <resource-root path="tess4j-5.7.0.jar"/>
    </resources>

    <dependencies>
        <module name="javax.api"/>
        <module name="javax.enterprise.api"/>
        <module name="javax.servlet.core"/> <module name="net.sourceforge.core"/>
    </dependencies>
</module>

sanogo sy

unread,
Nov 24, 2023, 4:02:13 PM11/24/23
to WildFly
I had to install tesseract 5. But now error say: Failed loading language 'eng'
In my log file I got:

Failed loading language 'eng'
Cube ERROR (CubeRecoContext::Load): unable to read cube language model params from /tmp/tess4j/tessdata/fra.cube.lm
Cube ERROR (CubeRecoContext::Create): unable to init CubeRecoContext object
init_cube_objects(false, &tessdata_manager):Error:Assert failed:in file tessedit.cpp, line 210
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fb7e88ac249, pid=56208, tid=0x00007fb7ed342700
#
# JRE version: OpenJDK Runtime Environment (8.0_131-b12) (build 1.8.0_131-b12)
# Java VM: OpenJDK 64-Bit Server VM (25.131-b12 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libtesseract.so+0x239249]  ERRCODE::error(char const*, TessErrorLogCode, char const*, ...) const+0x129

Need help. Please !
Reply all
Reply to author
Forward
0 new messages