[jboss-dev-forums] [Design the new POJO MicroContainer] - Silent failover on broken jar file
alesj
do-not-reply at jboss.com
Tue Mar 11 08:56:31 EDT 2008
We do this in our VFS code:
| if (file.isFile() && JarUtils.isArchive(file.getName()))
| {
| String name = file.getName();
| try
| {
| return new JarHandler(this, parent, file, file.toURL(), name);
| }
| catch (IOException e)
| {
| log.debug(e.getMessage());
| }
| }
| return createVirtualFileHandler(parent, file, fileURL);
|
And since we moved over to VFS.getChild returning null, instead of VFS.findChild which heavily complained when it didn't found what we were looking for, a lot of things gets silently suppressed - e.g. trying to find META-INF on a broken jar file == trying to find a META-INF child on a FileHandler, resulting in a silent null being returned. And this is true for all file lookups on this broken jar, meaning even more silent nulls being returned.
But the problem is that from 'outside' this file looks OK, except for this debug message. :-)
Should we throw exception fwd or at least do a warn?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135598#4135598
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135598
More information about the jboss-dev-forums
mailing list