Update: if you want to run LanguageTool locally, see our documentation at LanguageTool embedded HTTP Server | dev.languagetool.org
Purpose : Instead of pointing to languagetool.org, I’d love to setup a Language Server locally to run a HTML document against.
The HTML document comes with this specific line of code:
///////////////////////////////////
/* The URL of your LanguageTool server.
If you use your own server here and it’s not running on the same domain
as the text form, make sure the server gets started with ‘–allow-origin …’
and use ‘https://your-server/v2/check’ as URL: */
languagetool_rpc_url : “http://localhost:8081/v2/check?”,
//////////////////////////////////
Problem statement : Fail to make LanguageTool work, because after issuing this command : java -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8081
the Prompt throw errors as follows:
//
Server started
2017-12-13 08:24:35 An error has occurred, sending HTTP code 500. Access from 127.0.0.1, HTTP user agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36, language: en-US, text length: 43, Stacktrace follows:
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.languagetool.server.TextChecker.checkText(TextChecker.java:127)
at org.languagetool.server.ApiV2.handleRequest(ApiV2.java:60)
at org.languagetool.server.LanguageToolHttpHandler.handle(LanguageToolHttpHandler.java:101)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.AuthFilter.doFilter(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.ServerImpl$Exchange.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)
Caused by: java.lang.NullPointerException
at org.languagetool.rules.CleanOverlappingFilter.getMatchPriority(CleanOverlappingFilter.java:89)
at org.languagetool.rules.CleanOverlappingFilter.filter(CleanOverlappingFilter.java:63)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:548)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:492)
at org.languagetool.JLanguageTool.check(JLanguageTool.java:480)
at org.languagetool.server.TextChecker.getRuleMatches(TextChecker.java:200)
at org.languagetool.server.TextChecker.access$000(TextChecker.java:43)
at org.languagetool.server.TextChecker$1.call(TextChecker.java:121)
at org.languagetool.server.TextChecker$1.call(TextChecker.java:114)
at java.util.concurrent.FutureTask.run(Unknown Source)
//
Meanwhile, When checking the HTML document, I find out that the HTML document highlights this error message that follows:
Summary
Error: Did not get response from service. Please try again in one minute.