0 Replies Latest reply on Jul 12, 2011 6:03 AM by christoph.hennes

    Exception source in PortletExceptionHandleService

    christoph.hennes

      Hello,

       

      I have a question about the Gatein PortletExceptionHandleService (EPP 5.1).

       

      This handler is called for example with a NullPointerException if a WSRP remote producer is not available directly after Consumer start and the portlet page is called:

      ...

      at org.exoplatform.portal.webui.application.UIPortlet.supportsPublicParam(UIPortlet.java:573)

      at org.exoplatform.portal.webui.application.UIPortlet.getPublicParameters(UIPortlet.java:691)

      at org.exoplatform.portal.webui.application.UIPortlet.create(UIPortlet.java:722)

      at org.exoplatform.portal.webui.application.UIPortletLifecycle.processRender(UIPortletLifecycle.java:186)

       

      We want to react to this error by using our own PortletExceptionListener. This works, our listener is called, but unfortunately, the information passed as parameter to the listener interface method contains only the exception (e.g. the NPE). In our case for example, we would like to know, if the error occured on a remote portlet. This information would be available in the caller of the error listener ((inside the UIPortlet instance, see below) and could be passed to the error handler service as parameter.

       

      My question is, if it would be possible, to add the current uicomponent (e.g. UIPortlet)  to error listener interface PortletExceptionListener method, so that we could query this object?

       

      One usage of PortletExceptionHandleService in Gatein code:

       

      UIPortletLifecycle:

      ...

      catch (Exception e)

       

            {

       

               PortletContainerException pcException = new PortletContainerException(e);

       

               PortletExceptionHandleService portletExceptionService = uicomponent.getApplicationComponent(PortletExceptionHandleService.class);

       

               if (portletExceptionService != null)

       

               {

       

                  portletExceptionService.handle(pcException); <--- Enhancement: pass uicomponent as additional parameter

       

               }

       

      Best regards,

      Christoph