Bug 1006492

Summary: Export/Import gadget doesn't work in a custom portal container
Product: [JBoss] JBoss Enterprise Portal Platform 6 Reporter: William Antônio <wsiqueir>
Component: PortalAssignee: Peter Palaga <ppalaga>
Status: VERIFIED --- QA Contact: Tomas Kyjovsky <tkyjovsk>
Severity: unspecified Docs Contact:
Priority: high    
Version: 6.0.0CC: bdawidow, epp-bugs, jpallich
Target Milestone: DR01   
Target Release: 6.1.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
A suspected issue with the Export/Import gadget caused a Javascript alert with the text "Failed to load sites available for export. See server log for more details.". This issue was not reproducible in this release, therefore the underlying issue has been addressed in another related code fix.
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: --- Target Upstream Version:

Description William Antônio 2013-09-10 17:39:10 UTC
Description of problem:

When accessing the Export/Import gadget from a custom portal container and a Javascript alert with the error message "Failed to load sites available for export. See server log for more details." should appear. In the logs we can see the following error:

ERROR [org.gatein.management.gadget.mop.exportimport.server.IdentityFilter] (http-/127.0.0.1:8080-5) Conversation state not found. This typically means the GWT Gadget application is either being access anonymously or from outside the portal.


How reproducible:

Easy to reproduce using the quickstarts

Steps to Reproduce:
1. Deploy the sample-portal container in JPP 6.0
2. Access the new container and log in as root
3. Access the site Export/Import gadget in URI /g/:platform:administrators/administration/siteExportImport

Actual results:

A Javascript alert with the error message "Failed to load sites available for export. See server log for more details." will appear. In the logs we can see the following error:

Expected results:

Gadget working and able to export/import sites.

Additional info:

It starts with a 401 in gwtGadgets/exportimport/GateInService

Request URL:http://localhost:8080/gwtGadgets/exportimport/GateInService
Request Method:POST
Status Code:401 Unauthorized 

Which is causing this is the servlet filter in [1]. It's is set in file [2]. Seems that A ConversationState isn't being created for this container.

[1] https://fisheye.exoplatform.org/browse/gatein-portal/gadgets/gwtGadgets/src/main/java/org/gatein/management/gadget/mop/exportimport/server/IdentityFilter.java?r=6d4f317a757437a77343db50339200de94e5fc8d

       ConversationRegistry conversationRegistry =
               (ConversationRegistry) container.getComponentInstanceOfType(ConversationRegistry.class);
 
       ConversationState state = conversationRegistry.getState(stateKey);
       if (state == null) {
           log.error("Conversation state not found. This typically means the GWT Gadget application is either being access anonymously or from outside the portal.");
           handleError(httpRequest, httpResponse, 401);
           return;
       }

[2] gwtGadgets.war/WEB-INF/web.xml

  <!-- Important to ensure secure access to the gadget -->
  <filter>
    <filter-name>IdentityFilter</filter-name>
    <filter-class>org.gatein.management.gadget.mop.exportimport.server.IdentityFilter</filter-class>
    <!-- Allows users with the specific role to access the gadget -->
    <init-param>
      <param-name>role</param-name>
      <param-value>administrators</param-value>
    </init-param>
    <!-- Uncomment to allow members of the following group access to gadget. -->
    <!--<init-param>
      <param-name>group</param-name>
      <param-value>/platform/administrators</param-value>
    </init-param>-->
    <!-- Uncomment to allow a specific user access to gadget. -->
    <!--<init-param>
      <param-name>user</param-name>
      <param-value>root</param-value>
    </init-param>-->

Comment 2 Peter Palaga 2013-11-26 18:58:45 UTC
siteExportImport does not exist in JPP 6.1 anymore and was replaced by /g/:platform:administrators/administration/siteRedirects. I cannot reproduce this with siteRedirects.

Comment 3 Peter Palaga 2013-11-27 08:42:43 UTC
As noticed by Bolek, the Export/Import gadget is still there in JPP 6.1 although it is not placed in any page by default. I tried to place it on a random page e.g. /sample-portal/classic/home but I have nort experienced the reported problems.

Steps to Reproduce:
1. Deploy the sample-portal container in JPP 6.0
2. Access the new container and log in as root
3. Import Applications in Group > Administration > Application Registry
4. Edit the /sample-portal/classic/home page, add Export/Import gadget to it, save
5. Access /sample-portal/classic/home where everything works as expected in the Export/Import gadget

Comment 4 Peter Palaga 2013-11-27 09:54:01 UTC
A correction of comment #3:

The issue is reproducible on JPP 6.1.0 GA using steps named in comment #3. 

It is not reproducible on the upcoming JPP 6.1.1 DR1.

Comment 5 Filip Kiss 2013-12-17 10:36:03 UTC
I wasn't able to reproduce this issue on 6.1.0.GA and 6.1.1.DR1.