This content has been marked as final. Show 8 replies
1. When the JAR is opened.
2. Is the index out of date?
3. Is the index out of date?
4. It loads them.
How can I know if the index is out of date? Are the indexes static entries? Where are they stored?
If the indexes are dynamic, why should I get InvalidJarIndexException then?
The index is constructed as you showed. It would get out of date if the JAR was subsequently updated without re-indexing.
Say we have two jar files a.jar and b.jar
1. a.jar is created first
2. b.jar is created with index=true and a.jar as the indexjar
Do you mean b.jar needs to be re-indexed in any case either of the jar files are updated.
How does the applet loader knows that the indexes needs to be updated as I do not see any other file besides the INDEX.LST inside the jar file which is a plain text file
It doesn't know. It just knows that they are wrong.
I created a sample application to create InvalidJarIndexException but failed to do so
My application consists of an applet which loads three jar files a.jar, b.jar and c.jar. The c.jar being an indexed jar referring to a.jar and b.jar in its pathelement.
I tested by updating each of the jars one by one and deploying the web application. Every time the applet is loading successfully and I did not observe InvalidJarIndexException. The sample application is very very small compared to the application I am working on.
Why is not applet loader complaining in this case. The behavior seems to be inconsistent to me.
But did you update the JAR files in such a way as to invalidate the index?
And what exactly is this InvalidJarIndexException, and who is throwing it? It's not in the JDK.
I am not sure exactly what invalidates the index. The operation I did to update the jar includes
C.jar is a jar which has the index.lst file composed of packages from A.jar and B.jar
After I built C.jar using A.jar and B.jar, I signed B.jar to add certificates in the jar and packed the web application. I guess this should have invalidated the indexes.
The InvalidJarIndexException appears in the java console when the applet loading starts. http://www.kiwidoc.com/java/l/p/java/j2se/1.6/p/sun.misc/c/InvalidJarIndexException