Scripted shutdown does not force JVM exit
I've noticed that Tomcat's scripted/orderly shutdown does not force the JVM to exit. After running all lifecycle events, the main thread just "falls-through" rather than calling exit(0) to end the JVM. I'm wondering if this is intentional? The result is that any application-spawned Thread-s that are not well managed (i.e. are allowed to continue to run or block after the context is removed) continue to run, and the JVM does not exit. This presents a problem for application deployers, when faced with applications that spawn threads and do not clean them up. The only shutdown option in these cases is to send a SIGINTR to the JVM, as the scripted shutdown does not call exit. Is there a major problem with having the Tomcat shutdown sequence make a final call of System.exit(0), perhaps as a configurable option? I think that if the intention is to shutdown the container, it makes sense that any (now defunct) threads that applications spawned also end. I suppose that this would be a problem for anyone who runs Tomcat in a shared JVM. Opinions please. Brett Randall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Scripted shutdown does not force JVM exit
This email [EMAIL PROTECTED] is no longer available due to heavy spamming. Please visit our website http://www.alestron.com for contact info. Thank you! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Scripted shutdown does not force JVM exit
This email [EMAIL PROTECTED] is no longer available due to heavy spamming. Please visit our website http://www.alestron.com for contact info. Thank you! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Scripted shutdown does not force JVM exit
The JVM exits when there are 0 non-daemon threads running. Tomcat itself shuts down fine with this constraint. If the JVM does not shut down - it is due to bad 3rd party code which creates non-daemon threads and fail to detect a shutdown. The UNIX scripts allow you to capture the process id of the JVM. This is done by setting the environment variable CATALINA_PID to be some file name. Then if you need to kill the JVM - just "kill -9 `cat $CATALINA_PID`" Calling System.exit() has been discussed on tomcat-dev and by vetoed. -Tim Brett Randall wrote: I've noticed that Tomcat's scripted/orderly shutdown does not force the JVM to exit. After running all lifecycle events, the main thread just "falls-through" rather than calling exit(0) to end the JVM. I'm wondering if this is intentional? The result is that any application-spawned Thread-s that are not well managed (i.e. are allowed to continue to run or block after the context is removed) continue to run, and the JVM does not exit. This presents a problem for application deployers, when faced with applications that spawn threads and do not clean them up. The only shutdown option in these cases is to send a SIGINTR to the JVM, as the scripted shutdown does not call exit. Is there a major problem with having the Tomcat shutdown sequence make a final call of System.exit(0), perhaps as a configurable option? I think that if the intention is to shutdown the container, it makes sense that any (now defunct) threads that applications spawned also end. I suppose that this would be a problem for anyone who runs Tomcat in a shared JVM. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Scripted shutdown does not force JVM exit
On Sat, Jan 01, 2005 at 07:45:52PM +1100, Brett Randall wrote: : I'm wondering if this is intentional? The result is that any : application-spawned Thread-s that are not well managed (i.e. are allowed : to continue to run or block after the context is removed) continue to : run, and the JVM does not exit. Yes. This has been discussed several times before; see the archives for details. : This presents a problem for application deployers, when faced with : applications that spawn threads and do not clean them up. The only : shutdown option in these cases is to send a SIGINTR to the JVM, as the : scripted shutdown does not call exit. I'd disagree; it puts responsibility on developers and architects to make sure their applications handle threads properly. There's no need for a container to compensate for poor design. =) Think of "Tomcat hanging on shutdown" as a clue that someone hasn't cleaned up their threads. -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP compilation problem
I answered you yesterday on this. There's generally no reason to post the same question two days in a row. Just wait and see if an answer shows up. Your problem is (still) that you have one or more errors in your JSP. If you can't figure out where the compiler output is, then go and compile the translated servlet manually. -Original Message- From: "Frank W. Zammetti"<[EMAIL PROTECTED]> To: "Tomcat User" Date: Thu Dec 30 06:53:31 PST 2004 Subject: JSP compilation problem >Hello. I'm using Tomcat 5.0.29. Working from home today and trying to >run a working application on my laptop, and I'm seeing an exception when >trying to access the first JSP of the app. Here's the on-screen display: [...] >exception >org.apache.jasper.JasperException: Unable to compile class for JSP [...] ___ Check-out GO.com GO get your free GO E-Mail account with expanded storage of 6 MB! http://mail.go.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP compilation problem
I did not post twice Ryan. If two posts appeared, it is the same problem with the list processor that we've been seeing for weeks now. I did post a reply however... I tried your suggestion and manually compiled. I have NO classpath variable in the environment (I thought this might have been a classpath issue, and I guess it could still be, but I don't see how at this point). I manually put servlet-api.jar, jsp-api.jar and jasper-runtime.jar in /tomcat/common/lib on the classpath and compiled, and it compiles cleanly. So the problem would not appear to be a problem with the generated servlet. Any other ideas? Thank you! -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com Ryan Stewart wrote: I answered you yesterday on this. There's generally no reason to post the same question two days in a row. Just wait and see if an answer shows up. Your problem is (still) that you have one or more errors in your JSP. If you can't figure out where the compiler output is, then go and compile the translated servlet manually. -Original Message- From: "Frank W. Zammetti"<[EMAIL PROTECTED]> To: "Tomcat User" Date: Thu Dec 30 06:53:31 PST 2004 Subject: JSP compilation problem Hello. I'm using Tomcat 5.0.29. Working from home today and trying to run a working application on my laptop, and I'm seeing an exception when trying to access the first JSP of the app. Here's the on-screen display: [...] exception org.apache.jasper.JasperException: Unable to compile class for JSP [...] ___ Check-out GO.com GO get your free GO E-Mail account with expanded storage of 6 MB! http://mail.go.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bad Request
For further details see the attachment. +++ Attachment: No Virus found +++ Kaspersky AntiVirus - www.kaspersky.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP compilation problem
Frank, Forgive me if this has already been suggested, I just came into this thread, midpoint (left my machine on at work ;)). Just for kicks, have you tried a fresh install of Tomcat on that machine? Ryan, I agree with you 100% about people not posting the same question twice and about netiquette in general. However, in this case, the rant is misdirected. After watching this list for the last several years (as well as the dev list), I can say that Mr, Zammetti has never been anything but helpful, knowledgeable, and respectful. I've also been seeing issues with this list in the last few weeks. There were days when it's taken 45 minutes or more for my posts to show up. -Ben On Sat, 2005-01-01 at 10:22, Frank W. Zammetti wrote: > I did not post twice Ryan. If two posts appeared, it is the same > problem with the list processor that we've been seeing for weeks now. > > I did post a reply however... I tried your suggestion and manually > compiled. I have NO classpath variable in the environment (I thought > this might have been a classpath issue, and I guess it could still be, > but I don't see how at this point). I manually put servlet-api.jar, > jsp-api.jar and jasper-runtime.jar in /tomcat/common/lib on the > classpath and compiled, and it compiles cleanly. So the problem would > not appear to be a problem with the generated servlet. Any other ideas? > > Thank you! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Scripted shutdown does not force JVM exit
Hi Tim, QM, thanks for your replies. Tim Funk: > Calling System.exit() has been discussed on tomcat-dev and by vetoed. Yes, thanks, I subsequently found zilla 17000 and the discussion. Tim Funk: > If the JVM does not shut down - it is due to bad 3rd party code which creates non-daemon threads and fail to detect a shutdown. As put in my original post, I totally agree that it is bad form by the webapp to start a long-running Thread and not shut it down during its own shutdown. QM: > I'd disagree; it puts responsibility on developers and architects to make sure their applications handle threads properly. Yes, responsibility has been placed on developers and architects, but a Tomcat admin who deploys applications may not be in a position to hold them all individually to account. Tim Funk: > Then if you need to kill the JVM - just "kill -9 `cat $CATALINA_PID`" Yes, bearing in mind that SIGKILL is a very blunt instrument. It will prevent the JVM from running any shutdown hooks or finalizers. SIGHUP seems to work OK on Linux, but the way the JVM responds to signals from the OS seems to vary. For this reason, I think "killing from the outside" is bad and should be avoided if at all possible. QM: > There's no need for a container to compensate for poor design. =) Agreed, but wouldn't you agree that said poor design of a webapp should not cause (unnecessary) problems with administration of the container? Important to remember that not all Tomcat admins write the webapp code. Source code is often not available. I think this can be argued from the other perspective: the container is already compensating for poor design in the webapp, by allowing stray threads to continue running. Shutdown means shutdown, which should give the container the right to terminate the JVM, no? *** Note that the shutdown sequence in a default 3.2.x jBoss deployment does finally shutdown the JVM. +1 for the (configurable) enhancement described in 17000, based on the fact that System.exit(0) is better than "killing from the outside", in circumstances beyond the Tomcat Administrator's control (when a webapp misbehaves by leaving unterminated threads). I see no good reason to delegate this part of the shutdown sequence to the operating system. Happy to see any arguments for -1. Regards Brett Randall Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can't load server.xml message
I am an experienced Tomcat user who is all of a sudden having trouble running Tomcat on my home machine. I am running Tomcat 5.0.28 and I get a Null Pointer when trying to start Tomcat. I have JAVA_HOME and CATALINA_HOME configured. The very first line in the output says "Can't load server.xml" (actually the second line says the same thing as well.) I tried chaning to the minimal server.xml as well but no luck. The stack trace seems to indicate a NullPointer exception at Catalina.await line 619. I have tried looking this up on the mailing lists, but incredibly, nobody seems to have experienced this problem! Anyways, any insight that could be provided would be greatly appreciated. I've never had this problem before ... TIA, sean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Scripted shutdown does not force JVM exit
On Sun, Jan 02, 2005 at 10:10:02AM +1100, Brett Randall wrote: : Yes, responsibility has been placed on developers and : architects, but a Tomcat admin who deploys : applications may not be in a position to hold them all : individually to account. This is a policy/political problem, then, and not a technology issue. If developers push sloppy, cranky code into a production environment and they're not held accountable for the results, well... Options: 1/ replace the offending developers with people who understand and follow best practices. Supplement this crew with a rigorous testing/QA phase to smoke out any honest mistakes. (If this is a vended/third-party app, put pressure on the vendor.) 2/ Do a CVS pull and use/distribute your own "Thread-Cleanup Tomcat." (Sounds like you already know where to make your change.) 3/ Try to sway the Tomcat developers into folding #2 into the mainline code. (Good luck.) Should #3 pass, I suspect the next request would be for a "JDBC connection cleanup Tomcat" ;) -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't load server.xml message
Hi, You seem to have added quite a few lines into your catalina.sh. The stock script ends at line 287 for me. Can you tell us what modifications you have made? Funny that I can not find how the server.xml is loaded by the DigesterFactory.java nor by Bootstrap.java when I browsed their source code. aka_sergio --- Sean Schofield <[EMAIL PROTECTED]> wrote: > I am an experienced Tomcat user who is all of a > sudden having trouble > running Tomcat on my home machine. I am running > Tomcat 5.0.28 and I > get a Null Pointer when trying to start Tomcat. > > I have JAVA_HOME and CATALINA_HOME configured. > > The very first line in the output says "Can't load > server.xml" > (actually the second line says the same thing as > well.) I tried > chaning to the minimal server.xml as well but no > luck. > > The stack trace seems to indicate a NullPointer > exception at > Catalina.await line 619. I have tried looking this > up on the mailing > lists, but incredibly, nobody seems to have > experienced this problem! > > Anyways, any insight that could be provided would be > greatly > appreciated. I've never had this problem before ... > > TIA, > > sean > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't load server.xml message
Sean Schofield wrote: I am an experienced Tomcat user who is all of a sudden having trouble running Tomcat on my home machine. I am running Tomcat 5.0.28 and I get a Null Pointer when trying to start Tomcat. I have JAVA_HOME and CATALINA_HOME configured. The very first line in the output says "Can't load server.xml" (actually the second line says the same thing as well.) I tried chaning to the minimal server.xml as well but no luck. The stack trace seems to indicate a NullPointer exception at Catalina.await line 619. I have tried looking this up on the mailing lists, but incredibly, nobody seems to have experienced this problem! Anyways, any insight that could be provided would be greatly appreciated. I've never had this problem before ... I had this problem once when I inadvertently moved server.xml from /conf. I think the error message means what it says -- it cant't read the file. Are you sure it is in the right place and the user running tc has permission to read the file? Phil TIA, sean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't load server.xml message
I looked in the wrong source codes. I should have looked at Catalina.java. Here is the link: http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java?rev=1.35&view=log Anyhow, the await() call is at line 578 but thats after the server has started. It is after these lines 562 long t2 = System.currentTimeMillis(); 563 log.info("Server startup in " + (t2 - t1) + " ms"); some test if useShutdownHook... 578 if (await) {.. Check your log file if it has made it this far. aka_sergio --- sven morales <[EMAIL PROTECTED]> wrote: > Hi, > You seem to have added quite a few lines into > your > catalina.sh. The stock script ends at line 287 for > me. Can you tell us what modifications you have > made? > Funny that I can not find how the server.xml is > loaded by the DigesterFactory.java nor by > Bootstrap.java when I browsed their source code. > > aka_sergio > > > --- Sean Schofield <[EMAIL PROTECTED]> wrote: > > > I am an experienced Tomcat user who is all of a > > sudden having trouble > > running Tomcat on my home machine. I am running > > Tomcat 5.0.28 and I > > get a Null Pointer when trying to start Tomcat. > > > > I have JAVA_HOME and CATALINA_HOME configured. > > > > The very first line in the output says "Can't load > > server.xml" > > (actually the second line says the same thing as > > well.) I tried > > chaning to the minimal server.xml as well but no > > luck. > > > > The stack trace seems to indicate a NullPointer > > exception at > > Catalina.await line 619. I have tried looking > this > > up on the mailing > > lists, but incredibly, nobody seems to have > > experienced this problem! > > > > Anyways, any insight that could be provided would > be > > greatly > > appreciated. I've never had this problem before > ... > > > > TIA, > > > > sean > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > __ > Do you Yahoo!? > Yahoo! Mail - Find what you need with new enhanced > search. > http://info.mail.yahoo.com/mail_250 > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't load server.xml message
If you look at the 5.0.28 src distro, you can see that line 519 of Catalina.java includes a reference to the server object. Most likely the npe is happening because the server initialization is failing. The first error ("Can't load server.xml") looks like it is generated by the load method when it can't open the file. Phil sven morales wrote: I looked in the wrong source codes. I should have looked at Catalina.java. Here is the link: http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java?rev=1.35&view=log Anyhow, the await() call is at line 578 but thats after the server has started. It is after these lines 562 long t2 = System.currentTimeMillis(); 563 log.info("Server startup in " + (t2 - t1) + " ms"); some test if useShutdownHook... 578 if (await) {.. Check your log file if it has made it this far. aka_sergio --- sven morales <[EMAIL PROTECTED]> wrote: Hi, You seem to have added quite a few lines into your catalina.sh. The stock script ends at line 287 for me. Can you tell us what modifications you have made? Funny that I can not find how the server.xml is loaded by the DigesterFactory.java nor by Bootstrap.java when I browsed their source code. aka_sergio --- Sean Schofield <[EMAIL PROTECTED]> wrote: I am an experienced Tomcat user who is all of a sudden having trouble running Tomcat on my home machine. I am running Tomcat 5.0.28 and I get a Null Pointer when trying to start Tomcat. I have JAVA_HOME and CATALINA_HOME configured. The very first line in the output says "Can't load server.xml" (actually the second line says the same thing as well.) I tried chaning to the minimal server.xml as well but no luck. The stack trace seems to indicate a NullPointer exception at Catalina.await line 619. I have tried looking this up on the mailing lists, but incredibly, nobody seems to have experienced this problem! Anyways, any insight that could be provided would be greatly appreciated. I've never had this problem before ... TIA, sean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: JSP compilation problem
First, I apologize if I came of sounding rude before. As an infrequent visitor to this list, I wasn't aware that you are a frequent contributor. I also don't seem to have received the other reply you mention. My next thought is that you might have two versions of Java installed. If so, which version is Tomcat using? Are you sure you compiled the servlet with the same one? -Original Message- From: "Frank W. Zammetti"<[EMAIL PROTECTED]> To: "Tomcat Users List" Date: Sat Jan 01 07:22:09 PST 2005 Subject: Re: JSP compilation problem >I did not post twice Ryan. If two posts appeared, it is the same >problem with the list processor that we've been seeing for weeks now. > >I did post a reply however... I tried your suggestion and manually >compiled. I have NO classpath variable in the environment (I thought >this might have been a classpath issue, and I guess it could still be, >but I don't see how at this point). I manually put servlet-api.jar, >jsp-api.jar and jasper-runtime.jar in /tomcat/common/lib on the >classpath and compiled, and it compiles cleanly. So the problem would >not appear to be a problem with the generated servlet. Any other ideas? > >Thank you! > ___ Check-out GO.com GO get your free GO E-Mail account with expanded storage of 6 MB! http://mail.go.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]