Re: Tomcat service crashes "unexpectedly", no trace in logs
David, I have been chasing a similar problem for weeks now with tomcat 5.0.28 on Linux. It occurs sporadically, sometimes a couple times a day, sometimes after weeks. I see no errors in the log file and no core dumps. At first I thought it was the JVM crashing but I've tracked it down to the JVM shutting down normally somehow, as if somewhere System.exit was being called. I put a security policy in place and enabled the security manager to prevent the System.exit call so I should find the culprit in my log files the next time its called. To test if this is what's happening, add a shutdownHook when your app starts like this: public class ExitListener implements ServletContextListener { public void contextInitialized(ServletContextEvent event) { Runtime.getRuntime().addShutdownHook(new ExitListenerThread()); System.out.println("ExitListener installed shutdown hook"); } public void contextDestroyed(ServletContextEvent event) { System.out.println("ExitListener.contextDestroyed()"); } } public class ExitListenerThread extends Thread { public void run() { System.out.println("ExitListenerThread running!!!"); System.out.println("current time is: " + new java.util.Date()); } } Hope this helps. Greg On Jan 14, 2005, at 2:04 PM, David Vandaele wrote: Hi, We're experiencing Tomcat crashes during stresstesting of a webapplication. Situation: Tomcat runs as a Windows service. During stresstests the Tomcat-services suddenly ends "unexpectedly". The Windows eventlog logs states something like: "...service ended unexpectedly..." The problem is not easily or consistently reproducable... When I look at all the logs of Tomcat and of our webapplication, no mention of an exception or error or crash whatsoever !(?) (They all just stop abruptly) First I thought it was an OutOfMemoryError problem. I forced an OutOfMemoryError myself by limiting the memory of the JVM of Tomcat severely. But then I could see loggings of an OutOfMemoryError in the Tomcat stderr-log, which is not what I expected because I didn't expect any loggings of a crash at all... The problem only *seems* to occur when the servermachine is completely left alone (not logged in or locked) Additionally, it usually occurs after between 30-70 minutes or so. When I keep monitoring the machine while the same tests are running the crash doesn't seem to occur ?! Could it be a power-saving issue, like e.g. with the network-adaptor ? Then I would not expect a crash, but a stacktrace ? I tried adding a try-catch(Throwable) around a method where everything starts (the process method of my Struts ActionServlet). I've been trying to reproduce the problem since, but as I mentioned, it's not consistently reproducable... I've searched the net trying to find related problems, or a JVM problem of some kind with this version, haven't been successful though... If it is a problem with bad memory, I would expect to see different behaviour, like more random crashes, not only of the Tomcat service... Environment: Tomcat 4.1.29, JDK 1.4.2_03, Windows 2000ProSP4, bi-processor Xeon machine. Any help/advice/ideas is really welcome and appreciated ! Kind regards, David - 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: xalan problem with security manager
Michael- If you suspect the error is related to the security manager, run tomcat with the following environment variable set: export CATALINA_OPTS=-Djava.security.debug=access:failure This will put logging for the security manager in your catalina.out file (or your applications log file if you defined a new logger for your webapp). It will show all the access checks (in short form) and a stack trace and domain that caused the failure when a failure occurs. It will tell you what permission was denied, and the codebase it was denied to. I used it extensively yesterday to set up my security policy. For more info see http://jakarta.apache.org/tomcat/tomcat-5.0-doc/security-manager- howto.html Greg On Jan 14, 2005, at 4:58 AM, Michal Kwiatek wrote: Hi all, I can't make xalan work when I run tomcat with security manager. All I get is java.lang.ExceptionInInitializerError (see stack trace below). It works fine without security manager. Has any of you used xalan on tomcat with secuirity manager? What privileges should I grant to the code? I tried: grant { permission java.util.PropertyPermission "*", "read"; permission java.net.SocketPermission "*", "connect"; permission java.lang.RuntimePermission "getClassLoader"; }; grant { permission java.io.FilePermission "${catalina.home}/temp/*", "read, write, delete"; }; But it doesn't help. Any ideas? Thank you very much in advance, Michal. My setup is tomcat 5.0.28 on jdk 1.4.2_06, it behaves the same on win xp or linux. Here's the code: File xmlFileObj = new File(xmlFile); File xslFileObj = new File(xslFile); this.out = out; TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new StreamSource(xslFileObj)); transformer.setParameter("serviceName", serviceName); transformer.transform(new StreamSource(xmlFileObj), new StreamResult(out)); out.flush(); And the stack trace. javax.servlet.ServletException org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageCon t extImpl.java:825) org.apache.jasper.runtime.PageContextImpl.access$1100(PageContextImpl.j a va:64) org.apache.jasper.runtime.PageContextImpl$12.run(PageContextImpl.java: 74 5) java.security.AccessController.doPrivileged(Native Method) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageConte x tImpl.java:743) org.apache.jsp.tree_jsp._jspService(tree_jsp.java:98) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j a va:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja v a:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso r Impl.java:25) java.lang.reflect.Method.invoke(Method.java:324) org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:239) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:500) org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java: 268) org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.ja v a:157) root cause java.lang.ExceptionInInitializerError java.lang.Class.forName0(Native Method) java.lang.Class.forName(Class.java:141) org.apache.xalan.serialize.SerializerFactory.getSerializer(SerializerFa c tory.java:131) org.apache.xalan.transformer.TransformerImpl.createResultContentHandler ( TransformerImpl.java:1048) org.apache.xalan.transformer.TransformerImpl.createResultContentHandler ( TransformerImpl.java:975) org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl. j ava:1124) org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl. j ava:1107) circeos.xml.XslHtmlConverter.Display(XslHtmlConverter.java:29) org.apache.jsp.tree_jsp._jspService(tree_jsp.java:84) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j a va:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja v a:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso r Impl.java:25) java.lang.reflect.Method.invo
Tomcat 5.0.28 exiting randomly
Hello- I have been tracking down this problem for a while now and finally have some more information. I am using Tomcat 5.0.28 on RedHat EL 3.0 with JDK 1.4.2_06 and we occasionally find that Tomcat is no longer running in our production server. It runs fine for days, then suddenly the java process disappears. I initially thought the JVM was crashing, but could not find any core files or log messages. Then someone suggested to me that I install a shutdown hook with Runtime.addShutdownHook to see if somewhere System.exit() is being called. Well, it turns out that it is. Unfortunately, I don't think I can tell in my shutdown hook where the System.exit() call occurred. I have reviewed our application code numerous times looking for System.exit() calls and have not found any. Is it possible that it is coming from Tomcat itself, or someone is able to issue a shutdown command externally somehow? Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
best way to setup multiple instances of tomcat
Hello- I currently am using Tomcat 5.0.28 for both our production and test server. Currently, I have one copy of the tomcat distribution in /usr/local/tomcat, two different server.xml files (server-prod.xml and server-test.xml) in /usr/local/tomcat/conf and two different scripts in /etc/init.d to start the prod and test servers. Each server has its own directory under /usr/local/tomcat/conf/Catalina, and the ROOT.xml file in each case defines a different log file for the application. Everything seems to work fine, but both instances are writing to /usr/local/tomcat/logs/catalina.out. My question is can the filename "catalina.out" be controlled so each instance writes to a different file? Also, I'm thinking that I probably don't want them both running off the same install directory because what if I want to test a new version of Tomcat in the test environment? The only thing I'm saving by having them both run from the same directory is a few megs of space right? Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat/JVM crashes on Linux
That's a good idea, I'm going to try that. Its a cheap way to confirm or deny my suspicions. Thanks! On Dec 21, 2004, at 9:20 AM, Eric Rotick wrote: I've not tried this myself but you could add a Runtime.addShutdownHook and get it to print out anything which will give you a clue. On Tue, 21 Dec 2004 08:47:49 -0500, Greg Lappen <[EMAIL PROTECTED]> wrote: Well, turns out the RAM is fine in the server. Our hosting provider tested it last night and said it checked out fine. Is there any other reason that the JVM/Tomcat would just exit like this? Could System.exit() be called somewhere? Isn't there a way to prevent System.exit() from being called? I know I'm grasping at straws, but what else is there to do in this situation? Greg On Dec 20, 2004, at 1:57 PM, Eric Rotick wrote: I had a similar problem with an almost identical setup to yours which turned out to be bad memory. An extra 1GB stick was added which had a bad section in the top of the memory map. This memory only got used when things got busy so everyone suspected some threading issue. We got lucky and spotted something totally absurd in the logs which prompted a memtest86 run and hey presto we got our answer. On Mon, 20 Dec 2004 13:28:56 -0500, Wade Chandler <[EMAIL PROTECTED]> wrote: Greg Lappen wrote: Hello- Has anyone had a problem with Tomcat 5.0.28 crashing on Linux with no error messages? My production server running with JDK 1.4.2_06, RedHat EL 3.0 just crashes, no core dump, no errors in catalina.out, no clues. Sometimes it goes for days, sometimes it happens several times in one day. I am running the tomcat process behind Apache 2 with mod_proxy. Setting "ulimit -c unlimited" in the catalina.sh startup file still did not produce a core file. If nobody else has experienced this, do you have any suggestions on how to debug it further? Thanks, Greg --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] I'm using the same setup as you less Apache2. I use tomcat as the web server. Using TC5.0.28 and JDK1.4.2_06, and I have yet to have the server crash once. Not much help, but might give you some clues where to look. Connector log (mod_proxyassuming you mean you're using the new connector code)is there anything in the Apache2 log? I assume from your post you mean that the java process just completely goes away. You might find (depending on the running directory of the java process running tomcat) a pid dump log file or something...not sure if the vm produces one of these or not. You also might check in /var/log/messages file to see if for some reason the kernel or some lib got some error it logged. Wade - 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] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat/JVM crashes on Linux
Well, turns out the RAM is fine in the server. Our hosting provider tested it last night and said it checked out fine. Is there any other reason that the JVM/Tomcat would just exit like this? Could System.exit() be called somewhere? Isn't there a way to prevent System.exit() from being called? I know I'm grasping at straws, but what else is there to do in this situation? Greg On Dec 20, 2004, at 1:57 PM, Eric Rotick wrote: I had a similar problem with an almost identical setup to yours which turned out to be bad memory. An extra 1GB stick was added which had a bad section in the top of the memory map. This memory only got used when things got busy so everyone suspected some threading issue. We got lucky and spotted something totally absurd in the logs which prompted a memtest86 run and hey presto we got our answer. On Mon, 20 Dec 2004 13:28:56 -0500, Wade Chandler <[EMAIL PROTECTED]> wrote: Greg Lappen wrote: Hello- Has anyone had a problem with Tomcat 5.0.28 crashing on Linux with no error messages? My production server running with JDK 1.4.2_06, RedHat EL 3.0 just crashes, no core dump, no errors in catalina.out, no clues. Sometimes it goes for days, sometimes it happens several times in one day. I am running the tomcat process behind Apache 2 with mod_proxy. Setting "ulimit -c unlimited" in the catalina.sh startup file still did not produce a core file. If nobody else has experienced this, do you have any suggestions on how to debug it further? Thanks, Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] I'm using the same setup as you less Apache2. I use tomcat as the web server. Using TC5.0.28 and JDK1.4.2_06, and I have yet to have the server crash once. Not much help, but might give you some clues where to look. Connector log (mod_proxyassuming you mean you're using the new connector code)is there anything in the Apache2 log? I assume from your post you mean that the java process just completely goes away. You might find (depending on the running directory of the java process running tomcat) a pid dump log file or something...not sure if the vm produces one of these or not. You also might check in /var/log/messages file to see if for some reason the kernel or some lib got some error it logged. Wade - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Request an app test (free beer!)
On Mac OS X, the output is "Mac OS X" Greg On Dec 20, 2004, at 5:26 PM, Frank W. Zammetti wrote: I was informed last OT post I made that the subject should always include the word "beer". I added the "free" to get your attention :) I'm working on something for which I need to know what the os.name property on various OS's is. I would greatly appreciate it if some folks could try the following: public class test { public static void main(String[] args) { System.out.println(System.getProperty("os.name")); } } I'm particularly interested in various *nix variants, Linux, Mac and such. Windows I already have answers for (although some verification to be sure nothing fishy is going on wouldn't hurt). If you could just post your OS and what the result was, I would greatly appreciate it. Thanks in advance! -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.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: Tomcat/JVM crashes on Linux
What kind of load does your application handle? I am not processing a HUGE amount of requests, but we server about 6000 visitors a day, 15,000 pages. Greg On Dec 20, 2004, at 1:28 PM, Wade Chandler wrote: Greg Lappen wrote: Hello- Has anyone had a problem with Tomcat 5.0.28 crashing on Linux with no error messages? My production server running with JDK 1.4.2_06, RedHat EL 3.0 just crashes, no core dump, no errors in catalina.out, no clues. Sometimes it goes for days, sometimes it happens several times in one day. I am running the tomcat process behind Apache 2 with mod_proxy. Setting "ulimit -c unlimited" in the catalina.sh startup file still did not produce a core file. If nobody else has experienced this, do you have any suggestions on how to debug it further? Thanks, Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] I'm using the same setup as you less Apache2. I use tomcat as the web server. Using TC5.0.28 and JDK1.4.2_06, and I have yet to have the server crash once. Not much help, but might give you some clues where to look. Connector log (mod_proxyassuming you mean you're using the new connector code)is there anything in the Apache2 log? I assume from your post you mean that the java process just completely goes away. You might find (depending on the running directory of the java process running tomcat) a pid dump log file or something...not sure if the vm produces one of these or not. You also might check in /var/log/messages file to see if for some reason the kernel or some lib got some error it logged. Wade - 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: Tomcat/JVM crashes on Linux
When you say the problem was similar, did you also have no core dump or log messages, just a missing JVM process? I am asking our hosting provider to test the server's RAM - I was going to do this before but since no other process ever crashes (Apache, MySql, etc.) we didn't think it could be the RAM. Greg On Dec 20, 2004, at 1:57 PM, Eric Rotick wrote: I had a similar problem with an almost identical setup to yours which turned out to be bad memory. An extra 1GB stick was added which had a bad section in the top of the memory map. This memory only got used when things got busy so everyone suspected some threading issue. We got lucky and spotted something totally absurd in the logs which prompted a memtest86 run and hey presto we got our answer. On Mon, 20 Dec 2004 13:28:56 -0500, Wade Chandler <[EMAIL PROTECTED]> wrote: Greg Lappen wrote: Hello- Has anyone had a problem with Tomcat 5.0.28 crashing on Linux with no error messages? My production server running with JDK 1.4.2_06, RedHat EL 3.0 just crashes, no core dump, no errors in catalina.out, no clues. Sometimes it goes for days, sometimes it happens several times in one day. I am running the tomcat process behind Apache 2 with mod_proxy. Setting "ulimit -c unlimited" in the catalina.sh startup file still did not produce a core file. If nobody else has experienced this, do you have any suggestions on how to debug it further? Thanks, Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] I'm using the same setup as you less Apache2. I use tomcat as the web server. Using TC5.0.28 and JDK1.4.2_06, and I have yet to have the server crash once. Not much help, but might give you some clues where to look. Connector log (mod_proxyassuming you mean you're using the new connector code)is there anything in the Apache2 log? I assume from your post you mean that the java process just completely goes away. You might find (depending on the running directory of the java process running tomcat) a pid dump log file or something...not sure if the vm produces one of these or not. You also might check in /var/log/messages file to see if for some reason the kernel or some lib got some error it logged. Wade - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat/JVM crashes on Linux
Hello- Has anyone had a problem with Tomcat 5.0.28 crashing on Linux with no error messages? My production server running with JDK 1.4.2_06, RedHat EL 3.0 just crashes, no core dump, no errors in catalina.out, no clues. Sometimes it goes for days, sometimes it happens several times in one day. I am running the tomcat process behind Apache 2 with mod_proxy. Setting "ulimit -c unlimited" in the catalina.sh startup file still did not produce a core file. If nobody else has experienced this, do you have any suggestions on how to debug it further? Thanks, Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]