Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » text of processing error dialog
text of processing error dialog [message #1065081] Mon, 24 June 2013 05:36 Go to next message
Eclipse UserFriend
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 05:41 Go to previous messageGo to next message
Eclipse UserFriend
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 06:36 Go to previous messageGo to next message
Eclipse UserFriend
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 10:37 Go to previous messageGo to next message
Eclipse UserFriend
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 01:30 Go to previous messageGo to next message
Eclipse UserFriend
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 02:04 Go to previous message
Eclipse UserFriend
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: Sat Jul 05 16:29:23 EDT 2025

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

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

Back to the top