Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1080249 - RichFaces is not defined after adding a RF portlet to a page
RichFaces is not defined after adding a RF portlet to a page
Status: VERIFIED
Product: JBoss Enterprise Portal Platform 6
Classification: JBoss
Component: Portal (Show other bugs)
6.1.1
Unspecified Unspecified
unspecified Severity high
: ER03
: 6.2.0
Assigned To: Lucas Ponce
Marek Baluch
:
Depends On:
Blocks: 1080254
  Show dependency treegraph
 
Reported: 2014-03-24 23:12 EDT by Toshiya Kobayashi
Modified: 2015-08-03 03:52 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
An issue with PortalComposer sending responses before the JCR was fully committed caused the global layout to malfunction. This presented on pages where mark-up contained references to portlet resources, and the request to the JCR asked for resources not yet in the repository. The fix flushes the JCR elements in PortalComposer, which allow portlets with resource IDs on mark-up to display correctly.
Story Points: ---
Clone Of:
: 1080254 (view as bug list)
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)
RichFaces_is_not_defined.png (295.27 KB, image/png)
2014-03-24 23:14 EDT, Toshiya Kobayashi
no flags Details
620DR2_after_edit.png (123.63 KB, image/png)
2014-04-03 06:15 EDT, Toshiya Kobayashi
no flags Details
620DR2_after_edit_and_goto_home.png (430.21 KB, image/png)
2014-04-03 06:15 EDT, Toshiya Kobayashi
no flags Details
slowDB.rule (209 bytes, text/plain)
2014-04-30 02:12 EDT, Toshiya Kobayashi
no flags Details
jsf2-rf4-hello-world-portlet.war (8.11 MB, application/x-webarchive)
2014-04-30 02:13 EDT, Toshiya Kobayashi
no flags Details
step8exceptions.log (109.99 KB, text/x-log)
2014-04-30 04:14 EDT, vramik
no flags Details
standalone.xml (17.46 KB, text/xml)
2014-04-30 06:19 EDT, vramik
no flags Details
620ER2_after_edit.png (119.09 KB, image/png)
2014-05-14 05:12 EDT, Toshiya Kobayashi
no flags Details
620ER2_after_edit_and_goto_home.png (429.31 KB, image/png)
2014-05-14 05:14 EDT, Toshiya Kobayashi
no flags Details
RichFaces portlet normal request and response (119.70 KB, image/png)
2014-05-14 11:46 EDT, Lucas Ponce
no flags Details
RichFaces portlet bad request and response (byteman slow DB) (129.76 KB, image/png)
2014-05-14 11:47 EDT, Lucas Ponce
no flags Details
Thread trace in byteman slowDB scenario (6.48 KB, text/x-log)
2014-05-15 14:12 EDT, Lucas Ponce
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker GTNPORTAL-2581 Major Open RichFaces is not defined after adding a RF portlet to a page 2017-10-24 05:22 EDT
JBoss Issue Tracker GTNPORTAL-3484 Major Resolved Commit changes for a page before send response 2017-10-24 05:22 EDT

  None (edit)
Description Toshiya Kobayashi 2014-03-24 23:12:29 EDT
Description of problem:

Platform BZ for https://issues.jboss.org/browse/GTNPORTAL-2581

How reproducible:

Not always. A debugger helps to reproduce the issue constantly.


