Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 90658 invoked from network); 4 Feb 2005 09:07:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 4 Feb 2005 09:07:21 -0000 Received: (qmail 19218 invoked by uid 500); 4 Feb 2005 09:07:03 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 19200 invoked by uid 500); 4 Feb 2005 09:07:03 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 19186 invoked by uid 99); 4 Feb 2005 09:07:03 -0000 X-ASF-Spam-Status: No, hits=3.3 required=10.0 tests=DNS_FROM_RFC_POST,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS,SPF_PASS,WEIRD_QUOTING X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of dhanasu@hotmail.com designates 64.4.53.67 as permitted sender) Received: from bay19-f17.bay19.hotmail.com (HELO hotmail.com) (64.4.53.67) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 04 Feb 2005 01:07:01 -0800 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 4 Feb 2005 01:06:01 -0800 Message-ID: Received: from 210.211.187.74 by by19fd.bay19.hotmail.msn.com with HTTP; Fri, 04 Feb 2005 09:05:37 GMT X-Originating-IP: [210.211.187.74] X-Originating-Email: [dhanasu@hotmail.com] X-Sender: dhanasu@hotmail.com From: "Dhana Sekar Sugunan" To: tomcat-user@jakarta.apache.org Bcc: Subject: tomcat hangs Date: Fri, 04 Feb 2005 14:35:37 +0530 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 04 Feb 2005 09:06:01.0089 (UTC) FILETIME=[BF4F7710:01C50A98] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, I am not sure i am posting this in the correct area. Please bear and advice. My application needs to run a thread contiuously for every 1 hr. I have made the coding in servlet as package invservlet; import javax.servlet.*; import javax.servlet.http.*; import java.io.IOException; import java.util.Timer; import java.util.TimerTask; import java.util.Date; import java.util.Calendar; import sample.Reminder; public class SampleReminder extends HttpServlet{ Timer timer; Date date=new Date(); Calendar calc=Calendar.getInstance(); public void init(){ timer = new Timer(); timer.schedule(new Reminder(),calc.getTime(),1*1000*60*60); } public void doService(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{ } public void destroy(){ timer.cancel(); super.destroy(); } } and the execution file is package sample; import java.util.TimerTask; import java.util.Date; import box.util.SendMail; public class Reminder extends TimerTask{ SendMail sendMail=new SendMail(); public void run() { taskBody(); } public void taskBody() { try{ sendMail.SendMail("192.168.0.33","mail@abc.com","mail1@abc.com","","","Test log mail","This is a test mail for every 1 hour"+new Date()); }catch(Exception e){System.out.println("ERROR IN Remainder");} } } BUT EVERY 2 - 3 DAYS I AM GETTING MY TOMCAT HANGING. I THINK THE PROBLEM IS IN THE THREAD. PLEASE ADVICE. THANKS. Sorry, forget to add some more points which may help for analysation. My application will fetch more than 1000 records for single transaction. And also some times in will be transferred (sendRedirect) to another page with nearly 20 fields of data. Will this also create problem? _________________________________________________________________ MSN Spaces! Your space, your time. http://www.msn.co.in/spaces Your personal haven online. --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org