【发布时间】:2018-12-26 19:18:19
【问题描述】:
我想使用 Wildfly 11 和 Tess4j 库。 我有一个简单的程序,它正在运行。
public static void main(String[] args) {
File imageFile = new File("myPath.pdf");
ITesseract instance = new Tesseract(); // JNA Interface Mapping
instance.setDatapath("myPath/tessdata");
instance.setLanguage("deu");
System.setProperty("jna.encoding", "UTF8");
instance.setOcrEngineMode(TessAPI.TessOcrEngineMode.OEM_DEFAULT);
try {
String result = instance.doOCR(imageFile);
System.out.println(result);
} catch (TesseractException e) {
System.err.println(e.getMessage());
}
}
-> 如果我尝试从 Eclipse 将程序作为“JAVA 应用程序”运行,但如果我尝试从 Wildfly 应用程序服务器执行程序,则会出现错误:
> trcmp(locale, "C"):Error:Assert failed:in file baseapi.cpp, line 209
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGILL (0x4) at pc=0x000000012c7a78af, pid=11404, tid=0x000000000000c80b
#
# JRE version: Java(TM) SE Runtime Environment (8.0_121-b13) (build 1.8.0_121-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.121-b13 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [libtesseract.dylib+0x1568af] _ZNK7ERRCODE5errorEPKc16TessErrorLogCodeS1_z+0x183
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
有什么想法吗? 我正在使用 tess4j 4.3.0 并且我还安装了 Ghostscript ... 单个 JAVA 应用程序和 Wildfly 服务器之间可能存在任何不同。
【问题讨论】: