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

Discussion in 'Java' started by scotty7676@comcast.net, Jan 5, 2006.

  1. Guest

    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
    , Jan 5, 2006
    #1
    1. Advertising

  2. Chris Smith Guest

    <> wrote:
    > 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
    Chris Smith, Jan 5, 2006
    #2
    1. Advertising

  3. 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

    --
    Markus Neviadomski mailto:
    Linux User #291181 WWW: www.dieitexperten.de
    GPG-Key: 0xF5226EB5
    Markus Neviadomski, Jan 5, 2006
    #3
  4. Aray Guest

    "Chris Smith" <>
    ??????:...
    > <> wrote:
    >> 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).


    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

    > --
    > www.designacourse.com
    > The Easiest Way To Train Anyone... Anywhere.
    >
    > Chris Smith - Lead Software Developer/Technical Trainer
    > MindIQ Corporation
    Aray, Jan 6, 2006
    #4
  5. Chris Smith Guest

    Aray <1@2.3> wrote:
    > > 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


    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
    Chris Smith, Jan 6, 2006
    #5
  6. Guest

    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.
    , Jan 6, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike
    Replies:
    2
    Views:
    553
    Roedy Green
    Oct 22, 2003
  2. Alex Hunsley
    Replies:
    17
    Views:
    863
  3. Michael Kreitmann

    Java slow on Xeon processors ?

    Michael Kreitmann, May 24, 2004, in forum: Java
    Replies:
    11
    Views:
    1,136
    Marc Slemko
    May 25, 2004
  4. JohnH.
    Replies:
    1
    Views:
    5,243
    Roedy Green
    Dec 22, 2005
  5. whatnext
    Replies:
    9
    Views:
    417
Loading...

Share This Page