Bug 1117813 - WSRP v1 - epp4.3 vs rhjp6.2.0 - Unknown error when importing applications in app registry
Summary: WSRP v1 - epp4.3 vs rhjp6.2.0 - Unknown error when importing applications in ...
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise Portal Platform 6
Classification: JBoss
Component: Portal
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER05
: 6.2.0
Assignee: Nobody
QA Contact: vramik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-09 12:43 UTC by vramik
Modified: 2021-11-14 22:29 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
stacktrace (21.80 KB, text/x-log)
2014-07-09 12:43 UTC, vramik
no flags Details
jboss-image-portlet-sample-remotable-JBoss-portal.war (206.39 KB, application/java-archive)
2014-07-09 12:44 UTC, vramik
no flags Details
logs for a successful run (77.03 KB, text/plain)
2014-07-09 14:21 UTC, Juraci Paixão Kröhling
no flags Details
jboss-image-portlet-sample-remotable-GateIn.war (204.32 KB, application/java-archive)
2014-07-10 09:14 UTC, vramik
no flags Details
proposed fix (72.86 KB, application/x-java-archive)
2014-07-11 07:23 UTC, Juraci Paixão Kröhling
no flags Details
proposed fix - updated (72.77 KB, application/x-java-archive)
2014-07-14 10:40 UTC, Juraci Paixão Kröhling
no flags Details
proposed fix - updated (72.97 KB, application/x-java-archive)
2014-07-14 14:08 UTC, Juraci Paixão Kröhling
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker GTNPORTAL-3519 0 Major Resolved "Import applications" fails when remote portlet name clashes with local portlet 2014-09-02 11:23:15 UTC

Description vramik 2014-07-09 12:43:24 UTC
Created attachment 916762 [details]
stacktrace

Description of problem: 
I get Unknown error dialog and exceptions in log when I try to import applications in application registry. I'm using jboss-epp-4.3 as producer and rhjp6.2.0.er04 as consumer (WSRP v1).

Version-Release number of selected component (if applicable):
jboss-epp-4.3.GA_CP07
rhjp6.2.0.er04

How reproducible:
always

