I have an applet based application that uses following classes:
- javax.xml.parsers.DocumentBuilderFactory
- javax.xml.parsers.DocumentBuilder
- javax.imageio.ImageIO
- javax.imageio.ImageWriteParam
- javax.imageio.ImageWriter
- javax.imageio.stream.FileImageOutputStream . . etc
This is how I am initializing the applet:
var attributes = {
codebase : "http://example.com/urlto/jars",
code : "AppletLauncher.class",
archive : "MyApp.jar?v=" + Math.random()
};
var parameters = {"java_arguments": "-Xmx512m"};
deployJava.runApplet(attributes, parameters, "1.6");
The applet makes several GET request. Here are some of the example requests:
[GET] /urlto/jars/META-INF/services/javax.imageio.spi.ImageInputStreamSpi
[HEAD] /urlto/jars/META-INF/services/javax.imageio.spi.ImageInputStreamSpi
[GET] /urlto/jars/META-INF/services/javax.imageio.spi.ImageTranscoderSpi
[HEAD] /urlto/jars/META-INF/services/javax.imageio.spi.ImageTranscoderSpi
[GET] /urlto/jars/META-INF/services/javax.imageio.spi.ImageReaderSpi
[GET] /urlto/jars/META-INF/services/javax.imageio.spi.ImageOutputStreamSpi
[GET] /urlto/jars/META-INF/services/javax.imageio.spi.ImageWriterSpi
[GET] /urlto/jars/META-INF/services/javax.xml.parsers.DocumentBuilderFactory
I read this post, and it mentions about disabling codebase_lookup, that didn't work for me either.
I understand the classloader will first look up the classes in JVM and the applet jar file. If it doesn't find it, it will lookup in codebase and make those request. If it is true, I am using all core classes, why should it make any requests? How can I enforce it to not make these requests?
The applet finally gets initialized when all the requests fail but it takes too long for the applet to startup.
In the application, I am just reading JPEGs in BufferedMemory and writing JPEGs from BufferedMemory.