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

Bug 316886

Summary: [publisher] NullPointerException in ProductPublisherApplication (p2.publisher) when product file path denotes missing or invalid xml document
Product: [Eclipse Project] Equinox Reporter: Katya Stoycheva <katya.stoycheva>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: irbull, pascal, s.yousouf
Version: unspecified   
Target Milestone: 3.7 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Handling missing or invalid product file pascal: iplog+

Description Katya Stoycheva CLA 2010-06-15 08:05:43 EDT
Build Identifier: I20100603-1500

When trying to run product publisher application with parameter product file which doesn't exist or is invalid xml, the application exits with the following message:
Generating metadata for ..
Status ERROR: org.eclipse.equinox.p2.artifact.repository code=0  java.lang.NullPointerException
-metadataRepository
file:///D:/tools
-artifactRepository
file:///D:/tools
-productFile
file:///d:/non.existing
-configs
win32.win32.x86

Reproducible: Always

Steps to Reproduce:
1. Configure parameters: 
-metadataRepository file:///D:/tools (test directory, could be empty)
-artifactRepository file:///D:/tools (test directory, could be empty)
-productFile file:///d:/non.existing file 
-configs win32.win32.x86
2. Run application ProductPublisher with arguments described in point 1.
3. Observe NullPointerException in application output without any meaningful message
Comment 1 Katya Stoycheva CLA 2010-06-15 08:12:18 EDT
Created attachment 171916 [details]
Handling missing or invalid product file

Exception handling could be improved: instead of catching all types of exceptions,  only the feasible checked exceptions (IOException, ParserConfigurationException and SaxParserException) should be processed.
Comment 2 Pascal Rapicault CLA 2010-11-02 17:34:32 EDT
Fixe released in HEAD.