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

Bug 335806

Summary: can not pack jsf.core bundle
Product: [WebTools] Java Server Faces Reporter: David Williams <david_williams>
Component: CoreAssignee: Ian Trimble <ian.trimble>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: neil.hauge, raghunathan.srinivasan
Version: unspecifiedFlags: david_williams: pmc_approved+
raghunathan.srinivasan: pmc_approved? (naci.dai)
raghunathan.srinivasan: pmc_approved? (deboer)
neil.hauge: pmc_approved+
raghunathan.srinivasan: pmc_approved? (kaloyan)
raghunathan.srinivasan: review+
Target Milestone: 3.2.3   
Hardware: PC   
OS: Windows 7   
Whiteboard: PMC_approved
Attachments:
Description Flags
Patch to cause plugin JAR to be excluded from packing. none

Description David Williams CLA 2011-01-31 01:47:49 EST
I'm not sure what's changed in jsf.core bundle, from last release, if anything, but I ran "pack200" on our repository, contributed to helios common repo aggregation, and received the error pasted below. The message means the "jar.pack200.gz" version of org.eclipse.jst.jsf.core is "corrupt" ... as far as I know. (That is, it is not literally an invalid signature, as the message says ... just appears to be tampered with). 

For now, I removed the pack200 versions of our bundles (for RC2 contribution) but for RC3, we need to correct. 

If there's nothing obvious about "ConverterClassValidationVisitor" that would lead to this problem, it may be one of those cases that pack200 just doesn't work with. I think we've hit this before with the jem.proxy bundle. 

So, if there is nothing obvious, the only fix is to configure the bundle to not be packed. That is done by including a file named 'eclipse.inf' in the META-INF directory with following two lines (second line may not be needed, if there's no nested jars). 

jarprocessor.exclude.pack=true
jarprocessor.exclude.children=true

I've marked as 'critical' just to reflect this could be considered "blocking" for RC3/release, but does not need to be fixed for RC2 ... we need to use pack200, but can't as long as it results in a bad pack200 jar. 

= = = = = = = = = = 


The following error occured when building Helios:

org.eclipse.core.runtime.CoreException: Unable to unpack artifact osgi.bundle,org.eclipse.jst.jsf.core,1.3.3.v201101211220 in repository file:/shared/helios/aggregation/final/aggregate: Invalid content:org/eclipse/jst/jsf/validation/internal/appconfig/ConverterValidationVisitor$ConverterClassValidationVisitor.class
Caused by: org.eclipse.osgi.signedcontent.InvalidContentException: The file "org/eclipse/jst/jsf/validation/internal/appconfig/ConverterValidationVisitor$ConverterClassValidationVisitor.class" in the jar "/tmp/signatureFile5394378961329555776.jar" has been tampered!

Check the log file for more information: https://hudson.eclipse.org/hudson/view/Repository%20Aggregation/job/helios.runAggregator/453/console
Comment 1 David Williams CLA 2011-01-31 13:36:15 EST
FYI, I've discovered the same problem in our M5 as well. Guess its the same code/bundle. 

I have also re-discovered I can use an extra step to remove that one specific bundle, so am downgrading to 'major' ... but, hate to depend on that extra step if can be fixed more permanently.
Comment 2 Ian Trimble CLA 2011-02-01 15:54:28 EST
Created attachment 188086 [details]
Patch to cause plugin JAR to be excluded from packing.
Comment 3 Ian Trimble CLA 2011-02-01 15:57:40 EST
Raghu, please review for PMC approval.

There is nothing odd about the class that is reported as an issue by the pack200 utility, in fact there is another inner class that is almost identical and there is no problem reported for that one.

The solution is, therefore, as suggested: adding the appropriate eclipse.inf contents to cause the pack200 utility to skip packing the plug-in's JAR.
Comment 4 Ian Trimble CLA 2011-02-01 19:26:10 EST
These tasks were performed locally:
 - build a JAR for the plug-in (jsf.core)
 - sign the JAR
 - run pack200 on the signed JAR
 - run unpack200 on the packed, signed JAR
At no point is there any error, and the JAR is valid at the end of the process.

There is nothing even remotely obscure about the ConverterClassValidationVisitor class, and a sibling inner class (ConverterForClassValidationVisitor) that is almost identical has not been reported to cause the same issue.

I can see no way to change the class to make it work, since I cannot reproduce the issue to begin with and since there is nothing obviously strange about the class.
Comment 5 Raghunathan Srinivasan CLA 2011-02-01 19:36:16 EST
Requesting PMC review to checkin the workaround to address the error in running pack200 on jsf.core bundle.
Comment 6 David Williams CLA 2011-02-02 10:15:20 EST
I approve and think the eclipse.inf solution is the right one. 

But, for reference, I think the steps to try and reproduce this should be slightly different; to include a "conditioning" step (marked with '*' below).

 - build a JAR for the plug-in (jsf.core)
*- run pack200 on the jar with -unpack option (essentially does pack, and
      then unzips it, so the byte code are shuffled around before signing). 
 - sign the JAR
 - run pack200 on the signed JAR
 - run unpack200 on the packed, signed JAR


But, I would be very surprised if this reproduced it. I think the cases where this occur are pretty odd, and I'm sure depends on exact versions of VMs, pack/unpack options, libraries ... maybe even day of the week :) That is, in the cases I've seen/read about, there is essentially no "fix" the programmer can make ... its some hole in the process/specs/implementation or something. 

Thanks.
Comment 7 David Williams CLA 2011-02-02 10:33:18 EST
Oh, and one other thing about reproducing ... we intentionally use a 1.5 VM to do the pack (not sure if you were or not, but I know that'd make a difference) ... and via the "jarsigner" utilities, we use "-E4" when we do the pack (E4 means "not too much effort" ... supposed to be one of the "safest" levels to use ... but, as I've mentioned ... there have been several other cases of mysterious failures that lead to simply excluding it from being packed at all ... so, just consider this info if you are interested ... I'm not asking for you to do anything different from including the eclipse.inf. 

Thanks again,
Comment 8 Ian Trimble CLA 2011-02-02 13:58:19 EST
With two PMC approvals, checked into 3.2.3 stream at 2011/02/02 10:57AM PDT.
Comment 9 Ian Trimble CLA 2011-02-02 14:08:51 EST
Checked into 3.3 stream at 2011/02/02 11:08AM PDT.