I don't completely understand the Dark Arts of how the plugin facilitates the connection between an applet and the jars in the plugin cache... making them part of the applet's classpath. But i do know that with all the auxiliary jars I have, the applet has been finding the classes it needs.
Now I have a rather large spreadsheet, that I wanted to deploy as an uncompressed jar, because it takes too long to stream it over the wire off the server. I wanted to avoid putting the spreadsheet in the applet jar itself. So, I did a jar cvf0, put the spreadsheet in there, included it in my project classpath (e.g. project properties -> compile -> libraries -> add new Jar).
Locally it works great.
For the applet, I added an entry in the <OBJECT> tag on the serving HTML page, and deployed. When I start the applet, the plugin retrieves the file perfectly, and I checked it in the cache... all good.
Problem: getSystemResourceAsStream returns null.
I am moderately experienced with the other Dark Arts of ClassLoaders, but does anyone see a glaring, obvious blunder I am committing? [ January 29, 2008: Message edited by: Pete Ihlenfeldt ]
Joined: Jan 24, 2008
The answer: for anyone who needs it:
I read some tech notes and found that the proper way to do this is NOT to use getSystemResourceAsStream. Rather you should use "getResource".
Obviously you would re-arrange this code with the proper try/catch/finally blocks, but the condensed form is:
hope this helps someone. [ February 05, 2008: Message edited by: Pete Ihlenfeldt ]
subject: Getting non-Java resources from cache jars