Tomcat hang.

I'm running a complex webapp using tomcat 5.5.4 and after several days, the tomcat just hangs. I can't even get into the manager webapp to see whats going on, so I am guessing that all the threads have been used up. However, catalina.out doesn't show the usual 'all threads busy' message, infact the logs show nothing at all.
The only other wierd thing that happens is that I sometimes have to shut the tomcat down twice before it will properly restart.
This has also happened using tomcat 5.0.28 under JVM 1.4.2.
I believe there is a way I can inspect the current running java threads to see what is happening (from the OS), can someone point me in the right direction please ?
I'm running 5.5.4 on 1.5.0 under redhat
Thanks

Well.. I found the answer to my java thread dump question myself
Simply do a kill -QUIT <process id> from your shell prompt. This dumps the current running threads into catalina.out
I also found the reason why my tomcat was hanging. I'm stunned that there isn't a bigger announcement about this anywhere.
If you are running tomcat (any version) on redhat 9, you need to make sure you have this in your catalina.sh or setclasspath.sh:-
export LD_ASSUME_KERNEL=2.4.1
This stops a bug in redhat 9's NPTL library from hanging or crashing tomcat.

Similar Messages

  • Tomcat hangs with 100% CPU

    I am using Tomcat 4.0 on HPUX 64bit, JDK 1.4, JDevloper 9.2. After running for 3-4 days Tomcat hangs with CPU at 100%. I tried to do a kill -s 3 on tomcats JVM but it doesnt do anything. I had put lot of trace just to see which JSP page or function it hangs. I donot get any consistent page or function. This has been happening for about 6 months now. Can somebody point me how to debug. What should i do so that i can get extra trace from tomcat or from Oracles library. What should i do to fix this problem. My only solution now is to kill -9 and restart tomcat.
    Thanks in advance
    Ravi

    Getting a stacktrace from tomcat's JVM is the best way to see who is causing the CPU usage. Check the release notes for the HP JVM and see if they have anything noted on alternative ways to get a stacktrace.
    Rob
    Team JDev

  • Sometimes Tomcat Hangs when Accessing DB

    Hai all
    am using tomcat mysql
    sometime when i access mysql throught jsp/tomcat my tomcat hangs i dont know why
    can anybody tell me why

    hi,
    as far as i know there is no restriction of connecting to a db only once, u can open the no.of connections according to your wish. But it is recommended that you use single connection for all accessings.
    Tomcat doesn't has the feature of closing connections on its own. so you have to explicitly close the connection,resultset,statement.
    this link may help you
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html

  • Tomcat Hanging

    hi
    We are using Tomcat 3.0 for our application with SQL Server at back end.
    Tomcat hangs after a while. After investigating we found that the actual error is 'Out of memory'.
    Tomcat has 1025M memory allocated to it. The number of users are around 200.
    Could this problem related to the volume of users?
    Also some of the users are logged in remotely and some are logged in locally. Can this be a problem?
    With same code it worked fine for a long time.
    cheers,

    Is the application allocating large amounts of memory for each user (session)? If there is a large amount of data being allocated for each user or any data, is the data getting cleaned up after the user's session expires? A gig sounds like alot but if your app is using lots O memory I suppose it is possible to use the entire heap. I don't think the user's login location would matter but the number of users surely impacts the memory usage. Perhaps you could profile your app and see where the memory is being consumed.

  • Classic JVM hangs when running Tomcat as Windows Service

    Hi!
    I am running a Tomcat 3.2.4 application, written with Java 1.3.1_01.
    To run it as a Windows Service (W2000), I am using a slightly altered version of JavaService, which works fine so far: I can use both the "hotspot" and the "server" JVM's (by selecting the jvm.dll from the respective subfolder of the JDK/jre/bin folder).
    However, when I try to run the same application with the "classic" JVM, the service starts, inside of it Tomcat starts, the first output appears (to the stdout logfile) and after some time Tomcat simply hangs - it doesn't respond to anything anymore, 0% CPU, no output to logfiles anymore, doesn't even respond to normal Tomcat shutdown (e.g. when stopping the service, Windows waits the standard timeout then just kills it).
    Using the classic JVM in a console (e.g. not through JavaService and the classic/jvm.dll) works fine! No problems!
    Anyone here who can offer any help on this?
    Any hints why Tomcat may behave correctly in 5 out of six possible configurations (hotspot-server/client as service or console or classic as console) but hanging with 1 configuration (classic as service)?
    Also, on my W2000 box where this happens, the moment Tomcat hangs, I hear a Windows warning sound being played (the standard warning gong), like it happens when an info dialog pops up - only there is no dialog or whatever and the same moment Tomcat's CPU usage drops to 0% (although the app is still in startup and should do some more work for a few seconds).
    This also doesn't always happen at the same moment during startup, but each time at a different moment, e.g. I can not pin it down to something that is done during startup, it just happens a short while (sometimes earlier, sometimes later) after startup...
    Of course, I could simply say "forget classic, it's being phased out anyway", only: The SAME thing happens with IBM's Java 1.3 VM too (except for the gong sound, which seems to be Sun-JVM specific ;-)! And I would very much like my app to be able to run on IBM's VM (usually I'm using Sun's VMs everywhere, but we have a few stray W2000 boxes with SP2 where Sun's 1.3.1_0x VMs crash with our application [not hang like described above, but really crash, even when run as a console]) and on those boxes the IBM JVM in a console works fine - now I only have to get it working as a service too (and while researching why it hangs I saw that Sun's classic JVM hangs too, so I figured, I first find out why that happens, with the hope that the fix is applicable to IBM's JVM too...).
    Thanks already,
    Johannes

    re setting classpath when using JavaService
    for Win2k, Tomcat 3.3.1a, JDK1.2
    below is my script for creating/installing JavaService
    (based on Alexandria web site version). However, if i
    try to add .jar files to classpath (ie, CP environment
    variable), the service does not work. It only works
    when this single .jar file is there. How can .jar or
    .zip files be added to classpath for this service?
    I've not been working with Tomcar as a service, so can't help directly, but can offer some comments that might be of use (apologies if they aren't!).
    There are Tomcat scripts for V3.1, V3.2 and V4 with the JavaService code from Alexandria SC. Looks like you need one for V3.3 as well?
    In these others, there are fairly long lists of jar files in the classpath, so I would expect it to work correctly for the version you are using (unless there is a problem with the way that classloaders are involved, which is something that is known to get in the way for some app server-based programs).
    I would expect the classpath to work if changed from what you have listed to something like the following:
    set CP=%TOMCAT_HOME%\lib\tomcat.jar;%TOMCAT_HOME%\lib\jaxp.jar;%TOMCAT_HOME$\lib\other_library.jar
    Is that what you have tried to do, and found problems?
    Does this version of Tomcat bundle all of its resources into a single jar file (tomcat.jar), or is that a file you have created yourself?
    Is the problem found when loading and starting Tomcat itself, or from within your server-based application?
    Does it fail to load a 'standard' Tomcat library archive, or a jar file containing your own program code?
    set CP=%TOMCAT_HOME%\lib\tomcat.jar
    echo %CP%
    JavaService.exe -install "Jakarta-Tomcat"
    %java_home%\jre\bin\classic\jvm.dll
    -Djava.class.path=%CP% -Dtomcat.home=%TOMCAT_HOME%
    -Djava.security.policy=%TOMCAT_HOME%/conf/tomcat.policy
    -Xms128m -Xmx128m -start
    org.apache.tomcat.startup.Main -params start -stop
    org.apache.tomcat.startup.Main -params stop -out
    %TOMCAT_HOME%\logs\stdout.log -err
    %TOMCAT_HOME%\logs\stderr.log
    Regards,
    John Rutter

  • Tomcat problem on redhat 9

    Hello, i have installed tomcat 4.0.1 in redhat9 and it worked properly for a while, i used to start it and stop it many times ,but now it is listening but not giving a response,the mozilla browser just says "Transfering Data from localhost:8080" and it loops forever, can any one help me please?

    Hm. I don't know why a fresh, unmodified version of tomcat hangs. I haven't even added network stuff yet.
    My guess is that maybe there are bugs in tomcat that causes this, or that there are bugs in linux itself.
    Check out the thread I posted earlier. You may try the ThreadPool patch from that thread.
    Plz, if you find anything, tell us in this forum.
    Ping

  • JRE 1.5.0 and Tomcat 1310 iterations?

    From:
    http://java.sun.com/j2se/1.5.0/relnotes.html
    there is an item that states the foll:
    Tomcat hangs after 24 hours (1310 iterations) on Solaris with both -client and -client -Xcomp flags. This problem is fixed in Tomcat/Apache versions 4.1.30 and 5.0.17
    Can anyone shed a light on this item? I am unable to find any info anywhere and we need to support jre 1.5.0 with the affected version of the solaris platform and tomcat.
    Thanks
    Divyesh

    True, but that would require JDK and not jre install, and I would still not know what the issue is about.
    Sun certainly has not made it clear as to what the issue nor could I find anything about this on apache.
    Any ideas?

  • Unhandled exceptions and tomcat...

    I have an app which occasionally causes null pointer exceptions because of invalid data coming out of my database. Currently I don't trap this in any way, because the condition is pretty rare.
    However, I've noticed that after a while, my tomcat hangs, and sometimes I get the 'all threads busy' error.
    So the question is, what happens to tomcat threads that crash as a result of an unhandled exception ? Are they lost forever ? Could this be whats causing my problem ?

    I'd go find the root cause of that NPE and fix it if I were you.
    %

  • I m unable to update a table from a servlet

    Hi,
    I am using a servlet to select,insert and update values in to the database. I am using Oracle 9i as my backend.
    I m successfully able to implement select and insert query. But as soon as do the update or delete my computer gets hanged.
    My statement is or scroll sensitive and concur updatable type. I tried to use the servlet removing these attributes. But it still dosent work. Plz help me out on this.
    The query works perfectly fine when i run it in sql plus.

    The query which is printed runs perfectly in sql, but when executed in the servlet, the entire screen frezees, and tomcat hangs. I haved tried both with executeUpdate and execute methods.
            if (empCode.trim().equals("null")) empCode="";
            if (partyCode.trim().equals("null")) partyCode="";
            System.out.println(empCode + "  "  + partyCode);
            query = "update q010a set persnr1='" + empCode + "', konto='" + partyCode
                  + "', name_1='" + name1 + "', name_2='" + "', name_3='" + name3
                  + "', postfach='" + poBox + "', kzstrasse='" + streetName + "', kzbereich='" + areaName
                  + "', kzstadt='" + townName + "', kztaluka='" + talukaName + "', kzgebeit='" + districtName
                  + "', kzstaat='" + stateName + "', land='" + countryName + "', plz='" + zipCode
                  + "', telefon='" + phoneNo + "', email='" + emailid
                  + "' where verabrnr='" + appNo + "' and besuch_nr='" + visIdN0 + "'";
           System.out.println(query);
           boolean val  = st.execute(query);Please tell, what the error is.

  • Oracle getPrimaryKeys crash!

    Hi all, hope I can get some help with this really annoying problem
    I am writing some code to analyse DatabaseMetaData and display information about a database. Everything from schemas, catalogs, tables, fields and indexes works... EXCEPT...
    getPrimaryKeys... This works in mySQL fine, but with Oracle, it dies a horrible, horrible death..
    The error I get (after a long time of tomcat hanging) is below.
    Any help would be GREATLY appreciated. Code can be supplied if neccesary
    Cheers
    Dan
    java.sql.SQLException: ORA-04031: unable to allocate 60 bytes of shared memory ("shared pool","SELECT NULL AS table_cat,
    ...","sql area","optdef : apalks")
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1311)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:595)
    at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1600)
    at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1758)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1805)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:320)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:278)
    at oracle.jdbc.driver.OracleDatabaseMetaData.getPrimaryKeys(OracleDatabaseMetaData.java:2805)

    To be honest, I have no idea. I didn't create the database, and I haven't used it before so I'm not sure about the sequences and triggers. All I want to do is query the meta data about the primary keys.
    But trying getGeneratedKeys might be a good idea. The boss is also trying to bump up the shared memory pool size now.
    Thanks for all the suggestions thus far people. Much appreciated. Keep em coming if you have any bright sparks :)

  • Accessing xindice database for project from servlet in JWSDP1.2

    Hi,
    We build a Webservice with JWSDP which should store incoming xml data in the xindice database included in the JWSDP1.2.
    Trying to create a new collection, Tomcat hangs when we try to get the connection manager instance.
    CollectionManager service = (CollectionManager) collection.getService("CollectionManager", "1.0);
    Tomcat even hangs when we try to get the services collection with Service[] service = collection.getServices();
    regards Axel

    works with 1.3. uff :cool:

  • Non ending thread

    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","[email protected]","[email protected]","","","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?

  • Tomcat get hang up

    Tom cat get hang up any time ,
    the cursor also stop blinking .
    no specific optarion ,noting exceptoion on prompt .
    pls help it ..

    What is the OS in which your Tomcat is installed and tell me the version also.
    I am using tomcat 5.5.10 in red hat linux.

  • Tomcat is Hanging - URGENT..URGENT

    Hai,
    We converted POWER BUILDER Product into JSP. It is working fine and we are using Tomcat Webserver. The problem is, after doing some core operations Tomcat Server is hanging. What is the actival problem exists ? Any memory variables are available in Tomcat ?
    Please Help me
    Regards
    Suresh

    it cn be beacose same data base connection hold & hang up ..

  • Tomcat is hanging as a stopping status when we try to stop it.

    Hi,
    We are using BOE 3.1 SP6 Patch 1. We believe that our Tomcat ( version 7.0.40 ) has a problem because we could not view BO Infoview Screen one or
    two times in every months.So we have to restart the Tomcat. If Tomcat start successfully, our BO Infoview screen can be viewed and working in success.But for most of times, when we restart Tomcat, it stays as a stopping status and not getting stopped status.
    We wonder that why Tomcat's status is stopping?
    Do you have any idea about this case?
    I have attached some of log files of Tomcat belonging to when we face this problem.
    Best Regards,
    Cihangir

    Hi Hrishikesh,
    Our Maximum memory pool has not been entered any value so far, now we set it to 2048 MB.
    Our MaxPermSize is 320 MB as before. We have not changed it.
    Our Server has 8 Cores, 32 GB RAM,
    Thanks for your helps,
    My Best Regards,
    Cihangir

Maybe you are looking for