dcsimg
Why do I get old static final int values after JSP recompilation? (Tomcat 4.x)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, December 17, 2002 07:01 AM

I found this issue which should not be a problem most of the time but is still surprising: One of the classes I use in the web application defines some public final static int constants that I use on some pages. I changed the values of some of them, but even when I updated ("touched") the JSP files that use them and restarted Tomcat, the recompiled pages use old values. Actually, I found no way to get rid of this "classloader persistence" - removing the context entirely, damaging the application by removing the class that defines those constants (to cause NoClassDefFoundError and thus force this class to reload after putting it back), whatever. Why? I understand it usually has little relevance since fin   More>>

I found this issue which should not be a problem most of the time but is still surprising:



One of the classes I use in the web application defines some public final static int constants that I use on some pages. I changed the values of some of them, but even when I updated ("touched") the JSP files that use them and restarted Tomcat, the recompiled pages use old values. Actually, I found no way to get rid of this "classloader persistence" - removing the context entirely, damaging the application by removing the class that defines those constants (to cause NoClassDefFoundError and thus force this class to reload after putting it back), whatever. Why?



I understand it usually has little relevance since final static int s are used for constants and are compiled as values into the classes that use them, so they should not change, but I had to change them while still developing the application and ran into this problem.

   <<Less

Re: Why do I get old static final int values after JSP recompilation? (Tomcat 4.x)

Posted By:   Sebastian_Beyer  
Posted On:   Wednesday, December 18, 2002 04:46 AM

Hi Artur,

did you delete the work-directory of your tomcat? Explicitly, did you delete the generated servlet-class, that belongs to your JSP? If not you should try...


Greetings from Hamburg/Germany


Seppo
About | Sitemap | Contact