Applet freezes while downloading a ressource jar!

Hi everyone,
I have a fundamental question concerning the loading mechanism of an applets resources.
The problem is as follows:
I have two jars, the first containing all *.class files, the second (size: 10MB) containing only graphics and sounds.
I start the applet with this code:
<APPLET ARCHIVE="init.jar,resources.jar" HEIGHT="100" [...]>Of course the point is to have the small init.jar loaded fast an display a loading animation while the big file is beeing loaded in the background. Up to here everything works as expected. When i start the applet, the init.jar is loaded and displays a loading animation as long as i try to get a resource from the resource.jar.
When I do that, my applet freezes while the big resource.jar file is beeing downloaded.
This is how i access the resource in the resource.jar
public void run() {
     while(/*some condition*/) {
          // this is the line which blocks until whole jar is downloaded
          java.io.InputStream input = this.getClass().getClassLoader().getResourceAsStream(/*resource String*/);
          // use input to load resource
}The freeze happens only upon the first time the while-loop runs, after that the resource.jar is chached and access is almost instant.
Now the concrete problem is, that the applet freezed in all its threads while the jar is beeing downloaded. I NEED to display an idle animation while this is done.
Has anyone any suggestion how i can avoid the complete freeze?
I have already concidered to load the resources without specifing the jar in the HTML-ARCHIVE-Tag, this works becouse of the codebase i can load the ressources from, but the problem is, that these resources have a large overhead from the server to the client until i can use them in the program.
Also it is no option to load them all on startup in another backgound thread (which would slove the freeze problem, i tried it), becouse i have to dynamically load and unload these resources to avoid OutOfMemory-Errors. Reloading them brings the overhead-Problem up again.
Only when i specify the 2nd jar in the ARCHIEVE-Tag i have direct access to the browsers chache without wasting memory when holding references to all resources.
After all every loading and stuff works, there are no errors in the programm only this strange behaviour. I Also tried it with different VMs, on different OS, and different Browser, all the same.
I would be glad if someone could give me a hint on this, i've been searching for days now, even tried to analyse the Classoader sources but ended up in sun's native calls...
Thank you in advance
- Loddi

Multiple post
http://forum.java.sun.com/thread.jspa?threadID=5204797&messageID=9818313#9818313

Similar Messages

  • Applet freezes while Jar is loading

    Hi everyone,
    I have a fundamental question concerning the loading mechanism of an applets resources.
    The problem is as follows:
    I have two jars, the first containing all *.class files, the second (size: 10MB) containing only graphics and sounds.
    I start the applet with this code:
    <APPLET ARCHIVE="init.jar,resources.jar" HEIGHT="100" [...]>Of course the point is to have the small init.jar loaded fast an display a loading animation while the big file is beeing loaded in the background. Up to here everything works as expected. When i start the applet, the init.jar is loaded and displays a loading animation as long as i try to get a resource from the resource.jar.
    When I do that, my applet freezes while the big resource.jar file is beeing downloaded.
    This is how i access the resource in the resource.jar
    public void run() {
         while(/*some condition*/) {
              // this is the line which blocks until whole jar is downloaded
              java.io.InputStream input = this.getClass().getClassLoader().getResourceAsStream(/*resource String*/);
              // use input to load resource
    }The freeze happens only upon the first time the while-loop runs, after that the resource.jar is chached and access is almost instant.
    Now the concrete problem is, that the applet freezed in all its threads while the jar is beeing downloaded. I NEED to display an idle animation while this is done.
    Has anyone any suggestion how i can avoid the complete freeze?
    I have already concidered to load the resources without specifing the jar in the HTML-ARCHIVE-Tag, this works becouse of the codebase i can load the ressources from, but the problem is, that these resources have a large overhead from the server to the client until i can use them in the program.
    Also it is no option to load them all on startup in another backgound thread (which would slove the freeze problem, i tried it), becouse i have to dynamically load and unload these resources to avoid OutOfMemory-Errors. Reloading them brings the overhead-Problem up again.
    Only when i specify the 2nd jar in the ARCHIEVE-Tag i have direct access to the browsers chache without wasting memory when holding references to all resources.
    After all every loading and stuff works, there are no errors in the programm only this strange behaviour. I Also tried it with different VMs, on different OS, and different Browser, all the same.
    I would be glad if someone could give me a hint on this, i've been searching for days now, even tried to analyse the Classoader sources but ended up in sun's native calls...
    Thank you in advance
    - Loddi

    I've been encountering the same problem and I think I've figured out the reason behind it and how to solve it.
    It appears that the class loader can only ever load one resource at a time. Once you've forced it to start downloading resources.jar, it can't load any classes until that download has finished, not even classes that are part of the Java API. In your case I believe the solution would be to display one loop of your idle animation before you start loading resources.jar, to make sure that everything the idle animation needs has already been loaded by the class loader.

  • Java applet freezes while loading on Firefox on Mac OS 10.9

    I am using Mac OS 10.9.4 with Firefox 32 and Java 7 update 67. The java applet freezes while loading for the first time. On double clicking, it loads successfully. Once the applet gets loaded then it loads successfully until the web-page is refreshed or cache is cleared. I don't see any error message or any errors in the java console logs. Any help on this issue, apart from the double click work around? Any permanent solution?

    This delay can also happen when Java has been unloaded from memory and needs to be reloaded from disk and (re)initialized.
    You may be tight on available (free) memory if this happens all the time.

  • ITunes Store freeze while downloading and now permanent problems

    I bought an album through the iTunes Store today, and while downloading, iTunes completely froze. Not sure how that freeze was caused, could be that I was using up a little too many system resources with other stuff running in the background.
    In any case, the album was only partially downloaded, so when I restarted iTunes I used the "search for available downloads" option to succesfully download the rest of the album, or so I thought. Turns out it did download all songss except for one, and that one doesn't show up anymore when I retry the "available downloads" option.
    Strangely, whenever I now select one of the other songs from the same album in my library, iTunes completely freezes! I can only get it working again by stopping the process through taskmanager and restarting. This only occurs when the Genius-bar is shown, so it looks like looking up these songs through the iTunes store is causing a problem somehow. Does anyone have any ideas to
    a) get the missing song from the store and
    b) keep iTunes from crashing??
    Is there a way to deinstall and reinstall iTunes without losing my settings, iPhone backups and library? Or can I repair an installed version somehow?
    (I have the most recent iTunes version (8.0.1.11), running on WinXP SP3 - oh and it did synch the incomplete album to my iPhone and I can play the songs without problems on that)

    Deleting the album, reinstalling iTunes and then re-downloading the album turned out to be the way to fix it.

  • Freezes while downloading large pdf, otherwise works

    I am trying to download ibm manual at
    http://publibfp.boulder.ibm.com/epubs/pdf/igypg205.pdf
    The document is viewable in the browser, and I can navigate to the last page, but when I try to save it (clicking the diskette icon in the adobe toolbar), a temp is created and shortly thereafter, Firefox freezes in all tabs and becomes unresponsive.

    Hi Lisa,
    To answer your first question, no iphoto has no known issue with importing large amounts of images at a time. Unless of course you have reached the capactiy for your computer in respect to RAM (iPhoto 6 is memory scalable up to 250,000 images...but it is based on amount of RAM).
    If you already pulled the plist for iphoto then I would do the following:
    Make sure you are connecting your Media card reader directly to the computer - do not go through a hub.
    Remove ~/library/caches and restart computer - test - if issue persists proceed to next step
    Reset PRAM by holding down Apple key - option key - P - R during start up of computer - listen for 2 chimes and then release - test - if issue persists proceed to next step
    Hold down the option key while opening iphoto - click on create library - attempt to import into the new library - if it works you know that the issue is with your current iphoto library - follow kbase 107947 to rebuild your library - if it does not work then create a new user account and test again - if it still does not work then I would try using a different media card / or a different media card reader.
    One common mistake that people make is that they never reformat their media cards between use. Not just erase...but reformat...this is a function of the camera itself, not the comptuer. Consider whether your camera manual has a section on reformating.
    Hope that helps.
    Cheers!

  • V13.1 freezes while downloading

    Ever since I upgraded to v13 each time I start a download firefox keeps freezing(accepting no input whatsoever) until the download is completed or stoped.
    Everything else works perfectly normal while this issue is going on.
    I'm using Win7SP1

    Maybe something here will help?
    *https://support.mozilla.org/kb/Firefox-hangs#w_firefox-hangs-when-downloading-files-or-saving-images
    *http://kb.mozillazine.org/Firefox_hangs#Hang_downloading_files
    See also [[Troubleshoot and diagnose Firefox problems]] for basic troubleshooting steps.

  • IPhoto freezes while downloading large cards

    My iPhoto 6.04 gets "stuck" when trying to import large numbers of images (like 646 on a 1 GB card). It shows the import window, but the progress bar doesn't show anything, and eventually it freezes and has to be force-quit. When restarted, it will show a partial import.
    I can import the images just fine if i use Image Capture to download them elsewhere on the mac, then copy them over to iPhoto. It's just kind of a hassle, and creates duplicates.
    Is my problem likely to be with iPhoto, or with the cam, card, or cardreader? Or does iPhoto just tend to choke on large downloads? I have thrown out iPhoto prefs/plist, but i haven't rebuilt the library, which has about 3000 images.

    Hi Lisa,
    To answer your first question, no iphoto has no known issue with importing large amounts of images at a time. Unless of course you have reached the capactiy for your computer in respect to RAM (iPhoto 6 is memory scalable up to 250,000 images...but it is based on amount of RAM).
    If you already pulled the plist for iphoto then I would do the following:
    Make sure you are connecting your Media card reader directly to the computer - do not go through a hub.
    Remove ~/library/caches and restart computer - test - if issue persists proceed to next step
    Reset PRAM by holding down Apple key - option key - P - R during start up of computer - listen for 2 chimes and then release - test - if issue persists proceed to next step
    Hold down the option key while opening iphoto - click on create library - attempt to import into the new library - if it works you know that the issue is with your current iphoto library - follow kbase 107947 to rebuild your library - if it does not work then create a new user account and test again - if it still does not work then I would try using a different media card / or a different media card reader.
    One common mistake that people make is that they never reformat their media cards between use. Not just erase...but reformat...this is a function of the camera itself, not the comptuer. Consider whether your camera manual has a section on reformating.
    Hope that helps.
    Cheers!

  • Computer Freeze while Downloading

    How do I get the songs I purchased that I can see on my computer but not in ITunes and when I attempt to play them after I move them to ITunes I keep getting the message to authorize my computer and then it states this computer is already authorized. Never letting me play the songs. It's like during the freeze they didn't download completely. Can anyone assist me in fixing this?

    Hotsouma wrote:
    will my Mac know that there's a download
    mine does. i've never seen my Mac sleep while there is (download) activity.
    JGG

  • Third party app freezes while downloading

    Tried several times to download The Sims 3 from Origin but it freezes at file 840 of 889.  Have trashed it and tried again with same results.  Any suggestions?  Thanks.

    Hi and Welcome to the Forums!
    It sounds as if the app is not 100% compatible with your model BB. Did you ask the maker of the app if they are certified for your BB?
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Freezes while downloading

    Hi,
    We've just bought a new 60G iPod, and are having trouble putting stuff on it. We've bought it primarily for keeping and transporting photos, with the whole music/video/storage things as being a bonus.
    The problem is that when I want to sync my ipod with the iphoto library it freezes after about 1Gb has been downloaded. I can download a few photos at a time fine, but once about 1Gb of information is on the ipod I can't get any further.
    It doesn't seem to be a problem with iPhoto - I've also tried syncing with a folder I've set up. It also freezes if I attempt to use the iPod as an external disc, and then try to add more than a gb total data.
    We installed the latest ipod/itunes software yesterday.
    I've tried reseting and restoring (several times!) Does this sound like a hardware fault? Am I going to have to send it to apple?
    Thanks!
    Rob

    bump!
    Any ideas guys?
    Thanks
    Rob

  • Ovi Suite freezing while downloading maps

    Hi folks,
    I have a Nokia 5230 with the latest maps application. Whenever I try to download maps to the phone the download starts for just a few seconds and Ovi Suite freezes. I have restarted both my computer and phone but still run into same problem. I am connected in PC Suite mode via USB.
    Thanks a lot for your help.

    @tonderai
    Welcome to the forum!
    Presumably you have latest Ovi Maps v3.06 (688) available from here installed?http://nds1.nokia.com/files/support/global/phones/software/ ovi_maps_installer_3.06_11wk23_b05_s60_5...
    Is this the first time that you have download maps to your 5230?
    You do have a microSD memory card in place and you have run Ovi Maps application upon 5230 with it in place?
    Happy to have helped forum with a Support Ratio = 42.5

  • Startup freeze while downloading

    After starting a download I sometimes close the browser window and keep the download window open. However, when I want to open Firefox again, during the download, the browser window takes forever to open and then freezes the whole computer. This can only be resolved by opening the task manager and ending the firefox.exe process. I'm using Firefox 4 and this didn't happen initially when I upgraded from 3.6. So to find if this could be fixed I reinstalled 3.6 and found that this was not an issue. So I again upgraded to Firefox 4, but this problem surfaced again. I am wondering what might be causing this problem.
    Originally before this problem started the newly opened window would quickly open the last opened tab or in the case of Firefox 3.6 my homepage tabs would be opened.

    Deleting the album, reinstalling iTunes and then re-downloading the album turned out to be the way to fix it.

  • My Computer keeps freezing while downloading songs to ipod

    It varies. sometimes I get 5 songs on..sometimes 250 songs sometimes 2500 songs but it keeps freezing up. I have a 2.0 usb port that is brand new and has been checked out. why is this happening and what do i do to stop it?...please help me? I'm at the end of my rope.
    Edd

    answered

  • IPod freezes while downloading music from iTunes

    This morning I went to the Genius bar at the local Apple store. I had been having problems with my iPod and also my iBook computer. We restored the system to 10.3.9 on the iBook and completely wiped out the iPod. I took it home to upload all the music again and it got about one third of the way and then froze. Reset the ipod, started the upload, then it went to about the 128th song and froze. The third time it froze on the first song. Hooked the iPod up to a different computer and it got to the 3rd to last song and froze. I am running iTunes 4.6 and have the 2005-6-26 updater installed. (not sure if the 2005-9-28 updater is okay to use as I have been reading these posts, and it sure doesn't sound good.) Any suggestions?

    Welcome to AD!
    I know you weren't downloading videos and probably didn't get an error 8008, but try these steps for getting rid of that download folder & checking for available purchases after it's gone.
    http://support.apple.com/kb/TS2384
    Do you have V CAST from Verizon installed on that PC?

  • Apps keep freezing while downloading

    I've previously managed to download several apps onto my iPad without issue, but the last couple of times I've tried, they seem to have frozen part way through downloading. I now have two app icons stuck on 'Waiting' on my screen, that I can't get rid of. I'm not too fussed about either of the apps - I just want to get rid of the icons, but can't. If I hold down, all the other icons start to do the shaky thing with the cross in the corner, but those two don't. I've tried a soft reset and that didn't get rid of them either. Any suggestions? Thanks in advance.

    If powering off and restarting the device doesn't work, the next thing to try is syncing with iTunes. Usually that will reset the apps to all completed downloads. You could then download them from within iTunes and re-sync to get them on your device.
    This has happened to me with both iPad and iPhone in the past and syncing has always fixed the problem.
    BTW make sure you are running the latest software for your iPad. Some apps may hang or crash if they have been written or updated to work with IOS 4.3.3 and you are still on older software.
    Good luck

Maybe you are looking for

  • Web Start and Web Application

    I have a scenario as given below. I have a Central Server hosting a web application(JSPs, jars) in Jetty 6.0.0. I have many branch servers having Jetty 6.0.0 installed and the web application deployed. Now, I want to update the web application on all

  • How can I install an ad-hoc app on my iPad?

    In previous versions of iTunes it was easy, drag the icon onto the apps screen, then drag the app onto the device. But in iTunes v 11.1.2.32 there is no apps screen any more. How can I install an ad-hoc app onto my device using Windows?

  • BO Webi report giving WIJ 20003 exception

    Hi, I have a webi report which consists of some calculated fields based on Dataprovider SQL. A Report variable has been created to compare two columns and if they are equal then value is set to 1s otherwise, 0s. Based on the 1s I get, I want to displ

  • Counter issue error 200305

    Okay here it goes, I am trying to output the following variable finite pulse trains out of a counter on my 6071E.  First the period must be able to go up to 100ms and second, I must be able to output this pulse train a fixed number of pulses up to 15

  • Windows Service OracleserviceDEV cannot startup

    Hi, All Before upgrading NW7.0 to EHP1, I Installed microsoft runtime dlls vcredist_<platform>.exe and dbghelp.dll. but after installed them, the windows service OracleServiceDEV could not startup and can startup in cmd mode. I checked the service in