Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » HTTP ERROR 500 when a table tooltip raises an exception
HTTP ERROR 500 when a table tooltip raises an exception [message #878486] Tue, 29 May 2012 12:16 Go to next message
Sebastien Arod is currently offline Sebastien ArodFriend
Messages: 41
Registered: July 2009
Member
Hi,

It seems that exceptions raised during org.eclipse.jface.viewers.CellLabelProvider.getToolTipText(Object) are not handled by RWT and make the session stop with an HTTP 500 error.


Is this the expected behavior or should I create a bug to track this?

-Seb
Re: HTTP ERROR 500 when a table tooltip raises an exception [message #878508 is a reply to message #878486] Tue, 29 May 2012 13:04 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Sebastien,
why do you think that these exceptions should be handled by RWT? It's
not a framework job to catch the user code exceptions or I miss
something? Do you have a simple snippet to make the issue clear?
Best,
Ivan

On 5/29/2012 3:16 PM, Sebastien Arod wrote:
> Hi,
>
> It seems that exceptions raised during
> org.eclipse.jface.viewers.CellLabelProvider.getToolTipText(Object) are
> not handled by RWT and make the session stop with an HTTP 500 error.
>
>
> Is this the expected behavior or should I create a bug to track this?
>
> -Seb

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: HTTP ERROR 500 when a table tooltip raises an exception [message #878590 is a reply to message #878508] Tue, 29 May 2012 15:15 Go to previous messageGo to next message
Sebastien Arod is currently offline Sebastien ArodFriend
Messages: 41
Registered: July 2009
Member
Hi Ivan,

From what I experienced so far most of the time RAP handles exception raised from user code by logging the error and/or displaying an error dialog if it is not catched in user code. For instance if an exception is raised in CellLabelProvider.getText(Object) instead of CellLabelProvider.getToolTipText(Object) an error dialog is displayed instead of the Error 500.

I agree that exceptions should be trapped in user code but sometimes it's not done and when unexpected exceptions happens it could be nicer to have an error dialog rather than having an HTTP error 500 that causes loosing the user session.

Seeing that there was a difference in behavior between getToolTipText and other similar methods I was just wondering if this was the expected behavior.


Regards,
-Seb
Re: HTTP ERROR 500 when a table tooltip raises an exception [message #878668 is a reply to message #878590] Tue, 29 May 2012 17:29 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 335
Registered: July 2009
Senior Member
Sebastien,

if you are using the workbench, it installs an exception handler in
Window#setExceptionHandler() that handles exceptions in user code.
For RWT standalone it depends whether you use the JEE_COMPATIBILITY mode
or SWT_COMPATIBILITY mode.

When running in SWT_COMPATIBILITY mode, all exceptions are thrown from
Display#readAndDispatch(). By wrapping the event loop with a try-catch
block you can control what happens with exceptions that occur in your
code during event processing. This is the same approach which is used by
the default exception handler in Window.

For the JEE_COMPATIBILITY mode, there is currently no way to handle
exceptions, see this feature request [1].

Regards,
Rüdiger

[1] 367773: The JEE_COMPATIBILITY mode is missing central exceptions
handling
https://bugs.eclipse.org/bugs/show_bug.cgi?id=367773

On 29.05.2012 17:15, Sebastien Arod wrote:
> Hi Ivan,
>
> From what I experienced so far most of the time RAP handles exception
> raised from user code by logging the error and/or displaying an error
> dialog if it is not catched in user code. For instance if an exception
> is raised in CellLabelProvider.getText(Object) instead of
> CellLabelProvider.getToolTipText(Object) an error dialog is displayed
> instead of the Error 500.
>
> I agree that exceptions should be trapped in user code but sometimes
> it's not done and when unexpected exceptions happens it could be nicer
> to have an error dialog rather than having an HTTP error 500 that causes
> loosing the user session.
>
> Seeing that there was a difference in behavior between getToolTipText
> and other similar methods I was just wondering if this was the expected
> behavior.
>
>
> Regards,
> -Seb

--
Rüdiger Herrmann
http://codeaffine.com
Re: HTTP ERROR 500 when a table tooltip raises an exception [message #878939 is a reply to message #878486] Wed, 30 May 2012 08:38 Go to previous messageGo to next message
Sebastien Arod is currently offline Sebastien ArodFriend
Messages: 41
Registered: July 2009
Member
Hi Rüdiger,

I use the workbench but even so the exceptions raised in getToolTipText() are not handled and cause an HTTP 500.

I tried to debug and compare the behavior between RAP and RCP on this.

In both RCP and RAP the exceptions are catched in org.eclipse.ui.internal.Workbench.runEventLoop(IExceptionHandler, Display) and passed to the ExceptionHandler class for handling.

ExceptionHandler itself simply throws exception inheriting ThreadDeath
and delegates the handling for other exceptions to WorkbenchAdvisor.eventLoopException(Throwable).

However in RAP RWTLifeCycle.continueLifeCycle() wraps the original exception in a PhaseExecutionError (which extend ThreadDeath) before it reaches the handler so the exception is not logged by ExceptionHandler but it is instead re-thrown and handled at servlet level which cause the HTTP 500.

So there is a difference in behavior between RAP and RCP right?

Regards,
-Seb
Re: HTTP ERROR 500 when a table tooltip raises an exception [message #878949 is a reply to message #878939] Wed, 30 May 2012 08:51 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 335
Registered: July 2009
Senior Member
Sebastien,

when using the workbench, exceptions from user code should end up in the
ExceptionHandler. I vaguely remember that JFace tooltips are handled
somewhat special as they aren't real widgets.
However, to me this looks like a bug (Ivan, please correct me if I'm
wrong). Would you mind to file a bugzilla, preferably along with a stack
trace?

Regards,
Rüdiger

On 30.05.2012 10:38, Sebastien Arod wrote:
> Hi Rüdiger,
>
> I use the workbench but even so the exceptions raised in
> getToolTipText() are not handled and cause an HTTP 500.
>
> I tried to debug and compare the behavior between RAP and RCP on this.
>
> In both RCP and RAP the exceptions are catched in
> org.eclipse.ui.internal.Workbench.runEventLoop(IExceptionHandler,
> Display) and passed to the ExceptionHandler class for handling.
>
> ExceptionHandler itself simply throws exception inheriting ThreadDeath
> and delegates the handling for other exceptions to
> WorkbenchAdvisor.eventLoopException(Throwable).
>
> However in RAP RWTLifeCycle.continueLifeCycle() wraps the original
> exception in a PhaseExecutionError (which extend ThreadDeath) before it
> reaches the handler so the exception is not logged by ExceptionHandler
> but it is instead re-thrown and handled at servlet level which cause the
> HTTP 500.
>
> So there is a difference in behavior between RAP and RCP right?
>
> Regards,
> -Seb
--
Rüdiger Herrmann
http://codeaffine.com
Re: HTTP ERROR 500 when a table tooltip raises an exception [message #878956 is a reply to message #878949] Wed, 30 May 2012 09:06 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Sounds like a bug to me too. Please attach to the bug a simple
self-running snippet/project that demonstrate the issue too.
Thanks,
Ivan

On 5/30/2012 11:51 AM, Rüdiger Herrmann wrote:
> Sebastien,
>
> when using the workbench, exceptions from user code should end up in
> the ExceptionHandler. I vaguely remember that JFace tooltips are
> handled somewhat special as they aren't real widgets.
> However, to me this looks like a bug (Ivan, please correct me if I'm
> wrong). Would you mind to file a bugzilla, preferably along with a
> stack trace?
>
> Regards,
> Rüdiger
>
> On 30.05.2012 10:38, Sebastien Arod wrote:
>> Hi Rüdiger,
>>
>> I use the workbench but even so the exceptions raised in
>> getToolTipText() are not handled and cause an HTTP 500.
>>
>> I tried to debug and compare the behavior between RAP and RCP on this.
>>
>> In both RCP and RAP the exceptions are catched in
>> org.eclipse.ui.internal.Workbench.runEventLoop(IExceptionHandler,
>> Display) and passed to the ExceptionHandler class for handling.
>>
>> ExceptionHandler itself simply throws exception inheriting ThreadDeath
>> and delegates the handling for other exceptions to
>> WorkbenchAdvisor.eventLoopException(Throwable).
>>
>> However in RAP RWTLifeCycle.continueLifeCycle() wraps the original
>> exception in a PhaseExecutionError (which extend ThreadDeath) before it
>> reaches the handler so the exception is not logged by ExceptionHandler
>> but it is instead re-thrown and handled at servlet level which cause the
>> HTTP 500.
>>
>> So there is a difference in behavior between RAP and RCP right?
>>
>> Regards,
>> -Seb

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: HTTP ERROR 500 when a table tooltip raises an exception [message #878981 is a reply to message #878486] Wed, 30 May 2012 09:55 Go to previous message
Sebastien Arod is currently offline Sebastien ArodFriend
Messages: 41
Registered: July 2009
Member
I created the bug and attached a small project reproducing the issue.
Bug 381004 - Exception raised by CellLabelProvider.getToolTipText(Object) are not handled by Workbench Exception Handler and cause an HTTP ERROR 500

Thanks and Regards,
-Seb
Previous Topic:get IHandlerService from background thread
Next Topic:ESC keybinding firing twice
Goto Forum:
  


Current Time: Thu Apr 18 12:52:02 GMT 2024

Powered by FUDForum. Page generated in 0.23646 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top