有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java第三方库引发运行时错误,导致JVM致命错误

朋友们,我们的项目使用hunspell获取单词建议,下面是hunspell库的git hub链接

https://github.com/dren-dk/HunspellJNA/blob/master/src/dk/dren/hunspell/HunspellLibrary.java

每个单词都会使用hunspell库进行迭代以获得建议,该库使用下面的方法(“hunspell_suggest”方法,在上面的URL中)

public int Hunspell_suggest(Pointer pHunspell, PointerByReference slst, byte[] word);

当存在某些特殊的UTF-8字符时,“Hunspell_suggest”方法会抛出运行时错误&;这会导致Java运行时抛出致命错误并导致服务器停机(下面是JVM错误)。由于这是第三方图书馆,我们可能需要升级图书馆以支持&;试图从他们那里得到帮助。在抛出运行时错误之前,Hunspell正在发送以下消息,表明其对UTF-8支持的支持有限;需要升级图书馆

This UTF-8 encoding can't convert to UTF-16:ð?‘?   <= this message indicates hunspell limitation on certain UTF-8 conversion

然而,我正在寻求帮助;扭曲逻辑的建议&;此外,作为最佳实践,我们可以做些什么来保护我们的应用程序被终止&;在处理此类第三方库时,避免抛出如下错误,因为我们对限制和;当库将抛出运行时错误时

**JVM ERROR**

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000000321d3bf, pid=32624, tid=0x0000000000009698
#
# JRE version: Java(TM) SE Runtime Environment (8.0_221-b11) (build 1.8.0_221-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.221-b11 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [jna3287959182198759444.hunspell-win-x86-64.dll+0x2d3bf]

共 (0) 个答案