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

Bug 335414

Summary: Site parsing errors should mention the URL of the site being parsed and erroneous bit of XML for easier debuggery
Product: [Eclipse Project] Equinox Reporter: Nick Boldt <nboldt>
Component: p2Assignee: DJ Houghton <dj.houghton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.6.1   
Target Milestone: 3.7 M6   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch
none
patch none

Description Nick Boldt CLA 2011-01-25 21:40:05 EST
So, I have a half-dozen update sites in my Eclipse.

When I check for updates, one of them throws this message into my log:

!ENTRY org.eclipse.equinox.p2.core 2 0 2011-01-25 13:37:48.382
!MESSAGE Error parsing composite repository
!SUBENTRY 1 org.eclipse.equinox.p2.core 2 0 2011-01-25 13:37:48.382
!MESSAGE Error at line 3, column 156: Missing required attribute in "repository": version

(Actually, I get 5 similar errors on line 3 at different column markers from various sites who've made this similar mistake.)

Anyway, after some deduction and process-of-elimination, I managed to figure out that this is due to http://m2eclipse.sonatype.org/sites/m2e-extras/compositeArtifacts.xml and/or http://m2eclipse.sonatype.org/sites/m2e-extras/compositeContent.xml

But the effort required to throw guess URLs at a server for each of the update sites from which I'm getting updates is significantly more than the effort that could be used to spit out an error message to simply tell the user:

 "The site at URL {0} is missing the attribute {1} in node {2}: {3}."

where:

 {0} -> URL
 {1} -> version
 {2} -> repository
 {3} -> line contents

Then, geeks like me could report the problem to the site's owner more easily and get stuff like this fixed.

...

Of course a warning message like this, which doesn't reflect any actual impedance to installation from the site (since the version is evidently assumed to be "1" or something), could also simply be suppressed entirely.
Comment 1 DJ Houghton CLA 2011-01-26 15:23:40 EST
Created attachment 187680 [details]
patch

Agreed. Here is an initial patch. 
Initial tests locally look good. 
I haven't modified the code which handles legacy update sites yet.
Comment 2 DJ Houghton CLA 2011-01-27 14:29:32 EST
Created attachment 187764 [details]
patch

Updated patch.
Comment 3 DJ Houghton CLA 2011-01-27 14:30:07 EST
Patch released to HEAD.