Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make API call using "auto" language detection leads to an error #67

Closed
tivaliy opened this issue Feb 27, 2023 · 3 comments
Closed

Make API call using "auto" language detection leads to an error #67

tivaliy opened this issue Feb 27, 2023 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@tivaliy
Copy link

tivaliy commented Feb 27, 2023

I have the following issue when trying to make /v2/check API call with language set to auto:

2023-02-27 08:40:38.181 +0000 ERROR org.languagetool.server.LanguageToolHttpHandler An error has occurred: 'java.lang.NoClassDefFoundError: Could not initialize class dumonts.hunspell.bindings.HunspellLibrary, detected: pt-PT', sending HTTP code 500. Access from 172.17.0.1, HTTP user agent: python-requests/2.28.2, User agent param: null, Referrer: null, language: auto, h: 1, r: 14018, time: 154text length: 3, m: ALL, l: DEFAULT, Stacktrace follows:java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class dumonts.hunspell.bindings.HunspellLibrary, detected: pt-PT
	at org.languagetool.server.TextChecker.checkText(TextChecker.java:507)
	at org.languagetool.server.ApiV2.handleCheckRequest(ApiV2.java:172)
	at org.languagetool.server.ApiV2.handleRequest(ApiV2.java:83)
	at org.languagetool.server.LanguageToolHttpHandler.handle(LanguageToolHttpHandler.java:185)
	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
	at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)
	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
	at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:848)
	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
	at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:817)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class dumonts.hunspell.bindings.HunspellLibrary
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at org.languagetool.server.TextChecker.checkText(TextChecker.java:489)
	... 12 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class dumonts.hunspell.bindings.HunspellLibrary
	at dumonts.hunspell.Hunspell.<init>(Hunspell.java:21)
	at org.languagetool.rules.spelling.hunspell.DumontsHunspellDictionary.<init>(DumontsHunspellDictionary.java:33)
	at org.languagetool.rules.spelling.hunspell.Hunspell.getDictionary(Hunspell.java:46)
	at org.languagetool.rules.spelling.hunspell.HunspellRule.init(HunspellRule.java:584)
	at org.languagetool.rules.spelling.hunspell.HunspellRule.ensureInitialized(HunspellRule.java:558)
	at org.languagetool.rules.spelling.hunspell.HunspellRule.match(HunspellRule.java:220)
	at org.languagetool.JLanguageTool.checkAnalyzedSentence(JLanguageTool.java:1370)
	at org.languagetool.JLanguageTool.access$1500(JLanguageTool.java:74)
	at org.languagetool.JLanguageTool$TextCheckCallable.getOtherRuleMatches(JLanguageTool.java:1950)
	at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1862)
	at org.languagetool.JLanguageTool$TextCheckCallable.call(JLanguageTool.java:1833)
	at org.languagetool.JLanguageTool.performCheck(JLanguageTool.java:1294)
	at org.languagetool.JLanguageTool.checkInternal(JLanguageTool.java:991)
	at org.languagetool.JLanguageTool.check2(JLanguageTool.java:918)
	at org.languagetool.server.TextChecker.getPipelineResults(TextChecker.java:802)
	at org.languagetool.server.TextChecker.getRuleMatches(TextChecker.java:751)
	at org.languagetool.server.TextChecker.lambda$checkText$5(TextChecker.java:472)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	... 3 more

2023-02-27 08:40:38.182 +0000 INFO  org.languagetool.server.LanguageToolHttpHandler Handled request in 155ms; sending code 500

Any suggestion on how that could be fixed?

@Erikvl87
Copy link
Owner

Hi, do you happen to run this image on an ARM64 architecture? If so, this may be duplicate with #66.

@tivaliy
Copy link
Author

tivaliy commented Mar 10, 2023

Hi, do you happen to run this image on an ARM64 architecture? If so, this may be duplicate with #66.

yep (Apple M1)

Darwin 22.3.0 arm64

@Erikvl87
Copy link
Owner

Thanks for the quick response. In that case, I have your issue reproduced and I am working on getting it fixed in #66. I'll mark this one as duplicate. Could you track #66 instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants