Java Applet: Caching data in User HDD?

Hi,
I'm trying to write a java applet which requires approximately 700K of mathematical data everytime it runs. One way to do this is to download those data off from server everytime the applet starts up, but it seems terribly inefficient for me cuz those data do not change at all.
Is there anyway to work around such issue, for example, by storing the data into user's hdd? Or is it possible to pack the mathematical data together with .class files into a jar file and then somehow access them in user's side? (dunno how to do so and not sure if it's possible)
Any help would be greatly appreciated. Thanks.
Aaron

Hi,
I'm trying to write a java applet which requires
approximately 700K of mathematical data everytime it
runs. One way to do this is to download those data off
from server everytime the applet starts up, but it
seems terribly inefficient for me cuz those data do
not change at all.
Is there anyway to work around such issue, for
example, by storing the data into user's hdd? Or is it
possible to pack the mathematical data together with
.class files into a jar file and then somehow access
them in user's side? (dunno how to do so and not sure
if it's possible)
Any help would be greatly appreciated. Thanks.
AaronYou have one answer above.
Create a jar file, put your applet classes in it, and then put the data files in the jar with the application. Theres no restriction as to the types of file you can put in a jar, and Jars are essentially zip files, so no point in zipping the data first.
As to storing stuff locally on the client, that's unadvisable, and disallowed due to the java security model anyhow. It is possible to override the security manager but, I'm not sure if this is possible with an applet though. It would undoubtedly not be hassle free.
Another thing that could help is jar caching..
http://java.sun.com/products/plugin/1.3/docs/appletcaching.html this would improve the start up time by caching the jar file on the client, between invocations.

Similar Messages

  • Sharing JVM applet cache among multiple users (crosspost)

    Does anyone have experience sharing a single JVM applet cache among multiple users?
    (This is a crosspost of http://forum.java.sun.com/thread.jspa?threadID=5157018. I know crossposting is frowned on, but it went a week without replies in the plug-in forum.)
    Our browser plugin clients run in a Citrix environment where Windows Terminal Services servers host the client sessions for multiple users and the users only have a thin client hardware device at their desks. We've discovered that as a consequence of optimizing certain aspects of the Citrix environment a user's JVM cache is remote to the server hosting his/her browser session, and that the remote caching is a performance bottleneck.
    Turning applet caching off improves performance considerably, but we'd like to get the cache directed locally to the server hosting the browser session and turn caching back on. But since hundreds of users times tens of servers in the "Citrix farm" adds up to a lot of cache disk space, we're wondering about users sharing a JVM cache. This already happens when one runs multiple browser/plugin sessions locally on a regular workstation. But what about fifty users' separate plugins sharing a single applet cache? It appears from file timestamps that jars'/classes' idx files in a cache are updated when a file is loaded from the cache. What if multiple browser plugins were trying to do this concurrently? Is there a risk of locking, or a data integrity exposure? Or are those idx updates insignificant since they don't affect the last modified date or the sticky cache version number? (Most apps use a 1_5_0_2 JRE, but some apps require a 1.4 plugin.)
    Thanks,
    Brian

    This sounds very similar to a problem that's occuring for us at the moment. Did you ever find some solution to this problem?
    Regards,
    Jon.

  • Sharing JVM applet cache among multiple users

    Our browser plugin clients run in a Citrix environment where Windows Terminal Services servers host the client sessions for multiple users and the users only have a thin client hardware device at their desks. We've discovered that as a consequence of optimizing certain aspects of the Citrix environment a user's JVM cache is remote to the server hosting his/her browser session, and that the remote caching is a performance bottleneck.
    Turning applet caching off improves performance considerably, but we'd like to get the cache directed locally to the server hosting the browser session and turn caching back on. But since hundreds of users times tens of servers in the "Citrix farm" adds up to a lot of cache disk space, we're wondering about users sharing a JVM cache. This already happens when one runs multiple browser/plugin sessions locally on a regular workstation. But what about fifty users' separate plugins sharing a single applet cache? It appears from file timestamps that jars'/classes' idx files in a cache are updated when a file is loaded from the cache. What if multiple browser plugins were trying to do this concurrently? Is there a risk of locking, or a data integrity exposure? Or are those idx updates insignificant since they don't affect the last modified date or the sticky cache version number? (Most apps use a 1_5_0_2 JRE, but some apps require a 1.4 plugin.)
    Thanks,
    Brian

    This sounds very similar to a problem that's occuring for us at the moment. Did you ever find some solution to this problem?
    Regards,
    Jon.

  • How to sign java applet policy to end user?

    i have putted my applet class on server, i want all end users can access it on server, how to sign the java.policy to there JRE?
    can anyone help me?

    I found this some where else. It shows how to sign an applet.
    START OF DOC
    How To Sign a Java Applet
    The purpose of this document is to document the steps required to sign and use an
    applet using a self-signed cert or CA authorized in the JDK 1.3 plugin.
    The original 9 steps of this process were posted by user irene67 on suns message forum:
    http://forums.java.sun.com/thread.jsp?forum=63&thread=132769
    -----begin irene67's original message -----
    These steps describe the creation of a self-signed applet. This is useful for testing purposes. For use of public reachable applets, there will be needed a "real" certificate issued by an authority like VeriSign or Thawte. (See step 10 - no user will import and trust a self-signed applet from an unkown developer).
    The applet needs to run in the plugin, as only the plugin is platform- and browser-independent. And without this indepence, it makes no sense to use java...
    1. Create your code for the applet as usual.
    It is not necessary to set any permissions or use security managers in
    the code.
    2. Install JDK 1.3
    Path for use of the following commands: [jdk 1.3 path]\bin\
    (commands are keytool, jar, jarsigner)
    Password for the keystore is any password. Only Sun knows why...
    perhaps ;-)
    3. Generate key: keytool -genkey -keyalg rsa -alias tstkey
    Enter keystore password: *******
    What is your first and last name?
    [Unknown]: Your Name
    What is the name of your organizational unit?
    [Unknown]: YourUnit
    What is the name of your organization?
    [Unknown]: YourOrg
    What is the name of your City or Locality?
    [Unknown]: YourCity
    What is the name of your State or Province?
    [Unknown]: YS
    What is the two-letter country code for this unit?
    [Unknown]: US
    Is CN=Your Name, OU=YourUnit, O=YourOrg, L=YourCity, ST=YS, C=US
    correct?
    [no]: yes
    (wait...)
    Enter key password for tstkey
    (RETURN if same as keystore password):
    (press [enter])
    4. Export key: keytool -export -alias tstkey -file tstcert.crt
    Enter keystore password: *******
    Certificate stored in file tstcert.crt
    5. Create JAR: jar cvf tst.jar tst.class
    Add all classes used in your project by typing the classnames in the
    same line.
    added manifest
    adding: tst.class(in = 849) (out= 536)(deflated 36%)
    6. Verify JAR: jar tvf tst.jar
    Thu Jul 27 12:58:28 GMT+02:00 2000 META-INF/
    68 Thu Jul 27 12:58:28 GMT+02:00 2000 META-INF/MANIFEST.MF
    849 Thu Jul 27 12:49:04 GMT+02:00 2000 tst.class
    7. Sign JAR: jarsigner tst.jar tstkey
    Enter Passphrase for keystore: *******
    8. Verifiy Signing: jarsigner -verify -verbose -certs tst.jar
    130 Thu Jul 27 13:04:12 GMT+02:00 2000 META-INF/MANIFEST.MF
    183 Thu Jul 27 13:04:12 GMT+02:00 2000 META-INF/TSTKEY.SF
    920 Thu Jul 27 13:04:12 GMT+02:00 2000 META-INF/TSTKEY.RSA
    Thu Jul 27 12:58:28 GMT+02:00 2000 META-INF/
    smk 849 Thu Jul 27 12:49:04 GMT+02:00 2000 tst.class
    X.509, CN=Your Name, OU=YourUnit, O=YourOrg, L=YourCity, ST=YS, C=US
    (tstkey)
    s = signature was verified
    m = entry is listed in manifest
    k = at least one certificate was found in keystore
    i = at least one certificate was found in identity scope
    jar verified.
    9. Create HTML-File for use of the Applet by the Sun Plugin 1.3
    (recommended to use HTML Converter Version 1.3)
    10. (Omitted See Below)
    -----end irene67's original message -----
    To make the plug-in work for any browser you have two options with the JDK 1.3 plugin.
    1) Is to export a cert request using the key tool and send it to a CA verification source like verisign.
    When the reponse comes back, import it into the keystore overwriting the original cert for the generated key.
    To export request:
    keytool -certreg -alias tstkey -file tstcert.req
    To import response:
    keytool -import -trustcacerts -alias tstkey -file careply.crt
    An applet signed with a cert that has been verified by a CA source will automatically be recognized by the plugin.
    2) For development or otherwise, you may want to just use your self-signed certificate.
    In that case, the JDK 1.3 plugin will recognize all certs that have a root cert located in the JDK 1.3 cacerts keystore.
    This means you can import your test certificate into this keystore and have the plugin recognize your jars when you sign them.
    To import self-signed certificate into the cacerts keystore, change directory to where the JDK plugin key store is located.
    For JDK 1.3.0_02: C:\Program Files\JavaSoft\JRE\1.3.0_02\lib\security
    For JDK 1.3.1: C:\Program Files\JavaSoft\JRE\1.3.1\lib\security
    Import your self-signed cert into the cacerts keystore:
    keytool -import -keystore cacerts -storepass changeit -file tstcert.crt
    (the password is literally 'changeit')
    Now, regardless of which method you use, the applet should be recognized as coming from a signed jar. The user can choose to activate it if he / she chooses. If your applet uses classes from multiple jars, for example Apache's Xerce's parser, you will need to sign those jars as well to allow them to execute in the client's brower. Otherwise, only the classes coming from the signed jar will work with the java.security.AllPermission setting and all other classes from unsigned jars will run in the sandbox.
    NOTE: Unless otherwise specified by the -keystore command in all keytool and jarsigner operations, the keystore file used is named '.keystore' in the user's home directory.
    The first time any keystore is accessed (including the default) it will be created and secured with the first password given by the user. There is no way to figure out the password if you forget it, but you can delete the default file and recreate it if necessary. For most operations, using the -keystore command is safer to keep from cluttering or messing up your default keystore.

  • Java applet cache parameter

    I'm sorry if that what I'm looking for is described elsewhere. I couldn't find it. I seem to have a bug with the latest Apple's java implementation (1.5) downloaded with the latest Software Update.
    I have to switch off applet caching for a certain applet and tried to do this via the Java preference app. It seems that it doesn't work using the offered checkbox. Because everytime when I check it and leave the dialog and turn back it's still checked. I tried it with the deployment properties file but had no luck not knowing (finding) the correct parameter to set false.
    As setting the cache size to zero didn't resolve the problem finally I tried to set the cache path to "/dev/zero" what for sure is the worst solution but it works out. Caching is disabled (This way I discovered that trying to write the cache path in the box in the preference pane you can write it only in reverse manner! llun/ved/ No, it's not a joke)
    Anyone could tell me the right parameter for the deployment properties file that I can correct this situation?
    Thanks
    Powerbook   Mac OS X (10.4.6)  

    Unfortunately, this did not resolve the issue. I have been doing a bit more looking and it appears I'm getting a null resource error on reload/refresh:
    public abstract class SimpleWindow extends JInternalFram
       public SimpleWindow()
          initComponents();
    public class FancyWindow extends SimpleWindow
       public FancyWindow()
          initComponents();
    }During startup, it tries to create a new FancyWindow, which calls initComponents(). Inside initComponents is a call to create a JEditorPane.
    The function runs fine, and I am able to create a new JEditorPane; however, when I do:
    jedit.setText("Text Here");I get my null error (tracing through the calls, it looks like it's unable to initialize the editorkit.
    This does not happen on a normal first-time load. It does not happen if I completely close the browser and restart it to re-run the applet, but if I just try to refresh it, it seemingly can't get memory for this?
    Edit: It looks like this may be a regression in 1.6.0_22 and later: 1.6.0_22 HTMLEditorKit throws NullPointerException when reloaded
    Edited by: Jamie.McPeek on Jan 15, 2011 12:28 AM

  • My Upgrading Java Applets Cache won't finish

    I had to reinstall Java 6.0 and each time I try to run something requiring Java, it doesn't load. All I get is a box stating Upgrading Java Applets Chache, it runs about half way and then quits. I am getting very frustrated after working on this for 2 days.
    It says "Please wait while your stored Java Applets are updated for Java SE 6". Runs for about 20 secs and then stops and the box disappears. Does anybody have any suggestions? I am not very computer savvy so please explain in simple terms.
    Thanks

    Hi
    I had the exact same problem. took me days to find the solution, hope it works for you.
    Click on the START button bottom left on the screen, Then look for the CONTROL PANEL button and click, (this should bring up lots of icons for programmes) on some computers its under themes and sttings I think. Click on the JAVA icon this brings up a CONTROL PANEL. Click on SETTINGS at the bottom, then click DELETE FILES. (this took a while to complete on my computer) Just to make sure after you've done this bring up the JAVA CONTROL PANEL again but this time click on ADVANCED. Then at the bottom theres is Miscellaneous, click on this and there should be JAVA QUICK STARTER with a box ticked next to it, Click on the tick and get rid of it then click on OK..
    Try a website that uses Java. the cache box might appear again but just hit cancel. When I tried this i was able to use Java again.
    Hope it works

  • Java Applet Caching for 1.7u51 using pack200

    Hi all,
              Currently, I have implemented an applet and use pack200 to pack my jar to reduce the download time for users to run the applet in their side.
              But even if I add "cache_option" = "plugin" and "cache_archive" attributes, I dont see that my applet being cache when running the applet in java 1.7u51's Cache Viewer under java's control panel.
              Could anyone tell/show me how to cache applet to the cache viewer when running a pack200 applet package? FYI, even if I'm not using pack200 jar, I can't seem to see my applet being cache in
              Cache Viewer.
              I'm running my applet using the deployJava.js
              I'm setting the following in the atttributes clause and
               var attributes = { id:'test_applet',
                       name:'test_applet',
                       code:'TestApplet.class',
                       codebase: '<%=url2TestApplet%>',
                       cache_option: 'plugin',
                       mayscript: true,
                       cache_archive:'test_applet.jar',
                       width:300, height:300} ;
                 var parameters = {};
                 deployJava.runApplet(attributes, parameters, '1.6');
    Best Regards,

    Try [URLConnection.setUseCaches(false)|http://java.sun.com/javase/6/docs/api/java/net/URLConnection.html#setUseCaches(boolean)].

  • Java applet class not found exception for check scan

    I am getting a class not found exception when trying to scan a check into a banking website. The application uses Java and the exception error has the name "com.epaysol.checkscanAppletV2" in the message. I have the latest Firefox and the latest Java installed. I tried going to an earlier version of Firefox and of Java where this app worked in the past and it does not work now in the earlier versions either. So I am now back to the latest version of everything.

    Try to clear the Java cache:
    * http://www.java.com/en/download/help/5000020300.xml
    Control Panel > Java > General tab > "Temporary Internet Files" > Settings > Delete Files
    *XP: C:\Documents and Settings\<user>\Application Data\Sun\Java\Deployment\cache\
    *Vista: C:\Users\<user>\AppData\LocalLow\Sun\Java\Deployment\cache\

  • Shared applet cache location

    In order to reduce both load times and network burden we are looking at the possibility using a common location for the java applet cache. Our internal tests, albeit limited, have proved successful. By specifying a common local network location for storing temporary files in the java control panel we were able to pull the jars for our applet by one initial user and use that cache (on a different pc) by another user. Specifically, we are looking at implementing this in a citrix environment using a local cache on the citrix server (rather than the network location in our tests).
    Does anyone have experience doing this? If so, what potential problems could arise? Is there a better solution?
    Thanks for any advise.

    Can I get help from you?
    If my question was not clear, please point out and I will supply more information.
    Looking forward to getting answer from you - Java Expert :)

  • Why does my Firefox say my java applet is corruped and will,not download for my game

    I play a lot of games on POGO and they tell me that I have to have JAVA and Mozilla Fire Fox for my browser. I have 1 game that I get kicked off of each time I try to play it. I get a notice telling me that my browser says my applet from Java is corrupted and will not download. I have done everything they suggest and nothing works. Mozilla seems to be a terriable choice for me as a browser I have a lot of ppproblems with them getting me to my web pages.. help!!

    Hi,
    Have you tried deleting the Java applet cache from the '''Java Control Panel''' > '''Temporary Internet Files''' > '''Settings''' > '''Delete Files...'''?

  • Delete  user applet cache....(Question) ?

    Hi guy,
    I am looking for any idea or suggestion that how i can delete user's applet cache . Lets suppose i have got new applet, i mean new version with some changes, then how i can automatically delete current cached applet and let the user download with new one from server.
    Thanks in advance.
    Romi

    Hi Romi,
    You wrote:
    I am looking for any idea or suggestion that how i can delete user's applet cacheYou don't have control over the user's browser, but you can specify the cache version of each jar file in your applet. When you have a new release, you can specify a newer version. If the browser/plug-in follows the version convention, it will download the new jar file and not use the older cached file.
    See [Applet Cachine|http://java.sun.com/products/plugin/1.3/docs/appletcaching.html].
    Was this what you were looking for?
    (Reading the document again, I see you could also specify "cache_option" to be "No" which would force reloading every time.)
    -David-

  • Prevent multiple users from updating coherence cache data at the same time

    Hi,
    I have a web application which have a huge amount of data instead of storing the data in Http Session are storing it in coherence. Now multiple groups of users can use or update the same data in coherence. There are 100's of groups with several thousand users in each group. How do I prevent multiple users from updating the cache data. Here is the scenario. User logs-in checks in coherence if the data there and gets it from coherence and displays it on the ui if not get it from backend i.e. mainframe systems and store it in coherence before displaying it on the screen. Now some other user at the same time can also perform the same function and if don't find the data in coherence can get it from backend and start saving it in coherence while the other user is also in the process of saving or updating. How do I prevent this in coherence. As have to use the same key when storing in coherence because the same data is shared across users and don't want to keep multiple copies of the same data. Is there something coherence provides out-of-the-box or what is best approach to handle this scenario.
    Thanks

    Hi,
    actually I believe, that if we are speaking about multiple users each with its own HttpSession, in case of two users accessing the same session attribute in their own session, the actually used cache keys will not be the same.
    On the other hand, this is probably not what you would really like, you would possibly like to share that data among sessions.
    You should probably consider using either read-through caching with the CacheLoader implementor doing the expensive data retrieval (if the data to be cached can be obtained outside of an HTTP container), or side caching with using Coherence locks or entry-processors for concurrency control on the data retrieval operations for the same key (take care of retries in this case).
    Best regards,
    Robert

  • My users cannot see my java applets

    I have a few java applets on my web page, but most of the users cannot see them.
    I have changed my html's with the HTML Converter, hoping to overcome the problem, and got the following codes in my html's:
    In the <OBJECT> tag:
    http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0
    In the <EMBED> tag:
    http://java.sun.com/products/plugin/index.html#download
    Questions:
    1. Will these URL's in the html automatically download, or tell the user about the java installations he needs?
    2. Is it the Java-Plugin or the Java Virtual Machine users have to download to view java programs?
    Even if you don't have the answer I would be grateful if you can tell me if you are able see my java applet. If you can, you should see a flashing text reading "Mixed" in the middle of this page:
    http://medlem.spray.se/kungsgarden/mixed_e.htm
    Best regards,
    Mona

    Questions:
    1. Will these URL's in the html automatically
    download, or tell the user about the java
    installations he needs?Yes, on most browsers, the URLs and html you have written will automatically download the plugin or tell them where to go to get it. As a rule of thumb, if your users are on IE the plugin will automaitcally be downloaded. If your users are on Netscape they will be directed to the url in the embed tag. Your page looks right. It could be the code has an error in it and it is not the html. See my previous reply. Looks for errors and post them for me to see.
    2. Is it the Java-Plugin or the Java Virtual Machine
    users have to download to view java programs?The Java plugin run the Java Virtual Machine. So, they have to download both to view applets, but they come together since the Java Virtual Machine is inside the Java Plugin.

  • How will the applet tag behave for users without Java?

    I am considering using an applet I have created as a splash screen for my website. But I am worried that by doing this I will loose all the visitors that don't have Java. Is there a way I can have the splash screen detect whether or not the user has Java? If so, is there a way I can have the splash screen automatically forward the non-java users to the main page? Maybe I could put something between the <applet></applet> tags?
    �Caleb�

    That doesn't help. Had you read my post more carefully you would have better understood what I wanted. In any case, I have already figured out how to automatically forward the non-Java users to the main page. The only thing I worry about now is about the people who's computers crash whenever they try to run a Java applet.
    �Caleb�

  • Updated to FF20.0 Windows 8 64bit up to date Now I have 4mb ea Caches in C:|users\lee\AppData\Local\mozilla\firefox\profiles\tfw6yc7z.default\CACHE_1_

    updated to FF20.0 Windows 8 64bit up to date
    Now I have 4mb ea Caches in
    C:|users\lee\AppData\Local\mozilla\firefox\profiles\tfw6yc7z.default\CACHE_1_
    C:|users\lee\AppData\Local\mozilla\firefox\profiles\tfw6yc7z.default\CACHE_2_
    C:|users\lee\AppData\Local\mozilla\firefox\profiles\tfw6yc7z.default\CACHE_3_
    C:|users\lee\AppData\Local\mozilla\firefox\profiles\tfw6yc7z.default\CACHE_MAP_9
    I use CCleaner to remove them but when I start Firefox they reappear
    Does anyone know what these are?
    and what they are for?
    Thanks

    That looks normal to me. What version did you have before? The layout of the Firefox cache folder changed some time ago so that more files could be accommodated (i.e., to keep performance acceptable because Windows slows down with huge numbers of files in a single directory).
    ''Edit: Screen shot of file sizes for comparison:''

Maybe you are looking for

  • How do i override the admin password

    my macbook air won't recognize my admin password so I can't add a new printer or do updates

  • Hard drive failed after update. Advise needed.

    First the system hangs. Then it took a long time to boot up. Finally, after a few rounds, the question mark folder appeared on boot up. I command r boot it. Sometimes it says disk has a hardware problem and smart status failing. Sometimes it is ok, b

  • Problem in a Web Intelligence Rich Client Query

    Hi all, I'm facing a problem when i tried to create a query in WebI. I'm using a BI 7.1 Query as source of my Universe. My problems beggin when I put all the objects that I need in the query. The object "Date" that should be my 0Calday, came as "01/0

  • Help...the cursor on my mac is not responding whether by mouse or touch whas happng/

    Ok I nee help I am right in the middle of workig on a chool project and my curser just stop resonding with both my wireless mouse and through touch, please help me?

  • Can I upload videos in Nano?

    Can I upload videos in Nano? Can i watch videos on Nano? I heard the normal ipod can be used to watch videos. I have movies on my computer and I was wondering if I can uploaded and watch it on Nano. Also, is it worth buying? I am planning on buying a