When I run LanguageTool 2.3 as stand-alone, I have this error: empty dic file
(more details below)
I tried to update with JARs of update 2.3.1 from Maven. Same error.
My environment is: Windows 7-64 French, Java 1.7.0_40 (32 bits).
Any idea ?
Details:
java -jar languagetool-standalone.jar
error: empty dic file
Hash Manager Error : 2
Exception in thread “AWT-EventQueue-0” java.lang.Error: Invalid memory access
at com.sun.jna.Native.invokeInt(Native Method)
at com.sun.jna.Function.invoke(Function.java:383)
at com.sun.jna.Function.invoke(Function.java:315)
at com.sun.jna.Library$Handler.invoke(Library.java:212)
at com.sun.proxy.$Proxy0.Hunspell_add(Unknown Source)
at org.languagetool.rules.spelling.hunspell.Hunspell$Dictionary.addWord(Hunspell.java:402)
at org.languagetool.rules.spelling.hunspell.HunspellRule.init(HunspellRule.java:170)
at org.languagetool.rules.spelling.SpellingCheckRule.resetIgnoreTokens(SpellingCheckRule.java:104)
at org.languagetool.JLanguageTool.setIgnoreWords(JLanguageTool.java:383)
at org.languagetool.JLanguageTool.reInitSpellCheckIgnoreWords(JLanguageTool.java:402)
at org.languagetool.JLanguageTool.disableRule(JLanguageTool.java:396)
at org.languagetool.gui.LanguageToolSupport.getCurrentLanguageTool(LanguageToolSupport.java:207)
at org.languagetool.gui.LanguageToolSupport.warmUpChecker(LanguageToolSupport.java:175)
at org.languagetool.gui.LanguageToolSupport.init(LanguageToolSupport.java:236)
at org.languagetool.gui.LanguageToolSupport.(LanguageToolSupport.java:126)
at org.languagetool.gui.Main.createGUI(Main.java:305)
at org.languagetool.gui.Main.access$1100(Main.java:51)
at org.languagetool.gui.Main$6.run(Main.java:720)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Put some short French sentence into a plain text file “test.txt” for
this. You need to be in the directory where LT is installed when calling
this command.
java -jar languagetool-commandline.jar -l fr test.txt
Expected text language: French
Working on test.txt…
error: empty dic file
Hash Manager Error : 2
Exception in thread “main” java.lang.RuntimeException:
java.util.concurrent.ExecutionException: java.lang.Error: Invalid memory
access
at
org.languagetool.MultiThreadedJLanguageTool.performCheck(MultiThreadedJLanguageTool.java:101)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:530)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:488)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:484)
at
org.languagetool.commandline.CommandLineTools.checkText(CommandLineTools.java:95)
at
org.languagetool.commandline.CommandLineTools.checkText(CommandLineTools.java:72)
at
org.languagetool.commandline.Main.runOnFileInOneGo(Main.java:185)
at org.languagetool.commandline.Main.runOnFile(Main.java:163)
at org.languagetool.commandline.Main.main(Main.java:517)
Caused by: java.util.concurrent.ExecutionException: java.lang.Error:
Invalid memory access
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at
org.languagetool.MultiThreadedJLanguageTool.performCheck(MultiThreadedJLanguageTool.java:98)
… 8 more
Caused by: java.lang.Error: Invalid memory access
at com.sun.jna.Native.invokeInt(Native Method)
at com.sun.jna.Function.invoke(Function.java:383)
at com.sun.jna.Function.invoke(Function.java:315)
at com.sun.jna.Library$Handler.invoke(Library.java:212)
at com.sun.proxy.$Proxy0.Hunspell_add(Unknown Source)
at
org.languagetool.rules.spelling.hunspell.Hunspell$Dictionary.addWord(Hunspell.java:402)
at
org.languagetool.rules.spelling.hunspell.HunspellRule.init(HunspellRule.java:170)
at
org.languagetool.rules.spelling.hunspell.HunspellRule.match(HunspellRule.java:81)
at
org.languagetool.JLanguageTool.checkAnalyzedSentence(JLanguageTool.java:624)
at
org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:933)
at
org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:900)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)
at java.lang.Thread.run(Unknown Source)
You’re the first person to report this and I cannot reproduce the
problem here, so I can only suggest what you could try:
-Does it also happen with 64 bit Java?
-You could replace hunspell-win-x86-32.dll with the version available at HunspellJNA/hunspell-win-x86-32.dll at master · dren-dk/HunspellJNA · GitHub (click the “Raw” link for download). In LanguageTool, that file is inside libs/hunspell-native-libs.jar, so you’d need to unzip that file, replace the DLL, and zip it again.
I updated Java to 1.7.0_45-b18: same error (32 and 64 bits).
updated “hunspell-win-x86-32.dll”: same error.
Additionally, I tried to install LanguageTool 2.3 in LibreOffice
4.0.4.2: no correction is apparent (even with Hunspell unchecked) in
a text marked as English.
Well, if I am the only one with this problem, maybe there is something
wrong in my system (I don’t know what, since I use other Java
applications with no problem).
I updated Java to 1.7.0_45-b18: same error (32 and 64 bits).
updated “hunspell-win-x86-32.dll”: same error.
Additionally, I tried to install LanguageTool 2.3 in LibreOffice
4.0.4.2: no correction is apparent (even with Hunspell unchecked) in
a text marked as English.
Well, if I am the only one with this problem, maybe there is something
wrong in my system (I don’t know what, since I use other Java
applications with no problem).
If you search the web for “error: empty dic file” you’ll find other people have this problem, too. But I didn’t find a solution. It’s not specific to LanguageTool, but to the fact that LanguageTool (a Java software) uses hunspell (a C or C++ software) internally. I’m sorry that’s all I can say for now.