Bug 1082560

Summary: REST API - problems and exceptions when updating portal templates
Product: [JBoss] JBoss Enterprise Portal Platform 6 Reporter: mgottval <mgottval>
Component: PortalAssignee: Lucas Ponce <lponce>
Status: VERIFIED --- QA Contact: Tomas Kyjovsky <tkyjovsk>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bdawidow, epp-bugs, mvecera
Target Milestone: ER01   
Target Release: 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
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:
Embargoed:
Bug Depends On: 1083054    
Bug Blocks:    
Attachments:
Description Flags
portal.zip none

Description mgottval 2014-03-31 10:37:31 UTC
Created attachment 880675 [details]
portal.zip

Description of problem:

curl -i -H "Content-Type: application/zip" -u root:gtn -X PUT -T examples/portal.zip "http://localhost:8080/rest/private/managed-components/template/portal"

Running this command causes BufferOverflowException and portals are not updated:
java.nio.BufferOverflowException
	at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:357) [rt.jar:1.7.0_45]
	at org.apache.coyote.http11.InternalNioOutputBuffer.commit(InternalNioOutputBuffer.java:666) [jbossweb-7.4.0.Beta4.jar:7.4.0.Beta4]
	at org.apache.coyote.http11.Http11NioProcessor.commit(Http11NioProcessor.java:480) [jbossweb-7.4.0.Beta4.jar:7.4.0.Beta4]
....

Comment 2 Lucas Ponce 2014-03-31 12:17:34 UTC
It seems there is an issue in the NIO2 connector for EAP 6.3.0.

There is a workaround defined in the JIRA attached, is to change to JIO connector:

<subsystem xmlns="urn:jboss:domain:web:1.5" default-virtual-server="default-host" native="false">
<connector name="http" protocol="org.apache.coyote.http11.Http11Protocol" scheme="http" socket-binding="http"/>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
</subsystem>

Comment 3 mgottval 2014-04-01 08:40:55 UTC
I successfully did the workaround changing the connector. The exception is no longer present. But anyway running the command 
curl -i -H "Content-Type: application/zip" -u root:gtn -X PUT -T examples/portal.zip "http://localhost:8080/rest/private/managed-components/template/portal"

only the mobile portal is updated. Classic portal stays without any change.

Comment 4 Lucas Ponce 2014-04-01 10:08:32 UTC
There is a missing attribute in branding classic template.

I'm going to send a fix for it.

Meanwhile, there is a workaround:

In file:

jpp-portal-6.2/gatein/extensions/jpp-branding-extension.ear/jpp-branding-extension.war/WEB-INF/conf/portal/portal/classic/portal.xml

Add a

<properties>
...
<entry key="template">classic</entry>
</properties>

To indicate that "classic" site has been created from "classic" template.

Thanks for reporting.
Lucas

Comment 7 mgottval 2014-05-20 08:45:46 UTC
Verified in JPP 6.2.ER2.

Comment 8 JBoss JIRA Server 2014-06-13 12:25:10 UTC
Lucas Ponce <ponce.ballesteros> updated the status of jira GTNPORTAL-3435 to Resolved