Tomcat 4, Suse 9.1, Intel Xeon 64bit processors threading problems.

S

scotty7676

Hey all, had a quick question about the setup in the Subject and
threading in Java. I have a servlet that runs it's own thread using
TimerTask running in tomcat. The problem is, when I go into the tomcat
manager and restart the specific context, the existing thread continues
to run, but then starts a new one also. I know it is still running
because this thread sends me an email once a day. So if I restart the
instance 3 times, I get 3 emails at once. Now get this....it will not
end the threads even when restarting the tomcat server. I actually
have to reboot the server to shut off these runaway threads.

Second issue I have is when I change the web.xml file within my context
(i.e. to add a new servlet definition), and restart the context, it
will not pick up the new web.xml unless I restart tomcat.

Neither one of these issues occur on a 32-bit Xeon Linux server running
an exact copy of tomcat.

Any ideas or has anyone else experience problems like this?

Thanks!
Scott
 
C

Chris Smith

Hey all, had a quick question about the setup in the Subject and
threading in Java. I have a servlet that runs it's own thread using
TimerTask running in tomcat. The problem is, when I go into the tomcat
manager and restart the specific context, the existing thread continues
to run, but then starts a new one also. I know it is still running
because this thread sends me an email once a day. So if I restart the
instance 3 times, I get 3 emails at once. Now get this....it will not
end the threads even when restarting the tomcat server. I actually
have to reboot the server to shut off these runaway threads.

Sounds like you need a ServletContextListener that cancels that task
when the web application is undeployed.
Second issue I have is when I change the web.xml file within my context
(i.e. to add a new servlet definition), and restart the context, it
will not pick up the new web.xml unless I restart tomcat.

Really? I have no explanation for this one. It should work. Maybe you
should provide more information (Tomcat version, confuguration files,
what steps you take to redeploy).

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
M

Markus Neviadomski

Am Thu, 05 Jan 2006 08:59:52 -0800 schrieb scotty7676:
Hey all, had a quick question about the setup in the Subject and
threading in Java. I have a servlet that runs it's own thread using
TimerTask running in tomcat. The problem is, when I go into the tomcat
manager and restart the specific context, the existing thread continues
to run, but then starts a new one also. I know it is still running
because this thread sends me an email once a day. So if I restart the
instance 3 times, I get 3 emails at once. Now get this....it will not
end the threads even when restarting the tomcat server. I actually
have to reboot the server to shut off these runaway threads.

Second issue I have is when I change the web.xml file within my context
(i.e. to add a new servlet definition), and restart the context, it
will not pick up the new web.xml unless I restart tomcat.

Neither one of these issues occur on a 32-bit Xeon Linux server running
an exact copy of tomcat.

Humm...what version of JRE are you running on the 64bit machine? Try to
get the latest one directly from sun. I had a number of issues with
different early releases of the vm.

Markus
 
A

Aray

Chris Smith said:
Sounds like you need a ServletContextListener that cancels that task
when the web application is undeployed.


Really? I have no explanation for this one. It should work. Maybe you
should provide more information (Tomcat version, confuguration files,
what steps you take to redeploy).

to allow tomat reload context after files changed, you must add
"reloadable=true" property to context setting, below is an example

<Context path="/eba" docBase="F:\Aray\workspace\bonceba\bonceba" debug="0"
privileged="true" reloadable="true">
</Context>

if you do not specify property reloadable, the default value is false

automatic reload will make you happy while you are developing, you needn't
to restart tomcat to make you changes become effective. but it take some
system resource, and may cause tomcat crash while lots of changes made in a
short period. So you'd like to set reloadable=false in a publish server
 
C

Chris Smith

Aray said:
to allow tomat reload context after files changed, you must add
"reloadable=true" property to context setting, below is an example

<Context path="/eba" docBase="F:\Aray\workspace\bonceba\bonceba" debug="0"
privileged="true" reloadable="true">
</Context>

if you do not specify property reloadable, the default value is false

All of that is true, but it is irrelevant to Scott. He said, and I
quote: "I change the web.xml file within my context ... and restart the
context" It shouldn't matter what "reloadable" is set to if Scott is
using the Tomcat manager webapp to restart the context.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
S

scotty7676

That is a good idea about the ServletContextListener to cancel the
thread when the context stops. I will try that and see what happens.

I am using JDK 1.4.2 to run tomcat on the machine. I downloaded and
installed this using the list from SUSE's Yast.

Thanks for the ideas, I will try some of this out Monday and see what
happens.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top