DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33832>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33832

           Summary: context attributes get lost
           Product: Tomcat 5
           Version: 5.5.7
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


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");
thread.interrupt();

Under Tomcat 5.5.4 it works fine, but under 5.5.7 thread == null. It seems the 
context's attributes go lost.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to