Search code examples
javalanguagetool

How do I fix java.lang.RuntimeException?


I'm trying to use LanguageTool. This is in the usage info:

> Using LanguageTool from other
> applications:    Start the stand-alone
> application and configure it to listen
> on a port that is not used yet (the
> default port, 8081, should often be
> okay). This way LanguageTool will run
> in server mode until you stop it. The
> client that wants to use LanguageTool
> can now just send its text to this
> URL:
> http://localhost:8081/?language=xx&text=my+text

I'm trying to use my IP http://<IP HERE>:8081/?language=xx&text=my+text but I keep getting

Error: java.lang.RuntimeException: Error: Access from (IP Address) denied

What am I doing wrong and how can I solve this?


Solution

  • The restriction of only accepting connections from local network addresses (i.e. the loopback device) is hard-coded: LanguageToolHttpHandler.

    If you want to change it you'll have to change the source.