org.eclipse.core.runtime.OperationCanceledException loading report resources on a new LCP CCM project, [Solved]
we have built a LCP project creation automation tool.
it uses the REST apis to create an LCP project, using the sample provided here,
https://jazz.net/wiki/bin/view/Main/LPAAPIExampleClient
all goes well.
now we need to do some additional project area setup
1. reparent the ccm project (created with unconfiged) to use the shared process area parent project
2. load the report resources.
add users, and roles.. (1 has to be done before this, else project has no role definitions)
we have to logon to use the plainjava api, as you cannot do 1 or two thru REST.
I have standlone utilities that do 1 and two, so its a tuiny cut/paste to join them together..
(both pgms are using the same plainjava libs, 4.0.4, to server 4.0.4, on the same eclipse)
but the loading the report resources fails with the operation canceled. call.
the project area reparent works fine.
error
logged in user =Sam Detweiler
there are 94 missing report definitions
adding report='workitems.MicroStoryPointsProgress'
adding report resorce failed for report=Micro Story Points Progress exception=null
org.eclipse.core.runtime.OperationCanceledException
this routine, a direct cut/paste from my standalone utility
URI produri = URI.create(prodprojectAreaName.replaceAll(" ", "%20"));
IProjectArea iprja_prod = (IProjectArea) prodprocessClient.findProcessArea(produri, null, null);
if (iprja_prod != null)
{
IReportManager irptMgr = ((IReportManager) productionServer.getClientLibrary(IReportManager.class));
List<IReportDescriptor> missingreports = irptMgr.fetchMissingSharedReportDescriptors(
(IProcessAreaHandle) iprja_prod.getItemHandle(), null);
System.out.println("there are "+missingreports.size()+" missing report definitions");
for (IReportDescriptor report : missingreports)
{
try
{
System.out.println("adding resport='"+report.getId()+"'");
irptMgr.saveReportDescriptor(report, null);
}
catch (Exception e)
{
System.out.println("adding report resporce failed for report="+report.getName()+ " exception="+e.getMessage());
return(false);
}
}
}
this code works perfectly on the same project a little while (minute) later..
| edit: (worked afterwards cause we had continued and added the users)
One answer
this turned out to be a permissions error..
we had not added any users yet, so the everybody role took effect, and 'everybody' doesn't have permission to add report resources.
I opened defect
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=309629
Comments
sam detweiler
Mar 21 '14, 12:02 p.m.when using my original sample, I can make it fail the same way