Bug 973716 - There is a bug in Gatein-Portal code of UIPortletActionListener class.
There is a bug in Gatein-Portal code of UIPortletActionListener class.
Status: VERIFIED
Product: JBoss Enterprise Portal Platform 6
Classification: JBoss
Component: Portal (Show other bugs)
6.0.0
Unspecified Unspecified
unspecified Severity unspecified
: ER02
: 6.1.0
Assigned To: Default User
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-12 10:39 EDT by indrajit
Modified: 2013-11-04 19:56 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker GTNPORTAL-3122 Major Resolved Errors are not handled correctly in UIPortletActionListener.handleErrorResponse 2017-03-06 08:22 EST

  None (edit)
Description indrajit 2013-06-12 10:39:28 EDT
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 06:34:01 EDT
Martin Weiler <mweiler@redhat.com> 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 10:05:51 EDT
PR sent by Martin discussed and verified.
Comment 4 Dominik Pospisil 2013-08-01 08:34:58 EDT
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.