Bug 832012

Summary: Export of portal site with large number of pages and nodes fails with java.lang.StringIndexOutOfBoundsException
Product: [JBoss] JBoss Enterprise Portal Platform 5 Reporter: Martin Weiler <mweiler>
Component: PortalAssignee: Nick Scavelli <nscavell>
Status: CLOSED WONTFIX QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.2.1.GACC: dingham, epp-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-21 17:52:22 UTC 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:

Description Martin Weiler 2012-06-14 09:50:41 UTC
Description of problem:
Export of portal site with large number of pages and nodes fails with java.lang.StringIndexOutOfBoundsException


How reproducible:
Always

Steps to Reproduce:
1. Download attached gatein.zip, which contains the hypersonic database files with a large portal 
2. Unzip gatein.zip inside $EPP_HOME/jboss-as/server/$CONF/data
3. Deploy gatein-management-cli.war
4. Start the server instance, connect with crash
5. cd to portalsites and export the classic portal
  
Actual results:
Export fails with:

ERROR [org.crsh.shell.impl.CRaSH] Error while evaluating request 'export --file /tmp classic' Error: Management request failed for operation export-resource and path '/mop/portalsites/classic'
org.crsh.command.ScriptException: Management request failed for operation export-resource and path '/mop/portalsites/classic'
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
...
Caused by: org.gatein.management.api.binding.BindingException: Exception writing data to zip.
	at org.gatein.management.core.api.binding.zip.ExportResourceModelMarshaller.marshal(ExportResourceModelMarshaller.java:88)
	at org.gatein.management.core.api.binding.zip.ExportResourceModelMarshaller.marshal(ExportResourceModelMarshaller.java:47)
	at org.gatein.management.core.api.controller.SuccessfulResponse.writeResult(SuccessfulResponse.java:74)
	at org.gatein.management.api.controller.ManagedResponse$writeResult.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at export$_main_closure1.doCall(export:79)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:883)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at login$_run_closure2.doCall(login:51)
	... 29 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(String.java:1937)
	at org.exoplatform.portal.mop.management.binding.xml.AbstractMarshaller.marshalPortletApplication(AbstractMarshaller.java:249)
	at org.exoplatform.portal.mop.management.binding.xml.AbstractMarshaller.marshalModelObject(AbstractMarshaller.java:71)
	at org.exoplatform.portal.mop.management.binding.xml.AbstractMarshaller.marshalContainer(AbstractMarshaller.java:122)
	at org.exoplatform.portal.mop.management.binding.xml.AbstractMarshaller.marshalModelObject(AbstractMarshaller.java:89)
	at org.exoplatform.portal.mop.management.binding.xml.AbstractMarshaller.marshalContainer(AbstractMarshaller.java:122)
	at org.exoplatform.portal.mop.management.binding.xml.AbstractMarshaller.marshalModelObject(AbstractMarshaller.java:89)
	at org.exoplatform.portal.mop.management.binding.xml.PageMarshaller.marshalPage(PageMarshaller.java:145)
	at org.exoplatform.portal.mop.management.binding.xml.PageMarshaller.marshal(PageMarshaller.java:64)
	at org.exoplatform.portal.mop.management.binding.xml.PageMarshaller.marshal(PageMarshaller.java:49)
	at org.exoplatform.portal.mop.management.exportimport.PageExportTask.export(PageExportTask.java:77)
	at org.gatein.management.core.api.binding.zip.ExportResourceModelMarshaller.marshal(ExportResourceModelMarshaller.java:78)
	... 49 more


Expected results:
Export zip successfully generated

Comment 3 Nick Scavelli 2012-06-21 17:52:22 UTC
Somehow the internal content ID does not have the '/' character separating out the application ref and portlet ref. 

Closing this as it's not an issue with the export because as far as I know all pages that refer to a portlet application should have the format 'app-ref/portlet-ref'.

If you can duplicate this behavior on your side, please open a bug indicating the steps to produce this invalid internal content ID.