title: Java Class.forName().newInstance() method creates instance of stale Java class
body: <p>I'm developing an enterprise project with Liferay 6.1 EE and tomcat 6. Coding is in local PC, but deploy to a CentOS virtual machine. </p>
  
  <p>There's a custom <code>.jar</code> file to handle some special logic with URL redirecting. After I modified a Java class, recompile and built the new <code>.jar</code>, replaced the existing <code>.jar</code> file on the vm. (located in <code>{$tomcat}/lib/ext</code> and <code>{$tomcat}/webapps/ROOT/WEB-INF/lib</code>) and restarted tomcat, I found it was still using the previous code logic. I'm sure that the <code>.jar</code> file was updated on VM (grabbed from VM, and decompiled the <code>.class</code>, the code was there)</p>
  
  <p>This class is instantiated by Class.forName().newInstance method, and put to a static final map in another custom filter.</p>
  
  <p>Clearing <code>{$tomcat}/temp</code> and <code>{$tomcat}/work</code> folders didn't help, is it possible that this stale class is cached in JVM ? If yes how can I remove the stale content ?</p>
  
  <p>Any insight is appreciated. </p>