Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

applet locks-up jvm: IllegalStateException: zip file closed

Thread view: 
Adrian Hands, Raleigh NC  USA - 26 Jun 2007 20:01 GMT
public class BugTest
   extends java.applet.Applet
{
   private final static String JLFGR =
       "jar:http://www.foobar.com/someapp/lib/jlfgr-1_0.jar!";  //
sun-supplied jar file

   public void start()
   {
       javax.swing.SwingUtilities.invokeLater( new Runnable()
{ public void run() {
           javax.swing.JFrame frame = new BugTestFrame();
           frame.pack();
           frame.setVisible( true );
       } } );
   }

   public static class BugTestFrame
       extends javax.swing.JFrame
   {
       public BugTestFrame()
       {
           java.awt.Container cp = new javax.swing.JPanel();
           setContentPane( cp );

           try {

               // this file is not in the jar.  the attempt to find
it seems to leave the jar in an unexpected (closed) state, and causes
the next line to lock up the jvm & browser:
               new javax.swing.ImageIcon( new java.net.URL( JLFGR + "/
foobar.gif" ) );

               // here's where it locks up and everything becomes
unresponsive:
               cp.add( new javax.swing.JLabel( new
javax.swing.ImageIcon( new java.net.URL( JLFGR + "/
toolbarButtonGraphics/general/Stop16.gif" ) ) ) );

           } catch( java.net.MalformedURLException exc ) {
               exc.printStackTrace();
           }

       }
   }
}

Uncaught error fetching image:
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(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.connect(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(Unknown Source)
at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
at sun.awt.image.ImageFetcher.run(Unknown Source)
Adrian Hands - 27 Jun 2007 20:56 GMT
logged as a bug with sun:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6574388


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.