Author: thomas.heute(a)jboss.com
Date: 2010-04-01 07:44:43 -0400 (Thu, 01 Apr 2010)
New Revision: 2448
Modified:
portal/branches/EPP_5_0_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
Log:
JBEPP-253: Incorrect exception handling thrown by a portlet during invocation
Modified:
portal/branches/EPP_5_0_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
===================================================================
---
portal/branches/EPP_5_0_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2010-04-01
11:33:36 UTC (rev 2447)
+++
portal/branches/EPP_5_0_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2010-04-01
11:44:43 UTC (rev 2448)
@@ -287,11 +287,16 @@
+ "]. Expected a FragmentResponse or an
ErrorResponse");
}
- PortletExceptionHandleService portletExceptionService =
- (PortletExceptionHandleService)container
-
.getComponentInstanceOfType(PortletExceptionHandleService.class);
- portletExceptionService.handle(pcException);
+ //
+ PortletExceptionHandleService portletExceptionService =
uicomponent.getApplicationComponent(PortletExceptionHandleService.class);
+ if (portletExceptionService != null)
+ {
+ portletExceptionService.handle(pcException);
+ }
+ // Log the error
+ log.error("Portlet render threw an exception",
pcException);
+
markup =
Text.create(context.getApplicationResourceBundle().getString("UIPortlet.message.RuntimeError"));
}
}
@@ -301,17 +306,16 @@
catch (Exception e)
{
PortletContainerException pcException = new PortletContainerException(e);
- PortletExceptionHandleService portletExceptionService =
-
(PortletExceptionHandleService)container.getComponentInstanceOfType(PortletExceptionHandleService.class);
+ PortletExceptionHandleService portletExceptionService =
uicomponent.getApplicationComponent(PortletExceptionHandleService.class);
if (portletExceptionService != null)
{
- portletExceptionService.handle(pcException);
+ portletExceptionService.handle(pcException);
}
- else
- {
- log.warn("Could not find the PortletExceptionHandleService in the exo
container");
- }
+ // Log the error
+ log.error("Portlet render threw an exception", pcException);
+
+ //
markup =
Text.create(context.getApplicationResourceBundle().getString("UIPortlet.message.RuntimeError"));
}
Show replies by date