File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLClassloader in webapp

 
Askar Kalykov
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using url-classloader in my webapp.
In general, there is class A:


on ServletContextListener.init() A.init() is called, and on ServletContextListener.destroy() A.destroy() is called.

Objects created by that classloader are used in TimerTasks (no references to TimerTasks are stored).
Before calling A.destroy(), I'm calling .cancel() on Timer, that invokes those TimerTasks.

The problem is: on webapp unloading Tomcat erases all but jars, that has been used, when creating classloader in createClassLoader() method, therefore Tomcat can not fully unsinstall or redeploy that webapp.

How can I unload objects and classes loaded by my classLoader?
Is this problem somehow related to Timer, that I'm using for working with that objects?
[ October 22, 2006: Message edited by: Askar Kalykov ]
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you use standard URL class loader? Are your classes in http:// form? If you use file:/ based URL then classes can be locked and can't be deleted.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic