Bug 1059036 - Portlet in Dashboard is broken for the first access
Summary: Portlet in Dashboard is broken for the first access
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: JBoss Enterprise Portal Platform 6
Classification: JBoss
Component: Portal
Version: 6.1.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER03
: 6.2.0
Assignee: Nobody
QA Contact: Tomas Kyjovsky
URL:
Whiteboard: 6_2 Triage
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-29 03:18 UTC by Toshiya Kobayashi
Modified: 2025-02-10 03:34 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
: 1059053 (view as bug list)
Environment:
Last Closed: 2025-02-10 03:34:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
dashboard_issue_01.png (104.63 KB, image/png)
2014-01-29 03:19 UTC, Toshiya Kobayashi
no flags Details
dashboard_issue_02.png (120.81 KB, image/png)
2014-01-29 03:20 UTC, Toshiya Kobayashi
no flags Details
debugger log 6.2.0.ER3 (4.26 KB, text/x-log)
2014-06-13 14:10 UTC, Tomas Kyjovsky
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker GTNPORTAL-3497 0 Major Closed Portlet in Dashboard is broken for the first access 2015-07-27 00:24:40 UTC

Description Toshiya Kobayashi 2014-01-29 03:18:14 UTC
Description of problem:

If you configure a richfaces portlet in dashboard template, the portlet may break for the first access by a newly created user.

Version-Release number of selected component (if applicable):

6.1.1.ER01

How reproducible:

Not always (once in a few tries). You can constantly reproduce it by using debugger.

Steps to Reproduce:

[easy test]

1. Build and deploy jsf2-rf4-hello-world-portlet quickstart
2. Edit gatein/gatein.ear/portal.war/WEB-INF/conf/portal/user/template/user/pages.xml

<page-set
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_5 http://www.gatein.org/xml/ns/gatein_objects_1_5"
    xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_5">

  <!-- The default dashboard page -->
  <page>
    <name>Tab_Default</name>
    <title>Tab_Default</title>
    <portlet-application>
      <portlet>
        <application-ref>jsf2-rf4-hello-world-portlet</application-ref>
        <portlet-ref>jsf2Rf4HelloWorldPortlet</portlet-ref>
        <preferences/>
      </portlet>
      <access-permissions>Everyone</access-permissions>
      <show-info-bar>false</show-info-bar>
      <show-application-state>true</show-application-state>
    </portlet-application>
  </page>

</page-set>

3. Start JPP
4. Login as root
5. [Application Registry]->[Import applications]
6. Create a user (e.g. john)
7. Logout
8. Login as john
9. Access to Dashboard

Actual results:

- You will see the following ERROR message in server side

11:15:18,639 ERROR [exo.jcr.component.core.JDBCStorageConnection] (http-/127.0.0.1:8080-5) Node add. Database error: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "JCR_IDX_IPSYSTEM_PARENT ON PUBLIC.JCR_IPSYSTEM(PARENT_ID, NAME, I_INDEX, I_CLASS, VERSION DESC)"; SQL statement:
insert into JCR_IPSYSTEM (ID, PARENT_ID, NAME, VERSION, I_CLASS, I_INDEX, N_ORDER_NUM) VALUES(?,?,?,?,1,?,?) [23505-168]

or

12:01:40,837 ERROR [org.exoplatform.portal.config.NewPortalConfigListener] (http-/127.0.0.1:8080-4) An Exception occured when creating the Portal Configuration. Exception message: Attempt to insert context EntityContext[state=ObjectStatus[status=TRANSIENT],mapper=EntityMapper[class=class org.gatein.mop.core.api.workspace.UserSite,typeName=mop:usersite]] as an existing child with name mop:cccc child of node /production/mop:workspace/mop:usersites: org.chromattic.api.DuplicateNameException: Attempt to insert context EntityContext[state=ObjectStatus[status=TRANSIENT],mapper=EntityMapper[class=class org.gatein.mop.core.api.workspace.UserSite,typeName=mop:usersite]] as an existing child with name mop:cccc child of node /production/mop:workspace/mop:usersites


- You will see that a select box is broken in the portlet (See dashboard_issue_01.png)
- If you refresh the browser, the portlet will be recovered but then you will see a popup "This portlet does not exist anymore, please refresh your browser" (See dashboard_issue_02.png). Kinda weird.

Expected results:

Dashboard and its portlet are displayed without an issue

Additional info:

[test with a debugger]

After step 8 in "Steps to Reproduce:",

- Set breakpoints at:
-- org.exoplatform.portal.application.PortalRequestHandler [line: 217] - processRequest(PortalRequestContext, PortalApplication)	
-- org.exoplatform.portal.application.UserSiteLifeCycle [line: 68] - onStartRequest(Application, PortalRequestContext)	
- Access to Dashboard
- The first request (Thread A) stops at UserSiteLifeCycle line 68. DataStorage cannot find PortalConfig so UserPortalConfigService.createUserSite() is called. It should persist the PortalConfig to JCR but *it's not committed yet*.
- Resume Thread A with debugger
- Thread A stops at PortalRequestHandler line 217. Portal responded to browser but JCR is not committed yet.
- Several requests (Thread B, C,...) from browser come into UserSiteLifeCycle line 68. Then "Step Over" Thread B to proceed 1 line. DataStorage cannot find PortalConfig yet and returns null so UserPortalConfigService.createUserSite() will be called.
- Resume Thread A with debugger
- Turn off all breakpoints
- Resume all threads with debugger

Comment 1 Toshiya Kobayashi 2014-01-29 03:19:30 UTC
Created attachment 856908 [details]
dashboard_issue_01.png

Comment 2 Toshiya Kobayashi 2014-01-29 03:20:02 UTC
Created attachment 856909 [details]
dashboard_issue_02.png

Comment 3 Toshiya Kobayashi 2014-01-29 03:32:51 UTC
As I explained in "Additional info:", the root problem seems that Portal responds to browsers before JCR commit. To fix this particular issue, delaying (or letting wait for a lock) the subsequent threads would help.

Richfaces is not a mandatory condition but it sends multiple accesses for the first access so it's convenient to reproduce.

Thanks to https://issues.jboss.org/browse/GTNPORTAL-2072 , we don't see NoSuchDataException in RHJP 6.1.1.ER01 but still have this issue.

Comment 5 Juraci Paixão Kröhling 2014-05-27 10:07:19 UTC
As I still cannot reproduce, nor QA, I sent a patched JAR to Toshiya by email, to see if this fixes the issue. If so, I'll send a PR with the change, which is a similar solution as for BZ 1080249 .

Comment 6 Juraci Paixão Kröhling 2014-05-28 08:47:25 UTC
PR sent, as Toshiya confirmed that the fix seems to work: https://github.com/gatein/gatein-portal/pull/866

Comment 7 Peter Palaga 2014-06-02 13:29:15 UTC
https://github.com/gatein/gatein-portal/pull/866 was merged in upstream

Comment 8 Tomas Kyjovsky 2014-06-13 14:09:55 UTC
I couldn't reproduce the issue on 6.1.1.ER1 or 6.2.0.ER3 with or without debugger.

Comment 9 Tomas Kyjovsky 2014-06-13 14:10:58 UTC
Created attachment 908593 [details]
debugger log 6.2.0.ER3

Comment 10 JBoss JIRA Server 2015-07-24 09:13:56 UTC
Juraci Paixão Kröhling <jpkroehling> updated the status of jira GTNPORTAL-3497 to Closed

Comment 14 Red Hat Bugzilla 2025-02-10 03:34:57 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.


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