Re: Website integration for LT

2016-04-21 Thread Daniel Naber
On 2016-04-20 19:21, Andriy Rysin wrote:

> I would argue that no matter when and how often it happens stack trace
> is only useful for the site admin, who can see the trace in the log
> anyway, for the thousands of the web-page users stack trace is not
> interesting (if not discouraging). Also the stack trace may reveal
> problems with site setup which is also a security problem.

Well okay, feel free to apply the patch you suggested in your previous 
mail.

> Regardless of the 500 handling, shall we add the  id="feedbackErrorMessage" style="color: red;"> to the wiki?

I've done that.

> org.languagetool.server.TextTooLongException: Your text exceeds this
> server's limit of 200 characters.
> ...
> but my web-page showed this instead "Error: Did not get response from
> service. Please try again in one minute.",

I cannot reproduce this, are you using a recent snapshot as the server? 
I get a good error message telling me the text is too long.

Regards
  Daniel


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel


Re: Website integration for LT

2016-04-20 Thread Andriy Rysin
I would argue that no matter when and how often it happens stack trace
is only useful for the site admin, who can see the trace in the log
anyway, for the thousands of the web-page users stack trace is not
interesting (if not discouraging). Also the stack trace may reveal
problems with site setup which is also a security problem.

Regardless of the 500 handling, shall we add the  to the wiki? It
seems that we would usually want to show the user the errors like
"Error: There are currently too many parallel requests. Please try
again later." or "Your text exceeds this server's limit of XXX
characters."?

BTW I configured my server to 200 chars limit and submitted bigger
text and I got correct message in the log:
2016-04-20 19:54:55 An error has occurred. Sending HTTP code 413.
Stacktrace follows:
org.languagetool.server.TextTooLongException: Your text exceeds this
server's limit of 200 characters.
...
but my web-page showed this instead "Error: Did not get response from
service. Please try again in one minute.", when I try to submit POST
manually I get 0 response for some reason.

Regards,
Andriy

2016-04-20 12:27 GMT-04:00 Daniel Naber :
> On 2016-04-20 17:48, Andriy Rysin wrote:
>
>> Can I also suggest we make 500 message more user-friendly? E.g. with
>> something like this
>
> The common causes for 500 errors should all already have a friendly
> error message. Something like ClassNotFound seems uncommon and should
> only happen when setting up the system the first time, and I think in
> these cases it makes sense to show the full stacktrace.
>
> Regards
>   Daniel
>
>
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Languagetool-devel mailing list
> Languagetool-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/languagetool-devel

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel


Re: Website integration for LT

2016-04-20 Thread Daniel Naber
On 2016-04-20 17:48, Andriy Rysin wrote:

> Can I also suggest we make 500 message more user-friendly? E.g. with
> something like this

The common causes for 500 errors should all already have a friendly 
error message. Something like ClassNotFound seems uncommon and should 
only happen when setting up the system the first time, and I think in 
these cases it makes sense to show the full stacktrace.

Regards
  Daniel


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel


Re: Website integration for LT

2016-04-20 Thread Andriy Rysin
Cool, I've added error field in red like this:
  
And it now warns users (and me) if something is wrong and text hasn't
actually been checked.

Can I also suggest we make 500 message more user-friendly? E.g. with
something like this

diff --git 
a/languagetool-server/src/main/java/org/languagetool/server/LanguageToolHttpHandler.java
b/languagetool-server/src/main/java/org/languagetool/server/LanguageToolHttpHandler
 .java
index ac6b611..2f16116 100644
--- 
a/languagetool-server/src/main/java/org/languagetool/server/LanguageToolHttpHandler.java
+++ 
b/languagetool-server/src/main/java/org/languagetool/server/LanguageToolHttpHandler.java
@@ -227,7 +227,7 @@ class LanguageToolHttpHandler implements HttpHandler {
 response = "Checking took longer than " +
maxCheckTimeMillis/1000 + " seconds, which is this server's limit. " +
"Please make sure you have selected the proper
language or consider submitting a shorter text.";
   } else {
-response = Tools.getFullStackTrace(e);
+response = "Internal Error. Please contact site
administrator"; //Tools.getFullStackTrace(e);
 errorCode = HttpURLConnection.HTTP_INTERNAL_ERROR;
   }
   logError(text, remoteAddress, e, errorCode);


