Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 315710

Summary: headless build fails with java.lang.ClassCastException
Product: [Eclipse Project] PDE Reporter: Daniel Belina <belina>
Component: BuildAssignee: pde-build-inbox <pde-build-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, darin.eclipse, hmcgee, stephen.francisco
Version: 3.6Flags: darin.eclipse: review+
Target Milestone: 3.6.1   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 316339    
Attachments:
Description Flags
patch v1
none
jar with fix v1
none
patch + test
none
patch v2 none

Description Daniel Belina CLA 2010-06-03 21:58:19 EDT
Build Identifier: I20100527-1700

I have a headless build that fails with the following exception:

[21:43:01+0000/wct/package.all/exec] /home/belina/sandbox/WASX/WSC/ws/code/wct/packager/package.xml:64: java.lang.ClassCastException: java.lang.String incompatible with org.eclipse.pde.internal.build.site.BuildTimeFeature

Caused by: java.lang.ClassCastException: java.lang.String incompatible with org.eclipse.pde.internal.build.site.BuildTimeFeature
	at org.eclipse.pde.internal.build.AssembleConfigScriptGenerator.generatePermissions(AssembleConfigScriptGenerator.java:984)
	at org.eclipse.pde.internal.build.AssembleConfigScriptGenerator.generateAntZipTarget(AssembleConfigScriptGenerator.java:960)
	at org.eclipse.pde.internal.build.AssembleConfigScriptGenerator.generateArchivingTarget(AssembleConfigScriptGenerator.java:377)
	at org.eclipse.pde.internal.build.packager.PackageConfigScriptGenerator.generateArchivingTarget(PackageConfigScriptGenerator.java:213)
	at org.eclipse.pde.internal.build.AssembleConfigScriptGenerator.generateEpilogue(AssembleConfigScriptGenerator.java:700)
	at org.eclipse.pde.internal.build.AssembleConfigScriptGenerator.generate(AssembleConfigScriptGenerator.java:135)
	at org.eclipse.pde.internal.build.packager.PackageScriptGenerator.basicGenerateAssembleConfigFileTargetCall(PackageScriptGenerator.java:63)
	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)
....

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

(Previously my headless build was failing due to bug 314550, and I just recently picked up I20100527-1700 to try out the fix)

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-06-04 13:45:29 EDT
Sorry, I'm not going to be able to fix this for 3.6.  The RC4 candidate is already built.

This does not affect normal users of eclipse (ie export from workspace), this only affects old style package.xml builds.  Regular feature and product builds are not affected.

I would suggest such old builds can stay on 3.5.

While this particular problem appears to be a one line change, the code is complicated and not covered directly by unit tests.  And I'm not confident that there aren't more changes needed.

If required a fix can be delivered to IES post 3.6, similarly the releng basebuilder can be patched as well.
Comment 2 Daniel Belina CLA 2010-06-08 11:17:42 EDT
I'm OK with waiting until 3.6.1 (the current Target Milestone this bug is set for) as we need to move to 3.6 for the additional platform support.

In the meantime, could a patch in the form of a class file or jar be provided?  I'm willing to test this out, in the efforts to verify whether this does indeed fix the problem or if more changes are needed, to make some headway before 3.6.1.
Comment 3 Andrew Niefer CLA 2010-06-08 11:36:15 EDT
Created attachment 171422 [details]
patch v1

First patch
Comment 4 Andrew Niefer CLA 2010-06-08 11:37:59 EDT
Created attachment 171423 [details]
jar with fix v1
Comment 5 Andrew Niefer CLA 2010-06-09 12:01:04 EDT
Created attachment 171548 [details]
patch + test
Comment 6 Daniel Belina CLA 2010-06-09 12:40:10 EDT
Thanks for the patch.  I've tried this out and it looks to be working OK for me, not hitting any failures in the headless build any longer.
Comment 7 Andrew Niefer CLA 2010-06-09 13:21:01 EDT
I have released the patch & test to HEAD for 3.7 nightly builds. (bug 316339).

The 3.6.1 stream won't be open for a little bit yet.
Comment 8 Andrew Niefer CLA 2010-06-09 14:41:21 EDT
Created attachment 171567 [details]
patch v2

Previous patch broke permissions for bug 282260
Comment 9 Andrew Niefer CLA 2010-07-06 13:45:59 EDT
done in 3.6.1