Error: empty dic file

Hello!

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)

Thank you.

Chris

Thanks for your bug report. Could you please check if these three files
are there and what size they are?

./org/languagetool/resource/fr/french.dict
./org/languagetool/resource/fr/hunspell/fr_FR.aff
./org/languagetool/resource/fr/hunspell/fr_FR.dic

All are there:

french.dict : 596 KB (609 616 bytes).
fr_FR.aff : 402 KB (412 361).
fr_FR.dic : 1128 KB (1 154 546).
→ Common date: 2013-09-30.

By the way, there is no
“org/languagetool/resource/en/hunspell/en_GB.aff” nor “en_US.aff”, if
that can help.
(but .dict are there).

Thank you for your help.

Le 08/10/2013 12:45, dnaber [via LanguageTool User Forum] a écrit :

Thanks for your bug report. Could you please check if these three files
are there and what size they are?

./org/languagetool/resource/fr/french.dict
./org/languagetool/resource/fr/hunspell/fr_FR.aff
./org/languagetool/resource/fr/hunspell/fr_FR.dic


If you reply to this email, your message will be added to the
discussion below:
http://languagetool-user-forum.2306527.n4.nabble.com/error-empty-dic-file-tp4641134p4641135.html

To unsubscribe from error: empty dic file, click here
http://languagetool-user-forum.2306527.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4641134&code=Y3VyaWV1eC5wdWJsaWNAZnJlZS5mcnw0NjQxMTM0fC04Nzk5NjgxMA==.
NAML
http://languagetool-user-forum.2306527.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html!nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers!nabble%3Aemail.naml-instant_emails!nabble%3Aemail.naml-send_instant_email!nabble%3Aemail.naml

It’s okay when en_GB.aff and en_US.aff are missing. Could you maybe try
this on the command line?

java -jar languagetool-commandline.jar -l fr test.txt

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.

The same error occurs:

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.

Regards
Daniel

  • Same error message with Java 32 and 64 bits.
  • 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).

Thank you for your help, I appreciate.

  • Same error message with Java 32 and 64 bits.
  • 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).

Thank you for your help, I appreciate.

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.