Steps to Reproduce:
1. Build and deploy jsf2-rf4-hello-world-portlet quickstart.
2. Import jsf2-rf4-hello-world-portlet via Application Registry
3. Add an empty page ([Site Editor]->[Add New Page])
4. Edit the page ([Site Editor]->[Edit Page])
5. Drag&Drop jsf2-rf4-hello-world-portlet
6. Attach a debugger and set a breakpoint at PortalRequestHandler.java line.237.
====
234         } finally {
235 
236             // We close the writer here once and for all
237             Safe.close(context.getWriter());
238 
239             //
240             try {
241                 for (ApplicationLifecycle lifecycle : lifecycles)
242                     lifecycle.onEndRequest(app, context);
243             } catch (Exception exception) {
====
7. Click save icon in portal
8. Debugger stops at PortalRequestHandler line.237.
9. Disable the breakpoint and 'step over' the execution in debugger
10. Then 'resume' the debugger


Actual results:

The browser displays a pop-up "RichFaces is not defined". See attached "RichFaces_is_not_defined.png"

Expected results:

The page is properly rendered with the portlet
Comment 1 Toshiya Kobayashi 2014-03-24 23:14:16 EDT
Created attachment 878296 [details]
RichFaces_is_not_defined.png
Comment 2 Toshiya Kobayashi 2014-03-24 23:18:31 EDT
The issue is similar to BZ1059036. I wonder which is the problem --- "the architecture which responds before commit" or "ajaxRequest=true".
Comment 3 Toshiya Kobayashi 2014-04-03 06:14:37 EDT
Testing with 6.2.0.DR2, I see the phenomenon is different.

Actual results:

The browser doesn't display a pop-up "RichFaces is not defined".

But the portlet appearance is broken. See attached "620DR2_after_edit.png".

Then I move to home page by clicking navigation, a pop-up is raised with a message "This portlet does not exist anymore, please refresh your browser". See attached "620DR2_after_edit_and_goto_home.png".
Comment 4 Toshiya Kobayashi 2014-04-03 06:15:20 EDT
Created attachment 882208 [details]
620DR2_after_edit.png
Comment 5 Toshiya Kobayashi 2014-04-03 06:15:50 EDT
Created attachment 882209 [details]
620DR2_after_edit_and_goto_home.png
Comment 6 Toshiya Kobayashi 2014-04-03 06:21:47 EDT
Note: I set a breakpoint at PortalRequestHandler line.255 for 6.2.0.DR2. Other steps are the same.
Comment 7 Juraci Paixão Kröhling 2014-04-03 13:50:39 EDT
Unfortunately, I'm still unable to reproduce this issue. I've tried with 6.1.1, master and 6.2.0.DR2, without success. I've requested assistance from QA, so that they can also try to reproduce this issue. It would also be interesting to see if you can reproduce this issue on Fedora 20 with all updates.
Comment 8 vramik 2014-04-08 10:04:17 EDT
Hi,

I was not able to reproduce it as well. After resuming the debugger everything works as expected. None of the described issues happened in my environment.
Comment 10 Toshiya Kobayashi 2014-04-09 05:48:23 EDT
Reproduced the issue in RHJP 6.1.1 by my colleague. So far the environments we have reproduced are:

Fedora 17 / Oracle JDK 1.7.0_45 / Firefox 21
Fedora 17 / Oracle JDK 1.7.0_45 / Chrome 24
Fedora 20 / Oracle JDK 1.6.0_45 / Firefox 28
Fedora 20 / OpenJDK 1.7.0_51  / Firefox 28

I think the problem is not environment but steps:

=====
8. Debugger stops at PortalRequestHandler line.237. (Safe.close(context.getWriter());)

 -> This means stopping before responding to browser

9. Disable the breakpoint and 'step over' the execution in debugger

 -> By 'step over', the thread proceeds *1 line* so it responds to the browser then some http requests will come in before JCR commit. Need to make sure to disable the breakpoint for the subsequent threads not to stop.

10. Then 'resume' the debugger
=====

Does the above explanation meet the steps you executed?
Comment 16 Toshiya Kobayashi 2014-04-30 02:12:12 EDT
Created attachment 891016 [details]
slowDB.rule
Comment 17 Toshiya Kobayashi 2014-04-30 02:13:38 EDT
Created attachment 891017 [details]
jsf2-rf4-hello-world-portlet.war
Comment 18 Toshiya Kobayashi 2014-04-30 02:21:01 EDT
Here is another reproduce step which is easier.

1. Start RHJP 6.1.1
2. Build and deploy jsf2-rf4-hello-world-portlet quickstart.
3. Import jsf2-rf4-hello-world-portlet via Application Registry
4. Add an empty page ([Site Editor]->[Add New Page]) *** It's important to "Add an empty page and then edit the page" ***
5. Edit the page ([Site Editor]->[Edit Page])
6. Drag&Drop jsf2-rf4-hello-world-portlet
7. Apply Byteman and submit slowDB.rule.
 - bin/bminstall.sh <jboss_pid>
 - bin/bmsubmit.sh -l slowDB.rule
8. Click Finish icon in portal
 -> You will see lots of "sleeping 100ms" log in STDOUT
 -> You will finally see a pop-up "RichFaces is not defined"

I attached slowDB.rule and jsf2-rf4-hello-world-portlet.war.

slowDB.rule is just emulating slow database so it will result in 'Subsequent http accesses come in before JCR commit'.

Vlasta, could you please try this with RHJP 6.1.1? If QE cannot reproduce the issue with released version (6.1.1), this BZ cannot go forward.

Thanks!
Toshiya
Comment 19 vramik 2014-04-30 04:14:42 EDT
Created attachment 891065 [details]
step8exceptions.log

Hi *,

I've followed the another steps and I got some exceptions in log in step 8 (attaching), but I was not able to see the "RichFaces is not defined" pop-up in my env.
Comment 20 Toshiya Kobayashi 2014-04-30 05:47:14 EDT
Hmm, I tried various sleep time but cannot reproduce the lock timeout on my side.

Could you attach your standalone.xml?

Also please give it one more try with 50ms sleep by editing slowDB.rule?

Thanks!
Comment 21 vramik 2014-04-30 06:19:35 EDT
Created attachment 891099 [details]
standalone.xml

I've tried 50ms, but I got lock timeout anyway. Attaching standalone.xml
Comment 23 Toshiya Kobayashi 2014-04-30 23:33:14 EDT
Thanks Vlasta,

I have no idea why it's not reproducible on your side. I will just test when ER2 is out.
Comment 24 Toshiya Kobayashi 2014-05-14 05:12:37 EDT
Created attachment 895413 [details]
620ER2_after_edit.png
Comment 25 Toshiya Kobayashi 2014-05-14 05:14:04 EDT
Created attachment 895415 [details]
620ER2_after_edit_and_goto_home.png
Comment 26 Toshiya Kobayashi 2014-05-14 05:15:19 EDT
I tested with 6.2.0.ER2 and reproduced the issue. The result was the same as DR2. Attached screenshots (620ER2_after_edit.png / 620ER2_after_edit_and_goto_home.png).
Comment 30 Lucas Ponce 2014-05-14 11:46:14 EDT
Created attachment 895528 [details]
RichFaces portlet normal request and response
Comment 31 Lucas Ponce 2014-05-14 11:47:13 EDT
Created attachment 895529 [details]
RichFaces portlet bad request and response (byteman slow DB)
Comment 35 Lucas Ponce 2014-05-15 14:12:30 EDT
Created attachment 896038 [details]
Thread trace in byteman slowDB scenario
Comment 37 Lucas Ponce 2014-05-20 04:57:24 EDT
Fix send to master and 3.8.x branches.
Comment 39 Peter Palaga 2014-05-27 08:42:57 EDT
https://github.com/gatein/gatein-portal/pull/856 was merged in upstream
Comment 43 Petr Mensik 2014-06-17 04:50:57 EDT
I was able to perform testing with Byteman without any issues so I consider this resolved.

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