Bug 53681 - [PATCH] Improve exception handling when loading classpath resources fails
Summary: [PATCH] Improve exception handling when loading classpath resources fails
Status: NEW
Alias: None
Product: XMLGraphicsCommons - Now in Jira
Classification: Unclassified
Component: utilities (show other bugs)
Version: 1.4
Hardware: PC All
: P2 minor (vote)
Target Milestone: --
Assignee: XML Graphics Project Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-09 06:21 UTC by Dominik Stadler
Modified: 2012-08-09 06:21 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Stadler 2012-08-09 06:21:11 UTC
I had one invalid .jar file where signing information was not correct. XML Graphics Commons 

When calling ClasspathResource.loadManifests(), via ClasspathResource.getInstance(), it correctly fails with a "java.lang.SecurityException: Invalid signature file digest for Manifest main attributes", however it does not tell me which actual jar-file could not be loaded.

Please enhance exception handling in that method so that it reports which jar-file failed, e.g. 

--- ClasspathResource.java      2010-07-02 14:04:28.000000000 +0200
+++ ClasspathResource.java.new  2012-08-09 08:20:21.428843500 +0200
@@ -138,6 +138,8 @@
                                 addToMapping(contentType, name, classLoader);
                             }
                         }
+                    } catch (SecurityException se) {
+                       throw new SecurityException("While handling " + u, se);
                     } catch (IOException io) {
                         // TODO: Log.
                     }