Problem with JWS and jar caching

Hi,

I am currently encountering an odd problem with my application (Using JRE 1.5.06).

Here is the scenario. on version 1.0 of my application I have jar file named a.jar that contains Hello.class with a method called hi(). And on another jar let's say x.jar I have aprogram that calls the hi() method in the Hello.class. However I soon upgraded my program version to 2.0 and renamed a.jar to a1.jar at the same time I also extended the hi() method to be hi(String x) and updated the program in x.jar appropriately to call hi(String x) (The jnlp file was also modified accordingly so that a.jar becomes a1.jar). However when I run my application through JWS again, sometimes I get a method not found exception saying that the hi(String x) does not exist (I had to perform a clear cache to solve the problem).

So here is my question:

1. Does JWS retain the copy of the jar file even if you removed it from your jnlp definition (Which means that it still gets loaded in your classpath?)

2. How do I solve this problem?

Thanks.

[1069 byte] By [jedlda] at [2007-10-3 2:41:03]
# 1

Question 1: Yes, it is cached. But no worries about that, if you upload a newer file, the old cached file will be overwritten! You also do not need to call the new .jar file "a1.jar" - "a.jar" would have been ok as well.

Question 2: I do not think the problem you have is JWS itself. I am guessing (!sorry), that the problem lies in your .jnlp file! It might be your fault!

Here comes the guess: I think you have one .jnlp file on your web server. Then you have a 2nd .jnlp file for testing on your local computer. The problem is, the "codebase" (?) parameter points to your .jnlp in the Internet, so whatever changes you make in your local .jnlp - they are completely disregarded because your codebase-link to the internet .jnlp has precedence and you are basically executing the .jnlp file in the Internet and NOT your local .jnlp. I hope I am making sense here.

mhhdudua at 2007-7-14 19:39:35 > top of Java-index,Desktop,Deploying...
# 2
So, how do I remove a jar from the cache?My application used to use jasperreports-1.2.2.jarIt now uses jasperreports-1.2.5.jar, but the 1.2.2.jar is seen first in the webstart cache directory. How can I remove it?Thanks,N.
n_olding_againa at 2007-7-14 19:39:35 > top of Java-index,Desktop,Deploying...
# 3

I cannot avoid the name change since I am using a different version of the jar. Anyway here is another question:

Does the java VM include all the jars in the jar cache in the classpath or does it only include those that you define in your jnlp file?

Message was edited by:

jedld

jedlda at 2007-7-14 19:39:35 > top of Java-index,Desktop,Deploying...
# 4

The runtime will only load the jars listed in the jnlp file.

They will not be in the classpath (can not be loaded by the SystemClassLoader) but are in the JNLPClassPath used by the JNLPClassLoader (in 1.5.0 and earlier) or in the URLClassPath used by the URLCLassLoader that the JNLPCLassLoader extends (in 6.0 or later).

/Andy

dietz333a at 2007-7-14 19:39:35 > top of Java-index,Desktop,Deploying...
# 5

>They will not be in the classpath (can not be loaded by the SystemClassLoader) but are in the JNLPClassPath used by the JNLPClassLoader (in 1.5.0 and earlier) or in the URLClassPath used by the URLCLassLoader that the JNLPCLassLoader extends (in 6.0 or later).

How can I remove a no-longer-used jar from the cache, or otherwise ensure it won't get loaded by these class loaders?

Thanks,

N.

n_olding_againa at 2007-7-14 19:39:36 > top of Java-index,Desktop,Deploying...