2016-04-20 11:03 GMT-04:00 Daniel Naber :
> On 2016-04-20 16:44, Andriy Rysin wrote:
>
>> 4) if I submit a check via the web-page (directly to API, no proxy)
>> there's no messages and text shows up as no errors
>
> I see now - please add  to your
> page, it should display the error.
>
> Regards
>   Daniel
>
>
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Languagetool-devel mailing list
> Languagetool-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/languagetool-devel

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel


Re: Website integration for LT

2016-04-20 Thread Daniel Naber
On 2016-04-20 16:44, Andriy Rysin wrote:

> 4) if I submit a check via the web-page (directly to API, no proxy)
> there's no messages and text shows up as no errors

I see now - please add  to your 
page, it should display the error.

Regards
  Daniel


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel


Re: Website integration for LT

2016-04-20 Thread Andriy Rysin
Thanks David

 I've adjusted --allow-origin and it works fine now.

The original problem is still there though:
1) remove server dependency jar (e.g. morfologik-tools.jar) and
restart the server
2) submit a request to the server
3) if I do it with dev tool I see the stack trace
(java.lang.NoClassDefFoundError: morfologik/util/ResourceUtils) - BTW
we probably should not expose our internal exceptions to the world
(rather catch 500 and print short message)
4) if I submit a check via the web-page (directly to API, no proxy)
there's no messages and text shows up as no errors

Regards,
Andriy

2016-04-20 9:29 GMT-04:00 Daniel Naber :
> On 2016-04-20 15:02, Andriy Rysin wrote:
>
>> this works if I point to https://languagetool.org/api/v1/, but I was
>> not able to run with direct API pointing to the server running locally
>> on my machine. I've added --public and it listens on *:8081 but it
>> never returns a request.
>> Is there some other config options I need to turn on?
>
> Yes, see the comment next to languagetool_rpc_url:
>
> the URL of your LanguageTool server or the URL of your proxy file,
> 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 ...'
>
> So you can use
>
>--allow-origin '*'
>
> to make sure it works from everywhere.
>
> Regards
>   Daniel
>
>
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Languagetool-devel mailing list
> Languagetool-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/languagetool-devel

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel


Re: Website integration for LT

2016-04-20 Thread Daniel Naber
On 2016-04-20 15:02, Andriy Rysin wrote:

> this works if I point to https://languagetool.org/api/v1/, but I was
> not able to run with direct API pointing to the server running locally
> on my machine. I've added --public and it listens on *:8081 but it
> never returns a request.
> Is there some other config options I need to turn on?

Yes, see the comment next to languagetool_rpc_url:

the URL of your LanguageTool server or the URL of your proxy file,
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 ...'

So you can use

   --allow-origin '*'

to make sure it works from everywhere.

Regards
  Daniel


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel


Re: Website integration for LT

2016-04-20 Thread Andriy Rysin
Thanks Daniel

this works if I point to https://languagetool.org/api/v1/, but I was
not able to run with direct API pointing to the server running locally
on my machine. I've added --public and it listens on *:8081 but it
never returns a request.
Is there some other config options I need to turn on?

Thanks
Andriy

2016-04-19 4:31 GMT-04:00 Daniel Naber :
> On 2016-04-18 21:25, Daniel Naber wrote:
>
>> So you're using proxy.php, aren't you? Very soon (hopefully tomorrow)
>> I'll update the documentation anyway, as the proxy.php isn't needed
>> anymore as long as the server gets started with the proper parameters.
>
> Done, everyone can now integrate LT on their web page just with
> Javascript, no PHP needed anymore:
>
> http://wiki.languagetool.org/integration-on-websites
>
> Regards
>   Daniel
>
>
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Languagetool-devel mailing list
> Languagetool-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/languagetool-devel

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel


Re: Website integration for LT

2016-04-19 Thread Daniel Naber
On 2016-04-18 21:25, Daniel Naber wrote:

> So you're using proxy.php, aren't you? Very soon (hopefully tomorrow)
> I'll update the documentation anyway, as the proxy.php isn't needed
> anymore as long as the server gets started with the proper parameters.

Done, everyone can now integrate LT on their web page just with 
Javascript, no PHP needed anymore:

http://wiki.languagetool.org/integration-on-websites

Regards
  Daniel


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel


Re: Website integration for LT

2016-04-18 Thread Daniel Naber
On 2016-04-18 19:58, Andriy Rysin wrote:

Hi Andriy,

> I noticed that when I integrate LT on the website and some internal
> error occurs (e.g. missing jars, out of memory etc) there's no
> notification to the user and it comes back like text does not have any
> errors.

how exactly do you integrate LT? Can you post an example URL that throws 
an error that's not visible?

Regards
  Daniel


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel