Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Self-Running Object Inst. by Servlet. Interfering with Servlet Reloading

843833Aug 7 2001 — edited Aug 8 2001
Hi everyone.

I have a Servlet that instantiates an instance of another class that I defined. It is a self-running data-structure, using Threads to continuously update it based on DB information... very neat.
My problem is, when I make a modification to my servlet, I have to restart Tomcat in order for it to work properly. (I think what is going on is that the JVM keeps running the other object, so when I try to call the servlet again, i get a wierd message "....who added this?")
So i want to know how i can fix this problem. One idea I had is to call the self running object's stopRunning() method from the servlet's destroy() method, in hopes that in reloading the servlet, tomcat will first call destroy() on the one already in memory. I haven't tried that yet, though, because I don't have a stopRunning method yet, and I thought i'd get some ideas before busting out more code :)

What do you think????

Thanks,
X___________
tha PhatBarren
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 5 2001
Added on Aug 7 2001
2 comments
96 views