Selvakumar Dharmaraj

Greenhorn
+ Follow
since Dec 12, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Selvakumar Dharmaraj

Yes you are correct, at the instance creation I am starting a timer to fetch the mails from the mail server. And another timer for some other purposes. Even after I explicitly kill the Tomcat server window, the threads hitting the server for mail fetching.
How shall I kill the threads at the server shutdown by programmatically?
Selva.
20 years ago
Hi all,
In my application while starting the Tomcat server I am starting two threads by using 'load on startup' element in 'web.xml'. There is no problem while starting the server. But while shutdown the server I am getting the following warning message as following. Because of that the threads where not killed and doing its function even after the server shutdown.( I am using Tomcat 5.18 build version )
---------------Error----------------------------
INFO: Stoping http11 protocol on 8080 Catalina:type=ThreadPool,name=http8080
18-Mar-2004 16:48:00 org.apache.catalina.core.StandardHostDeployer remove
INFO: Removing web application at context path /okn
18-Mar-2004 16:48:01 org.apache.catalina.logger.LoggerBase stop
INFO: unregistering logger Catalina:type=Logger,host=localhost
18-Mar-2004 16:48:01 org.apache.catalina.logger.LoggerBase stop
INFO: unregistering logger Catalina:type=Logger
----------Started newssheet updation-----------
18-Mar-2004 16:48:13 org.apache.catalina.loader.WebappClassLoader findResourceIn
ternal
INFO: Illegal access: this web application instance has been stopped already (th
e eventual following stack trace is caused by an error thrown for debugging purp
oses as well as to attempt to terminate the thread which caused the illegal acce
ss, and has no functional impact)
18-Mar-2004 16:48:13 org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already (th
e eventual following stack trace is caused by an error thrown for debugging purp
oses as well as to attempt to terminate the thread which caused the illegal acce
ss, and has no functional impact)
---------------Error----------------------------
I am using log4j for my application to log the activities. Could be the problem because of this??!
Kindly help me to solve this problem.
regards,
Selvakumar.
20 years ago
Thanks for your valuable suggestion.
I am trying with both option. I can not get immediate results with my production servers. Because of the bandwidth variation, some time the thread goes for dead or not.
I will update you, If i face any similar problem again with the threads.
---------------------------
isTimerAlive variable used by the monitor thread. While the mail fetching thead starts its process, sets its isTimerAlive value to false and while comes out will set again to true. If the monitoring thread finds the isTimerAlive value in false more than 10 mins, then it will cancel the mail thread and start again.
---------------------------
Hi,
In my application I am starting a java.lang.Timer Thread to fetch the mails from the mail server. The thread will be started in the server startup process. The thread call it's run method at a periodic interval and the method itself call a another method to fetch mails from the mail server.
problem arise here, that the method establishing the connection with the mail server and some times goes for dead because of poor band width.
To avoid I have written a monitor thread to look for this thread, If the thread goes for dead more then 10min then this thread will kill the mail thread and restart it agin.

but, even the monitor thread restarts the mail thread, the mail thread may not be able to establish the connection and again going for the dead.
(using timer.cancel() method...)
If I restarts the server it fetching the mails properly.
Please help me to solve this problem,
selva.
Thank you very much for your guidence.
selva.
21 years ago
Hi all,
I am facing critical problem in the follwing application. The problem is at a point two text fields getting request foucs. So I unable to edit the one.
code>>
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class TestFocus extends JFrame
{
JTextField txtOne,txtTwo,txtThree;
JButton btnSet;
TestFocus()
{
txtOne = new JTextField(15);
txtTwo = new JTextField(15);
btnSet = new JButton("Set");
btnSet.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
setClicked();
}
});
this .getContentPane().setLayout(new FlowLayout());
getContentPane().add(txtOne);
getContentPane().add(txtTwo);
getContentPane().add(btnSet);
setSize(200,150);
setLocation(150,150);
setVisible(true);
}
void setClicked()
{
int out = JOptionPane.showConfirmDialog(this,"Do you want exit?", "choose one", JOptionPane.YES_NO_OPTION);
if(out == 0)
{
String sOne = txtOne.getText();
String sTwo = txtTwo.getText();
if(sOne.equals(""))
{
JOptionPane.showMessageDialog(this, "One is empty", "information", JOptionPane.INFORMATION_MESSAGE);
txtOne.requestFocus();
}
else if(sTwo.equals(""))
{
JOptionPane.showMessageDialog(this, "Two is empty", "information",JOptionPane.INFORMATION_MESSAGE);
txtTwo.requestFocus();
}
else
{
System.exit(0);
}
}
}
public static void main(String[] args)
{
new TestFocus();
}
}
Do the following steps,
1.Enter some values in the first text field.click on the set button with out entering any values in the second text field.
2.This will popup a dialog with "Do you want to exit?".
3.click on the yes button. This will popup a another optionpane with the message that "Two is empty". Click ok, the focus will go to second text area.
4.DON'T ENTER ANYTHING IN THE TEXTFIELDS JUST CLICK ON THE FIRST TEXT FIELD AND THEN CLICK THE SET BUTTON.
5.This will popup message as in the 2nd and 3rd step but in the end you can see both the textfiels got focus.
I can't enter any values in the first textfield after that.
I am running this code on Windows2000,jdk1.3.1
selva
21 years ago