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

Bug 340197

Summary: [Fatal Error] :1:1: Premature end of file while writing artifacts repository
Product: [Eclipse Project] Equinox Reporter: Alin Dreghiciu <adreghiciu>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: thomas
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Alin Dreghiciu CLA 2011-03-16 13:36:45 EDT
Build Identifier: CVS HEAD

While writing artifacts (actually when artifacts repository is used) P2 SimpleArtifactRepository is logging the following:
[Fatal Error] :1:1: Premature end of file.

Attached is an print screen of a trace showing how that happens.
The problem is that if the "cache" artifacts repository does not exist it will be created while creating the artifacts repository that results in creating the "cache" repository that will trigger SimpleArtifactRepositoryIO.write which when calling repository.getRules will try to load them from disk. But the repository is just an empty file by this moment so XML parser will give the above mentioned error.

This was introduced with the changes from revision 1.103 about locking.

Reproducible: Always
Comment 1 Thomas Hallgren CLA 2011-03-16 13:38:23 EDT

*** This bug has been marked as a duplicate of bug 339862 ***