Bug 973716 - There is a bug in Gatein-Portal code of UIPortletActionListener class.
Summary: There is a bug in Gatein-Portal code of UIPortletActionListener class.
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise Portal Platform 6
Classification: JBoss
Component: Portal
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER02
: 6.1.0
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-12 14:39 UTC by indrajit
Modified: 2023-02-27 08:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker GTNPORTAL-3122 0 Major Resolved Errors are not handled correctly in UIPortletActionListener.handleErrorResponse 2017-03-06 13:22:08 UTC

Description indrajit 2013-06-12 14:39:28 UTC
Gatein-Portal code bug which is causing the following error:

++++++++++++++++++++++++
11:22:01,452 ERROR [portal:UIPortletLifecycle] (http-/127.0.0.1:8080-1) Error processing the action: java.lang.NoClassDefFoundError cannot be cast to java.lang.Exception: java.lang.ClassCastException: java.lang.NoClassDefFoundError cannot be cast to java.lang.Exception
	at org.exoplatform.portal.webui.application.UIPortletActionListener$ProcessActionActionListener.handleErrorResponse(UIPortletActionListener.java:241) [exo.portal.webui.portal-3.5.2.Final-redhat-4.jar:3.5.2.Final-redhat-4]
	at org.exoplatform.portal.webui.application.UIPortletActionListener$ProcessActionActionListener.execute(UIPortletActionListener.java:140) [exo.portal.webui.portal-3.5.2.Final-redhat-4.jar:3.5.2.Final-redhat-4]
	at org.exoplatform.webui.event.Event.broadcast(Event.java:97) [exo.portal.webui.framework-3.5.2.Final-redhat-4.jar:3.5.2.Final-redhat-4]
+++++++++++++++++++++++++



Notice the class [1] where the method is trying to cast the (Throwable) object into an Exception.. as in runtime it can be any thing like Error/Exception so everything Should *not* be  casted to Exception.


_+++++++++++++++ Notice following Method +++++++++++++++_
        private void handleErrorResponse(ErrorResponse response) throws Exception {
            throw (Exception) response.getCause();
        }


Which means suppose if the [response.getCause()] returns NoClassDefFoundError (rather than an Exception) then definitely it can not be Casted to an Exception.




[1] https://github.com/gatein/gatein-portal/blob/master/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java

Comment 1 JBoss JIRA Server 2013-06-14 10:34:01 UTC
Martin Weiler <mweiler> made a comment on jira GTNPORTAL-3122

Attaching a reproducer for this issue. The portlet is calling a helper class in processAction method. This helper class is using MVEL to evaluate an expression. The mvel libraries are not being included into the build, to force the NoClassDefFoundError at runtime.

Without the fix, the NoClassDefFoundError is masked by the ClassCastException, thus giving no clue that the missing mvel library is the actual root cause.

Comment 2 Lucas Ponce 2013-06-17 14:05:51 UTC
PR sent by Martin discussed and verified.

Comment 4 Dominik Pospisil 2013-08-01 12:34:58 UTC
Verified on ER3 using the reproducer from GTNPORTAL-3122.


Note You need to log in before you can comment on or make changes to this bug.