Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » text of processing error dialog
text of processing error dialog [message #1065081] Mon, 24 June 2013 09:36 Go to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 310
Registered: August 2011
Senior Member
Hi,

if there is an error on the server, I only get a dialog with the text "Text" and "Processing Error" although there is a lot of info generated at the server side.

How can I get more/better info at the client side when a Processing Eroor is thrown?

Regards Bertin

I know, Veto Excpetions give better info and Processing Errors should not occur, but even though they do. Sad
Re: text of processing error dialog [message #1065084 is a reply to message #1065081] Mon, 24 June 2013 09:41 Go to previous messageGo to next message
Ivan Motsch is currently offline Ivan MotschFriend
Messages: 100
Registered: March 2010
Senior Member
due to the OWASP security Guidelines there should be as few as possible Information disclosure from the Server out to the gui.
Therefore the method
DefaultTransactionDelegate.replaceOutboundException(Throwable t)

is responsible for doing that.

It is called by the gui-server communication channel at
ServiceTunnelServlet.runServerJobTransactionWithDelegate


This is the place where you can override and use your own servlet (subclass) with your own Transaction delegate (subclass) that does something more inside
replaceOutboundException
Re: text of processing error dialog [message #1065090 is a reply to message #1065084] Mon, 24 June 2013 10:36 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 821
Registered: October 2011
Senior Member
We have something like this (in TestTransactionDelegate extending DefaultTransactionDelegate):

@Override
protected Throwable replaceOutboundException(Throwable t) {
  ProcessingException cause = null;
  if (t instanceof ProcessingException) {
    cause = (ProcessingException) t;
  }
  if (cause != null) {
    ProcessingException construct = new ProcessingException(cause.getMessage() + cause.getCause());
    construct.setStatus(cause.getStatus());
    StackTraceElement stack = cause.getStackTrace()[0];
    construct.setStackTrace(new StackTraceElement[]{stack});

    return construct;
  }
  return t;
}

Re: text of processing error dialog [message #1065576 is a reply to message #1065090] Wed, 26 June 2013 14:37 Go to previous messageGo to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 346
Registered: October 2012
Location: Bern, Switzerland
Senior Member
How can I get ServiceTunnelServlet to use this new Delegate class? Do I need to also extend it and register this new class for /process and /ajax? Or is there an easier way?
Re: text of processing error dialog [message #1065666 is a reply to message #1065576] Thu, 27 June 2013 05:30 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 821
Registered: October 2011
Senior Member
Hi,

In my project, we use it for tests and we have registered a new servlet. "/testprocess". I imagine there are other possibilities. We do not use this test servlet in production.

You need a an other TestServiceTunnelServlet extends ServiceTunnelServlet with:
  @Override
  protected ServiceTunnelResponse runServerJobTransactionWithDelegate(ServiceTunnelRequest req, Bundle[] loaderBundles, Version requestMinVersion, boolean debug) throws Exception {
    return new TestTransactionDelegate(loaderBundles, requestMinVersion, debug).invoke(req);
  }


and in the plugin.xml or fragment.xml (that is only deployed for tests).
   <extension
         point="org.eclipse.equinox.http.registry.servlets">
      <servlet
            alias="/testprocess"
            class="<absolute path to>.TestServiceTunnelServlet">
      </servlet>
   </extension>


The "/process" servlet already follows the rule defined in Bug 410328 (Service registrations & Servlet Filter should be registred in your scout application and not in the scout RT). So you can do what you want, and use you own class instead of the default org.eclipse.scout.rt.server.ServiceTunnelServlet registered by default in your applciation.
Re: text of processing error dialog [message #1065674 is a reply to message #1065666] Thu, 27 June 2013 06:04 Go to previous message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 346
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Perfect, I can now see the server exceptions in the client of my sandbox application.

For obvious reasons I won't be adding that to our productive application!
Previous Topic:Spinner field
Next Topic:Listen for changes of the checked state in the embedded table of an AbstractTableField
Goto Forum:
  


Current Time: Mon Dec 22 23:36:07 GMT 2014

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

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