Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314550 - PDE headless build fails with java.lang.UnsupportedOperationException as of 3.6 RC1
Summary: PDE headless build fails with java.lang.UnsupportedOperationException as of 3...
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: Build (show other bugs)
Version: 4.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.6 RC3   Edit
Assignee: pde-build-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-26 14:27 EDT by Daniel Belina CLA
Modified: 2010-05-26 17:05 EDT (History)
4 users (show)

See Also:
dj.houghton: review+
darin.eclipse: review+
pascal: review+


Attachments
patch (1.69 KB, patch)
2010-05-26 15:19 EDT, Andrew Niefer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Belina CLA 2010-05-26 14:27:39 EDT
Build Identifier: I20100520-0800

I have a headless PDE build launching via antRunner.  As of IES 3.6 RC1, it fails with the following exception:

Caused by: /home/belina/sandbox/WASX/WSC/ws/code/wct/packager/package.xml:59: java.lang.UnsupportedOperationException
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.Target.performTasks(Target.java:385)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
	at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
	at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
	... 35 more
Caused by: java.lang.UnsupportedOperationException
	at java.util.AbstractCollection.add(AbstractCollection.java:68)
	at org.eclipse.pde.internal.build.packager.PackageConfigScriptGenerator.setPackagingPropertiesLocation(PackageConfigScriptGenerator.java:174)
	at org.eclipse.pde.internal.build.packager.PackageScriptGenerator.basicGenerateAssembleConfigFileTargetCall(PackageScriptGenerator.java:57)
	at org.eclipse.pde.internal.build.AssembleScriptGenerator.generateMainTarget(AssembleScriptGenerator.java:124)
	at org.eclipse.pde.internal.build.AssembleScriptGenerator.generate(AssembleScriptGenerator.java:55)
	at org.eclipse.pde.internal.build.packager.PackagerGenerator.generatePackageScripts(PackagerGenerator.java:56)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generateFeatures(BuildScriptGenerator.java:253)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generate(BuildScriptGenerator.java:112)
	at org.eclipse.pde.internal.build.tasks.PackagerTask.execute(PackagerTask.java:90)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:600)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	... 43 more

The packager.xml line in question is:
<eclipse.assembler featureList="${featureList}" workingDirectory="${workingDirectory}" configInfo="${config}" baseLocation="${tempDirectory}/${featurePaths}" packagePropertyFile="${packagingPropertyFile}" deltaPack="${deltaPack}"/>

This was previously working on IES 3.6 M7 and earlier builds.  The package.xml I'm making use of was unchanged between runs using the M7 and RC1 builds.

In the org.eclipse.pde.build_3.6.0.v20100512 directory is a file named pdebuild.jar.  Replacing that jar file with the version from IES 3.6 M7 allows the build to complete successfully.

Reproducible: Always

Steps to Reproduce:
This occurs in a local build environment for an IBM WebSphere tool, so I'm not sure how to provide steps to reproduce.  I can provide any additional information requested if the information in the Details section is not sufficient.
Comment 1 Andrew Niefer CLA 2010-05-26 15:19:36 EDT
Created attachment 170077 [details]
patch

Caused by changes for bug 282260.

 That change was to store the rootProviders list for ourselves and pass an empty collection up to the parent.  In the past, the rootProvider list on the parent class would have been empty, but it would have been modifiable.  This matters because old style re-packaging scripts (using scripts/package.xml) can contribute root files during the packaging phase.

So we can't pass Collections.EMPTY_SET to the parent.  

Also, when #getArchiveRootFileProviders() is called, we need to pass in the parent's root collection that may have had things added to it.
Comment 2 Andrew Niefer CLA 2010-05-26 17:05:42 EDT
Thanks Daniel for reporting this before it was too late.