View Single Post
  #1 (permalink)  
Old 10-12-2007, 12:27 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 325
amansundar is on a distinguished road
Question Why it shows like "Unknown Source" for Invalid Path?

I keep my images in a jarfile and load them as followes:

Image image = null;
try
{
image = Toolkit.getDefaultToolkit().getImage( url );
}
catch ( Exception e )
{
// inform user.
}

This works fine, but when i accidently misspell the image name I get:

java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.ensureOpen(Unknown Source)
at java.util.zip.ZipFile.getEntry(Unknown Source)
at java.util.jar.JarFile.getEntry(Unknown Source)
at com.sun.deploy.cache.CachedJarFile.getEntry(Unknow n Source)
at sun.net.http://www.protocol.jar.JarURLConnec...onnect(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection .connect(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection .getInputStream(Unknown Source)
at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
at sun.awt.image.InputStreamImageSource.doFetch(Unkno wn Source)
at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
at sun.awt.image.ImageFetcher.run(Unknown Source)

Why isn't the exception caught?
__________________
cheers
Aman
Reply With Quote
Sponsored Links