Bug 801824

Summary: Editing of undeployed portlets leads to multiple errors
Product: [JBoss] JBoss Enterprise Portal Platform 5 Reporter: Miroslav Cupák <mcupak>
Component: PortalAssignee: Default User <jbpapp-maint>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.2.1.ER01CC: epp-bugs, hfnukal, mcupak, tkyjovsk
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-06 11:39:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
NPE from the server log which appears after clicking "Edit Portlet" button.
none
NPE from the server log after saving the changes.
none
Error message appearing after finishing page editing.
none
Edit portlet dialog rendered on a different page.
none
Error message appearing when trying to save the changes. none

Description Miroslav Cupák 2012-03-09 15:22:32 UTC
Description of problem:
Attempt to edit a portlet on a page is not properly handled if the portlet is not deployed. Such an action leads to several exceptions and error messages.

Steps to Reproduce:
1. Deploy a portlet of your choice on your EPP instance (I used JSF RI portlet from the portletbridge directory).
2. Go to Group > Administration > Application Registry and import the portlet.
3. Add the portlet on a page.
4. Undeploy the portlet.
5. Go to that page again. You should see org.gatein.pc.api.NoSuchPortletException since the portlet is no longer available.
6. Go to Site Editor > Edit Page. You will see several "Could not find portlet" messages in the server log.
7. Click the pencil icon to edit your undeployed portlet. You will see the "Loading" dialog and NPE in the server log.
8. The dialog will be there for a while so just click "Abort".
9. Click the "Finish" button in the page editor to go back to your page. You will see an error dialog saying "Action process encountered an error".
10. Click "Ok".
11. If the "Edit portlet" dialog wasn't shown until now (i.e. you performed the steps quickly enough), it's still waiting to be rendered. Navigate to a page of your choice, e.g. Application Registry (or simply refresh the page you're on). You can see that the "Edit Portlet" dialog appears at this point.
12. The portlet can be edited now. Attempt to save the changes leads to another NPE and an error dialog with the "Unknown error" message.

Comment 1 Miroslav Cupák 2012-03-09 15:26:06 UTC
Created attachment 568938 [details]
NPE from the server log which appears after clicking "Edit Portlet" button.

Comment 2 Miroslav Cupák 2012-03-09 15:28:47 UTC
Created attachment 568939 [details]
NPE from the server log after saving the changes.

Comment 3 Miroslav Cupák 2012-03-09 15:31:49 UTC
Created attachment 568945 [details]
Error message appearing after finishing page editing.

Comment 4 Miroslav Cupák 2012-03-09 15:32:52 UTC
Created attachment 568946 [details]
Edit portlet dialog rendered on a different page.

Comment 5 Miroslav Cupák 2012-03-09 15:33:55 UTC
Created attachment 568947 [details]
Error message appearing when trying to save the changes.

Comment 6 Miroslav Cupák 2012-03-15 16:54:35 UTC
Compared with EPP 5.2.0.GA to determine if it's a regression and 5.2.0 responds to the error in a slightly different way:

Ad steps to reproduce:
1-6: The same result.
7: No dialog is shown, but you hit the NPE.
8+: Attempt at closing the page editor results in the following error:

ERROR [portal:PortalRequestHandler] Error while handling request
org.exoplatform.groovyscript.TemplateRuntimeException: Groovy template exception at DataText[pos=Position[col=1,line=58],data=                   String msgValue = mess.getMessage();] for template system:/groovy/webui/core/UIPopupMessages.gtmpl

...and no action in the UI happens, the only way to exit the editor is to save the changes. Having done that, you are back at the page with your portlet, but the portal is broken. Wherever you navigate, you get the following error:

ERROR [portal:PortalRequestHandler] Error while handling request
org.exoplatform.groovyscript.TemplateRuntimeException: Groovy template exception at DataText[pos=Position[col=14,line=25],data=uicomponent.renderChildren();] for template system:/groovy/portal/webui/workspace/UIPortalApplicationChildren.gtmpl

...and the portal styles and scripts are not loaded properly.