Steps to Reproduce:
1. deploy jboss-image-portlet-sample-remotable-JBoss-portal.war (attached) to epp4.3 and start it
2. start rhjp6.2.0.er04
3. open rhjp and register new consumer using v1 wsdl (http://${host}:${port}/portal-wsrp/MarkupService?wsdl)
4. go to application registry
5. click import application

Actual results:
Unknown error dialog is shown, stacktrace in log (attached)

Additional info:
- this scenario works with er03
- my guess is that it is related to https://issues.jboss.org/browse/GTNPORTAL-3509

Comment 1 vramik 2014-07-09 12:44:51 UTC
Created attachment 916763 [details]
jboss-image-portlet-sample-remotable-JBoss-portal.war

Comment 4 Juraci Paixão Kröhling 2014-07-09 14:21:18 UTC
I couldn't reproduce this. I'm attaching the logs for ER4, from the startup till the step where I finished importing. 

My environment and the steps I did is as follows:

- Fedora 20
- Java 8 (should not matter)
- EPP 4.3.CP07 started on default port, production profile
- RHJP 6.2.0.ER4 started with port-offset 100, on the same machine
- Deployed the attached WAR file into EPP
- Started EPP
- Started RHJP
- On RHJP, added consumer "epp43" with URL http://localhost:8080/portal-wsrp/MarkupService?wsdl
- Application Registry - Import Applications

At the end of these steps, I don't see any exceptions on the log, and I get positive confirmation that the "image portlet sample" is imported (third to last line on the log):

16:11:03,669 INFO  [org.exoplatform.application.registry.impl.ApplicationRegistryServiceImpl] (http-/127.0.0.1:8180-2) Importing portlet (epp43,jboss-image-portlet-sample) in categories [epp43, epp43 Producer, remote]

I went a bit further and added this remote portlet to a page, and I indeed see the picture of some of the older guys there. 

It would be interesting to test it on other machines and/or on clean installations of both EPP and RHJP.

Comment 5 Juraci Paixão Kröhling 2014-07-09 14:21:46 UTC
Created attachment 916816 [details]
logs for a successful run

Comment 6 vramik 2014-07-10 09:14:07 UTC
Created attachment 917026 [details]
jboss-image-portlet-sample-remotable-GateIn.war

In the test scenario there is another portlet deployed in RHJP6.2.0 (jboss-image-portlet-sample-remotable-GateIn.war). The portlet causes the Unknown error. The portlet is almost the same as jboss-image-portlet-sample-remotable-JBoss-portal.war but there are some changes made for newer portal. 

- added org.gatein.pc.remotable into portlet.xml
- added jboss-portlet.xml

The problem is both portlets has the same <portlet-name> in portlet.xml. The thing is that in ER03 it worked even with the same names. 

So it is not probably a bug but expected change. Can you confirm, pls?

Comment 7 Juraci Paixão Kröhling 2014-07-10 09:34:43 UTC
From what I could gather based on the spec, it's legal to have the same portlet-name in different portlet applications. From the spec:

PLT.25.7 Uniqueness of Deployment Descriptor Values 
The following deployment descriptor values must be unique in the scope of the portlet application definition:
* portlet <portlet-name>
* ...

The item above has mentioned "portlet application", which is defined as:

A portlet application is a web application, as defined in Servlet Specification, SRV.9 Chapter, containing portlets and a portlet deployment descriptor in addition to servlets, JSPs, HTML pages, classes and other resources normally found in a web application.


I'll try to reproduce again based on the new information.

Comment 8 Juraci Paixão Kröhling 2014-07-10 17:51:37 UTC
854461feeb8bcf0eec54ef8a47fe2f02f5149966 is the first bad commit
commit 854461feeb8bcf0eec54ef8a47fe2f02f5149966
Author: Lucas Ponce <lponce>
Date:   Mon Jun 9 10:18:02 2014 +0200

    GTNPORTAL-3494 Fix for side effect in App Registry import-all

:040000 040000 9ec7b609dc7805b12aa14e0cd3ad5b80ee5d24f2 941201e1209aae3d63c9c28eef629f2846aea63c M	component

I'll be checking how this can be fixed, without breaking the intended fix for that commit.

Comment 9 Juraci Paixão Kröhling 2014-07-11 07:23:23 UTC
Created attachment 917259 [details]
proposed fix

I'm attaching a JAR with a proposed fix. This should replace the following file:

jboss-eap/modules/system/layers/gatein/org/gatein/lib/main/exo.portal.component.application-registry-*jar

Please, note that the following BZs might be affected: #1107566 and #1101275 , as well as the JIRA GTNPORTAL-3494 , so, a coordination with Petr and Tomas (the reporters of those issues) for re-testing of those issues is advised.

I've tested it locally on the scenario for this BZ, and it seems to work fine. I've also quickly tested for the related BZs, and couldn't reproduce any of them, so, I believe they are not badly affected.

Comment 10 Juraci Paixão Kröhling 2014-07-11 13:55:45 UTC
PR sent: https://github.com/gatein/gatein-portal/pull/887

Comment 11 Juraci Paixão Kröhling 2014-07-11 13:57:02 UTC
By the way, Petr Mensik confirmed that this change does *not* affect badly the related BZs (BZ#1107566 and BZ#1101275)

Comment 12 Juraci Paixão Kröhling 2014-07-14 10:40:23 UTC
Created attachment 917730 [details]
proposed fix - updated

I'm attaching a new proposed fix, that should avoid the problems discussed on the PR at github. 

I did a test here, and it seems to fix both this BZ and BZ#1107566, but *not* BZ#1101275 , as I believe that BZ#1101275 has a wrong premise (ie: the expected result for the name contains spaces, which are not allowed as per the validation rules).

Comment 13 mgottval 2014-07-14 13:21:53 UTC
I experienced similar problem, the same exception. I created a portal application with several portlets, deployed the .war file, then in pom.xml of the portal application changed the Artifact ID, build and deployed second .war (same content, just different name). I'm getting an Unknown Error and the IllegalArgumentException during "Import Applications".

Comment 14 Juraci Paixão Kröhling 2014-07-14 14:08:57 UTC
Created attachment 917877 [details]
proposed fix - updated

Yet another proposal, as mgottval got hit by the "first-30 chars clash" minutes after the last message, making me wonder if this wouldn't be a common clash after all.

After some discussion with ppalaga, I've added the hashCode for the contentId to the name, so, clashes are now very unlikely to happen.

Comment 15 Peter Palaga 2014-07-23 15:31:23 UTC
https://github.com/gatein/gatein-portal/pull/887 was merged in upstream


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