Bug 33832 - context attributes get lost
Summary: context attributes get lost
Status: RESOLVED DUPLICATE of bug 33463
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.5.7
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2005-03-03 18:35 UTC by Oleg Mints
Modified: 2005-03-05 13:02 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Mints 2005-03-03 18:35:53 UTC
I use ServletContextListener to start/stop of one internal working thread.

In contextInitialized(ServletContextEvent event) the Thread object will be 
created and started, than registred as an attribute:

ServletContext context = event.getServletContext();
MailerThread mailerThread = new MailerThread(...);
context.setAttribute("de.mints.interrisk.mail.thread", mailerThread) 

In contextDestroyed(ServletContextEvent event) the thread must be interrupted:

ServletContext context = event.getServletContext();
Thread thread = (Thread)context.getAttribute("de.mints.interrisk.mail.thread");

Under Tomcat 5.5.4 it works fine, but under 5.5.7 thread == null. It seems the 
context's attributes go lost.
Comment 1 Oleg Mints 2005-03-03 18:40:07 UTC
It working under: Tomcat 5.5.4 / JDK 1.4.2_7
but not under Tomcat 5.5.7 / JDK 1.5.0_1
Comment 2 Mark Thomas 2005-03-05 22:02:59 UTC

*** This bug has been marked as a duplicate of 33463 ***