Tomcat heap vs. java.exe
I have a quick question. When I run Tomcat 5.0.18, my java.exe starts with ~65MB. Then as my websites get hits, java.exe starts increasing. I run tomcat with the -Xms128m -Xmx256m options. So the startup heap size of tomcat is 128MB. After my first start, I usually have around 80 MB free memory for Tomcat. My question is, why is the startup java.exe size is smaller than my total heap size? Does the size of java.exe grow as the heap starts being used. I would expect java.exe to be at least 128 MB (plus the JVM memory) since that is how much is allocated. Thanks, Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat heap vs. java.exe
My main concern is to make sure that there is no memory leakage of any sort. Our server has 1GB of ram. I'm running tomcat with -Xms128m -Xmx256m. In this case, I'm guessing that java.exe will eventually become 256MB + JVM memory ~= 370MB and stay stabilized like that. I don't want our server to use the page file very much as it slows down the performance very much. Do you think it makes sense to assume that java.exe won't exceed 370 MB (400 MB top) under these conditions? I'll go ahead and search the archives right away. Thank you for your time. Asim Alp Educational Networks 55 Broad Street, 10th Floor New York, NY 10004 www.educationalnetworks.net Tel: +1 (212) 269-0200 Fax: +1 (212) 269-1446 On Feb 27, 2004, at 11:38 AM, Shapira, Yoav wrote: Howdy, Search the archives, as the relationship of the heap size to the total java OS process size has been described numerous times. What you're seeing is normal. Yoav Shapira Millennium ChemInformatics -----Original Message- From: Asim Alp [mailto:[EMAIL PROTECTED] Sent: Friday, February 27, 2004 11:25 AM To: [EMAIL PROTECTED] Subject: Tomcat heap vs. java.exe I have a quick question. When I run Tomcat 5.0.18, my java.exe starts with ~65MB. Then as my websites get hits, java.exe starts increasing. I run tomcat with the -Xms128m -Xmx256m options. So the startup heap size of tomcat is 128MB. After my first start, I usually have around 80 MB free memory for Tomcat. My question is, why is the startup java.exe size is smaller than my total heap size? Does the size of java.exe grow as the heap starts being used. I would expect java.exe to be at least 128 MB (plus the JVM memory) since that is how much is allocated. Thanks, Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Context to path
What I usually do is this: pageContext.getServletContext().getContext("/myContext").getRealPath("/ myfile.jsp"))); Asim Alp Educational Networks 55 Broad Street, 10th Floor New York, NY 10004 www.educationalnetworks.net Tel: +1 (212) 269-0200 Fax: +1 (212) 269-1446 On Feb 27, 2004, at 1:00 PM, Sjoerd van Leent wrote: Every web-app is in a context. Every context is in a path on the system. The question is, how can I translate a context to a system path. For example a context is in the following path: E:\xxx\yyy\myContext The web-app is in: http://localhost:8080/myContext How can I translate that using a PageContext or something similar into the path mentioned above. Any suggestions? Thanks in advance, Sjoerd van Leent
Re: Tomcat heap vs. java.exe
Our sites have just went down for a couple of minutes. I solved the problem by restarting Tomcat. At the time of the crash, java.exe was about 345MB. I'm running tomcat with the -Xms128m -Xmx256m options. Our server has 1GB physical ram. On the Tomcat logs, it reads: 2004-02-27 16:58:55 ApplicationDispatcher[/jsp-apps] Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError 2004-02-27 16:58:55 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError Do you have any idea why this might have happened? Also, how can we avoid such problems in the future? Asim Alp Educational Networks 55 Broad Street, 10th Floor New York, NY 10004 www.educationalnetworks.net Tel: +1 (212) 269-0200 Fax: +1 (212) 269-1446 On Feb 27, 2004, at 11:39 AM, Kannan Sundararajan wrote: Yes, it goes along with subject called Garbage collection and tuning. This area is a huge, sometimes very quick to tune, and sometimes gives a nightmare to tune those properties. The nature of this subject grows based on your application, servers and expectations from user end. -Original Message- From: Asim Alp [mailto:[EMAIL PROTECTED] Sent: Friday, February 27, 2004 11:25 AM To: [EMAIL PROTECTED] Subject: Tomcat heap vs. java.exe I have a quick question. When I run Tomcat 5.0.18, my java.exe starts with ~65MB. Then as my websites get hits, java.exe starts increasing. I run tomcat with the -Xms128m -Xmx256m options. So the startup heap size of tomcat is 128MB. After my first start, I usually have around 80 MB free memory for Tomcat. My question is, why is the startup java.exe size is smaller than my total heap size? Does the size of java.exe grow as the heap starts being used. I would expect java.exe to be at least 128 MB (plus the JVM memory) since that is how much is allocated. Thanks, Asim - 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 heap vs. java.exe
How can I take a thread dump? Asim Alp Educational Networks 55 Broad Street, 10th Floor New York, NY 10004 www.educationalnetworks.net Tel: +1 (212) 269-0200 Fax: +1 (212) 269-1446 On Feb 27, 2004, at 5:16 PM, [EMAIL PROTECTED] wrote: OutOfMemory errors sometimes show up when the java vm runs low on memory. Since you have increased the heap size, could you take a thread dump to see if there are any CPU burning threads or any threads waiting on a resource? Thanks, RS Asim Alp <[EMAIL PROTECTED]To: "Tomcat Users List" tworks.net> <[EMAIL PROTECTED]> cc: 02/27/2004 04:14 PMSubject: Re: Tomcat heap vs. java.exe Please respond to "Tomcat Users List" Our sites have just went down for a couple of minutes. I solved the problem by restarting Tomcat. At the time of the crash, java.exe was about 345MB. I'm running tomcat with the -Xms128m -Xmx256m options. Our server has 1GB physical ram. On the Tomcat logs, it reads: 2004-02-27 16:58:55 ApplicationDispatcher[/jsp-apps] Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError 2004-02-27 16:58:55 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError Do you have any idea why this might have happened? Also, how can we avoid such problems in the future? Asim Alp Educational Networks 55 Broad Street, 10th Floor New York, NY 10004 www.educationalnetworks.net Tel: +1 (212) 269-0200 Fax: +1 (212) 269-1446 On Feb 27, 2004, at 11:39 AM, Kannan Sundararajan wrote: Yes, it goes along with subject called Garbage collection and tuning. This area is a huge, sometimes very quick to tune, and sometimes gives a nightmare to tune those properties. The nature of this subject grows based on your application, servers and expectations from user end. -----Original Message- From: Asim Alp [mailto:[EMAIL PROTECTED] Sent: Friday, February 27, 2004 11:25 AM To: [EMAIL PROTECTED] Subject: Tomcat heap vs. java.exe I have a quick question. When I run Tomcat 5.0.18, my java.exe starts with ~65MB. Then as my websites get hits, java.exe starts increasing. I run tomcat with the -Xms128m -Xmx256m options. So the startup heap size of tomcat is 128MB. After my first start, I usually have around 80 MB free memory for Tomcat. My question is, why is the startup java.exe size is smaller than my total heap size? Does the size of java.exe grow as the heap starts being used. I would expect java.exe to be at least 128 MB (plus the JVM memory) since that is how much is allocated. Thanks, Asim - 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] This transmission is intended to be strictly confidential. If you are not the intended recipient of this message, you may not disclose, print, copy or disseminate this information. If you have received this in error, please reply and notify the sender (only) and delete the message. Unauthorized interception of this e-mail is a violation of federal criminal law. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat heap vs. java.exe
kill doesn't work on Windows. Besides, I can't afford to stop the server right now. Many of our customers are using currently using the websites. Any idea why JVM would run out of memory? I thought GC would clean up the memory at a certain ratio. Asim Alp Educational Networks 55 Broad Street, 10th Floor New York, NY 10004 www.educationalnetworks.net Tel: +1 (212) 269-0200 Fax: +1 (212) 269-1446 On Feb 27, 2004, at 5:27 PM, [EMAIL PROTECTED] wrote: oops! kill -3 RS [EMAIL PROTECTED] tric.com To: "Tomcat Users List" <[EMAIL PROTECTED]> 02/27/2004 04:26 cc: PM Subject: Re: Tomcat heap vs. java.exe Please respond to "Tomcat Users List" kill -a Thanks, RS Asim Alp <[EMAIL PROTECTED]To: "Tomcat Users List" tworks.net> <[EMAIL PROTECTED]> cc: 02/27/2004 04:21 PMSubject: Re: Tomcat heap vs. java.exe Please respond to "Tomcat Users List" How can I take a thread dump? Asim Alp Educational Networks 55 Broad Street, 10th Floor New York, NY 10004 www.educationalnetworks.net Tel: +1 (212) 269-0200 Fax: +1 (212) 269-1446 On Feb 27, 2004, at 5:16 PM, [EMAIL PROTECTED] wrote: OutOfMemory errors sometimes show up when the java vm runs low on memory. Since you have increased the heap size, could you take a thread dump to see if there are any CPU burning threads or any threads waiting on a resource? Thanks, RS Asim Alp <[EMAIL PROTECTED]To: "Tomcat Users List" tworks.net> <[EMAIL PROTECTED]> cc: 02/27/2004 04:14 PMSubject: Re: Tomcat heap vs. java.exe Please respond to "Tomcat Users List" Our sites have just went down for a couple of minutes. I solved the problem by restarting Tomcat. At the time of the crash, java.exe was about 345MB. I'm running tomcat with the -Xms128m -Xmx256m options. Our server has 1GB physical ram. On the Tomcat logs, it reads: 2004-02-27 16:58:55 ApplicationDispatcher[/jsp-apps] Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError 2004-02-27 16:58:55 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError Do you have any idea why this might have happened? Also, how can we avoid such problems in the future? Asim Alp Educational Networks 55 Broad Street, 10th Floor New York, NY 10004 www.educationalnetworks.net Tel: +1 (212) 269-0200 Fax: +1 (212) 269-1446 On Feb 27, 2004, at 11:39 AM, Kannan Sundararajan wrote: Yes, it goes along with subject called Garbage collection and tuning. This area is a huge, sometimes very quick to tune, and sometimes gives a nightmare to tune those properties. The nature of this subject grows based on your application, servers and expectations from user end. -Original Message- From: Asim Alp [mailto:[EMAIL PROTECTED] Sent: Friday, February 27, 2004 11:25 AM To: [EMAIL PROTECTED] Subject: Tomcat heap vs. java.exe I have a quick question. When I run Tomcat 5.0.18, my java.exe starts with ~65MB. Then as my websites get hits, java.exe starts increasing. I run tomcat with the -Xms128m -Xmx256m options. So the startup heap size of tomcat is 128MB. After my first start, I usually have around 80 MB free memory for Tomcat. My question is, why is the startup java.exe size is smaller than my total heap size? Does the size of java.exe grow as the heap starts being used. I would expect java.exe to be at least 128 MB (plus the JVM memory) since that is how much is allocated. Thanks, Asim - 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] This transmission is intended to be strictly confidential. If you are not the intended recipient of this message, you may not disclose, print, copy or disseminate this information. If you have received this in error, please reply and notify the sender (only) and delete the message. Unauthorized interception of this e-mail is a violation of federal criminal law. - To unsubscribe, e-mail: [EMAIL PROTE
Re: starting tomcat with custom propertys
I think you have to set the JAVA_OPTS environmental variable. Asim On Feb 27, 2004, at 5:48 PM, Ukiah Smith wrote: I am using an application that requires me to run it with a custom property (-Djava.awt.headless=true). I poked around in my tomcat 4.1.29 installation and found that in the catalina.sh file there was an CATALINA_OPTS variable. I tried to set it at a few different places in the catalina.sh file. The all resulted in "catalina.sh: CATALINA_OPTS: command not found". So my question is how can I get tomcat to run with the property -Djava.awt.headless=true? Thanks //Ukiah Smith - 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]
cross context include
My application was running without any problems on Tomcat 5.0.18. After upgrading to Tomcat 5.0.19, I started having problems with my cross context includes. I haven't changed a single line of code. Server.xml is the same as well. Here is the host section on my server.xml: In the "/" context, my index.jsp is as follows: <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %> . In the "/jsp-apps" context /shared/header.jsp is just a simple JSP page. Here is the error message I get: javax.servlet.ServletException: /shared/header.jsp org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageCont extImpl.java:867) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tImpl.java:800) org.apache.jsp.index_jsp._jspService(index_jsp.java:123) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:311) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) root cause javax.servlet.jsp.JspTagException: /shared/header.jsp org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString( Unknown Source) org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(Unkno wn Source) org.apache.jsp.index_jsp._jspx_meth_c_import_0(index_jsp.java:142) org.apache.jsp.index_jsp._jspService(index_jsp.java:54) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:311) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) Any ideas? Asim
Re: cross context include
I found the reason of the previous error message. However, I'm still having a problem. This time my Here is my setup: /test.jsp (context "") <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %> This is test.jsp /hello.jsp (context /jsp-apps) Hello World! When I view /test.jsp, I only get: This is test.jsp In my browser. I tried one more thing. I replaced test.jsp with the following: <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %> This is test.jsp http://www.yahoo.com"; /> It worked! I got a page that says "This is test.jsp" at the top followed by the frontpage of yahoo.com. Any suggestions? Asim On Mar 2, 2004, at 11:45 AM, Remy Maucherat wrote: Asim Alp wrote: My application was running without any problems on Tomcat 5.0.18. After upgrading to Tomcat 5.0.19, I started having problems with my cross context includes. I haven't changed a single line of code. Server.xml is the same as well. Here is the host section on my server.xml: In the "/" context, my index.jsp is as follows: <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %> . I tried it and it works for me. <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %> Foo1 Foo2 Your context needs to be crossContext, of course. -- x Rémy Maucherat Developer & Consultant JBoss Group (Europe) SàRL x - 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: scope & order of initialization of variabes & includes
I think you need to remove Asim On Mar 2, 2004, at 12:09 PM, Marc Hughes wrote: I have the following situation: Page1.jsp: <% bandbg = "ok"; %> First page: <%= bandbg %> Page2.jsp: Second page: <%= bandbg %> Viewing page1.jsp I get the output: First page: ok Second page: I thought I should get the output: First page: ok Second page: ok I've tried with application & session scope too. I'm assuming I'm just misunderstanding how things work. Maybe tomcat starts processing includes before it processes the page or something? Any comments? Thanks -Marc - 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: cross context include
I noticed something interesting. I tried your example using /dates/date.jsp in the jsp-examples context. It worked. I opened date.jsp and noticed the line: <%@ page session="false"%> at the top of it. I pasted this line in my hello.jsp and it worked. Any idea why I need this line on Tomcat 5.0.19, but not on 5.0.18? So, to clarify things: /test.jsp in context "": <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %> This is test.jsp /hello.jsp in context "jsp-apps": Hello World! The output of /test.jsp on Tomcat 5.0.18 is: This is test.jsp Hello World! The output of the same file on Tomcat 5.0.19 is: This is test.jsp When I replace /hello.jsp with the following: <%@ page session="false"%> Hello World! The output on Tomcat 5.0.19 becomes: This is test.jsp Hello World! Isn't this weird? Asim On Mar 2, 2004, at 12:04 PM, Asim Alp wrote: I found the reason of the previous error message. However, I'm still having a problem. This time my Here is my setup: /test.jsp (context "") <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %> This is test.jsp /hello.jsp (context /jsp-apps) Hello World! When I view /test.jsp, I only get: This is test.jsp In my browser. I tried one more thing. I replaced test.jsp with the following: <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %> This is test.jsp http://www.yahoo.com"; /> It worked! I got a page that says "This is test.jsp" at the top followed by the frontpage of yahoo.com. Any suggestions? Asim On Mar 2, 2004, at 11:45 AM, Remy Maucherat wrote: Asim Alp wrote: My application was running without any problems on Tomcat 5.0.18. After upgrading to Tomcat 5.0.19, I started having problems with my cross context includes. I haven't changed a single line of code. Server.xml is the same as well. Here is the host section on my server.xml: In the "/" context, my index.jsp is as follows: <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %> . I tried it and it works for me. <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %> Foo1 Foo2 Your context needs to be crossContext, of course. -- x Rémy Maucherat Developer & Consultant JBoss Group (Europe) SàRL x - 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: cross context include
Thank you for your prompt replies. I just read the bug, and understood what the problem was. Now, though, I have another question. Is there a way of setting page session to false at a higher level. For example somewhere from the server.xml file? My problem is that we have over 100 websites with tens of thousands of jsp pages. Every single one of these JSP pages rely on these line to each of them. Can you think of an an easier solution to my problem? Thanks, Asim On Mar 2, 2004, at 12:40 PM, Remy Maucherat wrote: Asim Alp wrote: When I replace /hello.jsp with the following: <%@ page session="false"%> Hello World! The output on Tomcat 5.0.19 becomes: This is test.jsp Hello World! Isn't this weird? No. See bug 27309. -- x Rémy Maucherat Developer & Consultant JBoss Group (Europe) SàRL x - 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: cross context include
I guess we'll have to find a way of going over the 10,000+ pages. Maybe we can write a small program to automate it. I don't like dirty solutions :) If this is indeed a bug in our software, it should better be fixed. One last question though. As much as I know, setting page session to false only means that there is no need to create an additional session. What's this have to do with c:imports? Why does an additional session prevent our c:imports? Asim On Mar 2, 2004, at 1:15 PM, Remy Maucherat wrote: Asim Alp wrote: Thank you for your prompt replies. I just read the bug, and understood what the problem was. Now, though, I have another question. Is there a way of setting page session to false at a higher level. For example somewhere from the server.xml file? My problem is that we have over 100 websites with tens of thousands of jsp pages. Every single one of these JSP pages rely on these line to each of them. Can you think of an an easier solution to my problem? Yes, take advantage that this is OSS and patch your Tomcat ;) Or use the replacement class (put in server/classes/org/apache/catalina/core). -- x Rémy Maucherat Developer & Consultant JBoss Group (Europe) SàRL x - 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: cross context include
If indeed we need to put it on all pages, then yes, it's no problem. We do have a couple perl geniuses on staff :) I'm sure we'll find a way to get around it. My main concern right now is to to understand the reason of the problem first. I read the bug report, but still can't understand why an extra session prevents our c:imports from working? Asim On Mar 2, 2004, at 1:46 PM, Mike Curwen wrote: If you have a perl genius on staff, he can do ALL pages with a single command. Scary stuff, but cool when it works. :) -Original Message- From: Asim Alp [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 12:33 PM To: Tomcat Users List Subject: Re: cross context include I guess we'll have to find a way of going over the 10,000+ pages. Maybe we can write a small program to automate it. I don't like dirty solutions :) If this is indeed a bug in our software, it should better be fixed. One last question though. As much as I know, setting page session to false only means that there is no need to create an additional session. What's this have to do with c:imports? Why does an additional session prevent our c:imports? Asim On Mar 2, 2004, at 1:15 PM, Remy Maucherat wrote: Asim Alp wrote: Thank you for your prompt replies. I just read the bug, and understood what the problem was. Now, though, I have another question. Is there a way of setting page session to false at a higher level. For example somewhere from the server.xml file? My problem is that we have over 100 websites with tens of thousands of jsp pages. Every single one of these JSP pages rely on these line to each of them. Can you think of an an easier solution to my problem? Yes, take advantage that this is OSS and patch your Tomcat ;) Or use the replacement class (put in server/classes/org/apache/catalina/core). -- x Rémy Maucherat Developer & Consultant JBoss Group (Europe) SàRL x - 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]
manager and admin applications
I had to make some modifications to my server.xml file, so that my default host (localhost) is no longer the Tomcat's default start page in webapps/ROOT. After this change, I can no longer reach my manager and admin applications. In my previous server.xml, I haven't noticed any settings regarding these two applications. So my questions is, how are these two applications deployed? And how can I make them work through a single domain name (i.e. tomcat1.domainname.com:8080/manager/status) ? Thanks, Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: manager and admin applications
That fixed the problem. Thank you very much! Asim On Mar 27, 2004, at 1:19 PM, Parsons Technical Services wrote: Asim, I just did this very thing. The way I fixed things was this: I moved the index.jsp page to the root of the manager application. Now when I go to http://localhost/manager I get the old index page. I also moved the images so that they show up as well. I then edited the path information in the index.jsp by adding ../ in front of all the links to the local tomcat stuff. Thus: Tomcat Administration became Tomcat Administration The link for manager did not change. And with this all is well again. Now just point to your new url and it's like you never left home. You can call the manager page directly by http://localhost/manager/html and admin with http://localhost/admin If these are not working then post your server.xml and let us take a look. Doug - Original Message - From: "Asim Alp" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Saturday, March 27, 2004 9:53 AM Subject: manager and admin applications I had to make some modifications to my server.xml file, so that my default host (localhost) is no longer the Tomcat's default start page in webapps/ROOT. After this change, I can no longer reach my manager and admin applications. In my previous server.xml, I haven't noticed any settings regarding these two applications. So my questions is, how are these two applications deployed? And how can I make them work through a single domain name (i.e. tomcat1.domainname.com:8080/manager/status) ? Thanks, Asim - 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]
apache + 2 tomcat cluster memory problem
Hello everyone, I have 2 Tomcats (both 5.0.19) running on two separate machines. One machine also has Apache 2.0.49 installed on it for load balancing. Apache communicates with tomcat1 thru port 11005 and tomcat2 thru 12005. tomcat1 and Apache are on the same machine. Apache is set to forward /* to the load balancer (and then to Tomcats). We have over a hundred virtual hosts on our tomcats, so we don't want to worry about configuring Apache virtual hosts to serve the images and all the other files (that's why we forward /*, not just /*.jsp and /servlet/*). Both tomcats also have their http connector ports listening to port 8080 on their individual machines. We're using mod_jk_1.2.5_2.0.47.dll for Apache to Tomcat communication... Both our tomcats are running with the -Xms128m -Xmx256m options. With this configuration everything works perfect for about an hour, then our tomcats run out of memory... When we turn off clustering, and run a single Tomcat on port 80 (of course by shutting down Apache Httpd), we don't have any memory problems at all (for now, we're planning to use clustering to avoid down time, one server is actually enough to handle all the traffic). Does anyone have any idea why we'd run out of memory when our tomcats are talking to Apache through mod_jk? Thanks, Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: apache + 2 tomcat cluster memory problem
Thanks Filip. I only found the thread of mails starting March 17 with the title "Horrible memory leak in tomcat 5.0.19" If this is indeed the mails you advised me to look at, here is what I found out: Our setup differs in a way that we are using mod_jk 1.2.5 instead of 2.0.2. So mod_jk 1.2.5 + Tomcat 5.0.19 has a memory leak problem as well. This suggests that maybe the problem is with Tomcat 5.0.19 (?) Appearantly someone else (Robert Kruger) had exactly the same problem and it was solved when they downgraded to Tomcat 5.0.18. We cannot do that either because of a bug fix regarding session states in 5.0.18. I don't mind using mod_jk 2.0.2 as long as it solves our problem; however there already seems to be a memory leak with the mod_jk 2.0.2 + tomcat 5.0.19 combination as well. In Robert's email, he predicts that maybe the problem is related to JMX registration issue described in http://www.mail-archive.com/[EMAIL PROTECTED]/ msg53035.html. I'll reply to his email to see if it was indeed the problem. What's the next step? Thanks, Asim On Mar 28, 2004, at 12:39 AM, Filip Hanik ((lists)) wrote: there was an earlier email about a mem leak in the connector for mod_jk, please go through the last weeks emails and let us know what you find out. Filip -----Original Message- From: Asim Alp [mailto:[EMAIL PROTECTED] Sent: Saturday, March 27, 2004 7:55 PM To: Tomcat Users List Subject: apache + 2 tomcat cluster memory problem Hello everyone, I have 2 Tomcats (both 5.0.19) running on two separate machines. One machine also has Apache 2.0.49 installed on it for load balancing. Apache communicates with tomcat1 thru port 11005 and tomcat2 thru 12005. tomcat1 and Apache are on the same machine. Apache is set to forward /* to the load balancer (and then to Tomcats). We have over a hundred virtual hosts on our tomcats, so we don't want to worry about configuring Apache virtual hosts to serve the images and all the other files (that's why we forward /*, not just /*.jsp and /servlet/*). Both tomcats also have their http connector ports listening to port 8080 on their individual machines. We're using mod_jk_1.2.5_2.0.47.dll for Apache to Tomcat communication... Both our tomcats are running with the -Xms128m -Xmx256m options. With this configuration everything works perfect for about an hour, then our tomcats run out of memory... When we turn off clustering, and run a single Tomcat on port 80 (of course by shutting down Apache Httpd), we don't have any memory problems at all (for now, we're planning to use clustering to avoid down time, one server is actually enough to handle all the traffic). Does anyone have any idea why we'd run out of memory when our tomcats are talking to Apache through mod_jk? Thanks, Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.614 / Virus Database: 393 - Release Date: 3/5/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.614 / Virus Database: 393 - Release Date: 3/5/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Horrible memory leak in tomcat 5.0.19
Hello Robert, We are having the same problem with mod_jk 1.2.5 and Tomcat 5.0.19. However, we cannot downgrade to Tomcat 5.0.18 because of a bug fix regarding session states. I was wondering, have you guys tried disableing the JMX registration? Was that indeed the problem? Thank you very much. Asim On Mar 18, 2004, at 4:08 AM, Robert Krüger wrote: Hi, we had the same problem (enormous memory leak which frequently made our production system crash), downgraded to 5.0.18 and everything went back to normal. Just yesterday a colleague of mine came to the conclusion that it is not too unlikely that it is the problem described in the message http://www.mail-archive.com/[EMAIL PROTECTED]/msg53035.html It that is so, you can simply disable the JMX registration of requests to get rid of the problem. We will try that probably later today but of course you can give it a shot yourself. There is not much to lose. Regards, Robert Joseph Shraibman wrote: Shapira, Yoav wrote: Hi, Does the memory leak occur when you run tomcat standalone? I can't run the production server in standalone, and I can't seem to hit my test server hard enough to reproduce the problem clearly. I'll keep trying. Can you point out its source e.g. by running with a profiler? I don't have a profiler :( Was the load during these 50 minutes exceptionally heavy? On the heavy side, but not really stressing the server except for this memroy leak. Tomcat 4.1.18 handled loads like this all the time. BTW How can I view the jk2 status? I tried both of these: In httpd.conf: JkUriSet worker status in workers2.properties: [uri:/status/*] worker=status:status In my error_log I see: [Wed Mar 17 14:26:42 2004] [notice] Apache/2.0.48 (Unix) mod_ssl/2.0.48 OpenSSL/0.9.7a mod_jk2/2.0.2 configured -- resuming normal operations [Wed Mar 17 14:26:42 2004] [error] uriEnv.init() map to invalid worker /jkstatus/* status [Wed Mar 17 14:26:42 2004] [error] uriEnv.init() map to invalid worker /status/* status:status [Wed Mar 17 14:26:42 2004] [error] mod_jk child init 1 -2 [Wed Mar 17 14:26:43 2004] [error] jk2_init() Can't find child 2506 in scoreboard ... and going to the url just produces a 500 error. Also The faq at http://jakarta.apache.org/tomcat/faq/connectors.html says that mod_jk is the preferred connector and that jk2 is not production quality. My understanding was that jk was in maintence mode and jk2 is considered the stable connector. Is the faq right or is it just out of date? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Robert Krüger Signal7 GmbH Brüder Knauss Str. 79 64285 Darmstadt Germany - 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]
Registry problems followed by OutOfMemory errors
Here is our configuration: Windows Server 2003 Apache 2.0.49 (Win32) mod_ssl/2.0.51 OpenSSL/0.9.7d DAV/2 mod_jk/1.2.6 Tomcat 5.5.4 sun jdk 1.5.0-b64 We have a 2 node tomcat cluster each running with the -Xms128m -Xmx1024m options. We have the following thread options set in the AJP/1.3 connector: maxThreads="1000" minSpareThreads="50" maxSpareThreads="300" And the following corresponding values in our workers.properties (same for each tomcat) worker.tomcat1.type=ajp13 worker.tomcat1.cachesize=300 worker.tomcat1.cache_timeout=60 worker.worker1.local_worker=1 worker.tomcat1.lbfactor=1 worker.tomcat1.connect_timeout = 1000 worker.tomcat1.prepost_timeout = 1000 worker.tomcat1.reply_timeout = 7000 ... worker.loadbalancer.local_worker_only=0 We have a heavily loaded database application running. Same application runs on about 180 different virtual hosts on each Tomcat. We did profiling with JProfile and couldn't find any memory leaks in our application. Each Tomcat works perfect for about 8 to 10 hours, then all of a sudden, they start hanging (not necessarily at the same time). We monitor our heap memory very closely and we usually have enough FREE memory (more than 25%) when the following errors occur: First, we get a couple of SEVERE registering errors: 2004-12-09T18:19:51 1102634391333 270 org.apache.commons.modeler.Registry SEVERE org.apache.commons.modeler.Registry registerComponent 44 Error registering Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest2291 javax.management.InstanceAlreadyExistsException: Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest2291 com.sun.jmx.mbeanserver.RepositorySupport addMBean 452 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor internal_addObject 1410 2004-12-09T18:19:51 1102634391333 271 org.apache.jk.common.ChannelSocket WARNING org.apache.jk.common.ChannelSocket registerRequest 44 Error registering request Followed by a couple of java.lang.OutOfMemoryError: PermGen space messages 2004-12-09T21:48:25 1102646905849 294 StandardWrapper[/apps:jsp] SEVERE org.apache.catalina.core.StandardWrapperValve invoke 47 Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError: PermGen space ... Followed by HUNDREDS (basically for each thread) of Error unregistering mbean messages 2004-12-09T21:53:29 1102647209630 302 org.apache.commons.modeler.Registry SEVERE org.apache.commons.modeler.Registry unregisterComponent 20 Error unregistering mbean javax.management.RuntimeOperationsException: Object name cannot be null com.sun.jmx.interceptor.DefaultMBeanServerInterceptor isRegistered 545 com.sun.jmx.mbeanserver.JmxMBeanServer isRegistered 619 org.apache.commons.modeler.Registry unregisterComponent 642 ... Any ideas? Is this something to do with our thread counts (maxThreads="1000" minSpareThreads="50" maxSpareThreads="300")? If so, how can we determine these numbers for fastest performance. We get about 5 hits every second and we want our Tomcats to serve static files as well (such as image files), so we want to make sure that we have enough threads. It's very important for our pages to load fast on the client side. Thank you very much! Any help would be greatly appreciated! Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Registry problems followed by OutOfMemory errors
Thanks for the quick reply! How can I turn off JMX request registration? I tried to find it in the Tomcat documentation, but all I could find was the MBean Descriptor How To which wasn't very helpful. I doubt that we need it. I will look into the resource problem. I doubt that we're running out of threads, because 1000 of them should be more than enough. Another resource problem could be the number of SQL connections, but on our SQL Side (MySQL), max_connections is set to 5000 which is about 7 times more than we need. Number of file descriptors might be a problem. For each web application, we have to load properties files and these files are automatically checked once every minute for possible updates. How can I configure the number of file descriptors? Thank you very much! Asim On Dec 10, 2004, at 11:02 AM, Shapira, Yoav wrote: Hi, Do you need JMX request registration? If not, turn it off by setting it to false in the configuration file. That'll save you some memory by itself. Your OOME is the root cause, so if you fix that the hundreds of others errors will likely go away. The OOME, in turn, is probably caused not because you're out of heap memory, but because you're out of another resource, such as file descriptors or threads. Yoav Shapira http://www.yoavshapira.com -Original Message- From: Asim Alp [mailto:[EMAIL PROTECTED] Sent: Friday, December 10, 2004 10:59 AM To: Tomcat Users List Subject: Registry problems followed by OutOfMemory errors Here is our configuration: Windows Server 2003 Apache 2.0.49 (Win32) mod_ssl/2.0.51 OpenSSL/0.9.7d DAV/2 mod_jk/1.2.6 Tomcat 5.5.4 sun jdk 1.5.0-b64 We have a 2 node tomcat cluster each running with the -Xms128m -Xmx1024m options. We have the following thread options set in the AJP/1.3 connector: maxThreads="1000" minSpareThreads="50" maxSpareThreads="300" And the following corresponding values in our workers.properties (same for each tomcat) worker.tomcat1.type=ajp13 worker.tomcat1.cachesize=300 worker.tomcat1.cache_timeout=60 worker.worker1.local_worker=1 worker.tomcat1.lbfactor=1 worker.tomcat1.connect_timeout = 1000 worker.tomcat1.prepost_timeout = 1000 worker.tomcat1.reply_timeout = 7000 ... worker.loadbalancer.local_worker_only=0 We have a heavily loaded database application running. Same application runs on about 180 different virtual hosts on each Tomcat. We did profiling with JProfile and couldn't find any memory leaks in our application. Each Tomcat works perfect for about 8 to 10 hours, then all of a sudden, they start hanging (not necessarily at the same time). We monitor our heap memory very closely and we usually have enough FREE memory (more than 25%) when the following errors occur: First, we get a couple of SEVERE registering errors: 2004-12-09T18:19:51 1102634391333 270 org.apache.commons.modeler.Registry SEVERE org.apache.commons.modeler.Registry registerComponent 44 Error registering Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest2291 javax.management.InstanceAlreadyExistsException: Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest2291 com.sun.jmx.mbeanserver.RepositorySupport addMBean 452 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor internal_addObject 1410 2004-12-09T18:19:51 1102634391333 271 org.apache.jk.common.ChannelSocket WARNING org.apache.jk.common.ChannelSocket registerRequest 44 Error registering request Followed by a couple of java.lang.OutOfMemoryError: PermGen space messages 2004-12-09T21:48:25 1102646905849 294 StandardWrapper[/apps:jsp] SEVERE org.apache.catalina.core.StandardWrapperValve invoke 47 Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError: PermGen space ... Followed by HUNDREDS (basically for each thread) of Error unregistering mbean messages 2004-12-09T21:53:29 1102647209630 302 org.apache.commons.modeler.Registry SEVERE org.apache.commons.modeler.Registry unregisterComponent 20 Error unregistering mbean javax.management.RuntimeOperationsException: Object name cannot be null com.sun.jmx.interceptor.DefaultMBeanServerInterceptor isRegistered 545 com.sun.jmx.mbeanserver.JmxMBeanServer isRegistered 619 org.apache.commons.modeler.Registry unregisterComponent 642 ... Any ideas? Is this something to do with our thread counts (maxThreads="1000" minSpareThreads="50" maxSpareThreads="300")? If so, how can we determine these numbers for fastest performance. We get about 5 hits every second and we want our Tomcats to serve static files as well (such as image files), so we want to make sure that we have enough threads. It's very important for our pages to load fast on the client side. Thank you very much! Any help would be greatly appreciated! Asim
OutOfMemory Errors
I'm trying to solve an OOME on our Tomcat. We profiled our application using JProfiler and there are no memory leakages on our end. Currently, I'm focusing on some system resource problems such as file descriptors. Would this be a valid problem on Windows Server 2003? And if so, how can I change the max number of file descriptors? One last thing... What other resources should I investigate for this sort of OOME? Thanks, Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemory Errors
Thank you for the suggestion. Actually, we have upgraded from JDK 1.4.x to JDK 1.5.0 hoping to solve the problem, so I doubt that it is JDK related. On Mon, 13 Dec 2004 19:38:14 -0200, Ivan F. Martinez <[EMAIL PROTECTED]> wrote: > > On Mon, 13 Dec 2004 13:31:50 -0500 > Asim Alp <[EMAIL PROTECTED]> wrote: > > AA> Hello Peter, > AA> > AA> Sorry. My system config is: > AA> > AA> Windows Server 2003 > AA> Apache 2.0.49 (Win32) mod_ssl/2.0.51 OpenSSL/0.9.7d DAV/2 > AA> mod_jk/1.2.6 Tomcat 5.5.4 > AA> sun jdk 1.5.0-b64 > > Have you tried with JDK 1.4.x ? > I have one app that "eat" all memory when running on jdk 1.5.0, and > works fine on 1.4.x. > I did not find any memory leak in APP. I think is related with JDK 1.5.0 > > -- > > - > > > 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]
StackOverflowError for internalGetPageContext method
>From time to time, the following error message comes up on our Tomcat 5.5.4 with Sun jdk1.5.0 on Windows Server 2003. It's almost like there is an infinite loop somewhere in the code that creates a bottleneck. Any ideas? Here is the error message (it's quite long): 2004-12-14T13:41:22 1103049682232 620 org.apache.jasper.runtime.JspFactoryImpl SEVERE org.apache.jasper.runtime.JspFactoryImpl internalGetPageContext 28 Exception initializing page context java.lang.StackOverflowError org.apache.catalina.connector.Request doGetSession 2159 org.apache.catalina.connector.Request getSession 2012 org.apache.catalina.connector.RequestFacade getSession 523 javax.servlet.http.HttpServletRequestWrapper getSession 215 org.apache.catalina.core.ApplicationHttpRequest getSession 518 javax.servlet.http.HttpServletRequestWrapper getSession 215 org.apache.catalina.core.ApplicationHttpRequest getSession 518 javax.servlet.http.HttpServletRequestWrapper getSession 215 org.apache.catalina.core.ApplicationHttpRequest getSession 518 javax.servlet.http.HttpServletRequestWrapper getSession 215 . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemory Errors
Hello Peter, Sorry. My system config is: Windows Server 2003 Apache 2.0.49 (Win32) mod_ssl/2.0.51 OpenSSL/0.9.7d DAV/2 mod_jk/1.2.6 Tomcat 5.5.4 sun jdk 1.5.0-b64 We have a 2 node tomcat cluster each running with the -Xms128m -Xmx1024m options. We have a heavily loaded JDBC application running and our MySQL server has enough max_connections to handle our load. For now, we have Apache, one of the Tomcats and MySQL running on the same machine (2 x 3.8 Ghz Intel with 2GB of Ram). We're also using this server as a file server with RAID 5. >From Task Managers performance monitor, I'm looking at the Handles (I hope I'm looking at the correct thing). Total number of handles is around 30400 (almost two times 16K). Apache is usually using about 3000, Tomcat 5000, MySQL 9000, System 2600, svchost 1000. Do these values look normal? Asim On Mon, 13 Dec 2004 17:53:35 -, Peter Crowther <[EMAIL PROTECTED]> wrote: > > From: Asim Alp [mailto:[EMAIL PROTECTED] > > I'm trying to solve an OOME on our Tomcat. > > Tomcat version? > JVM version and settings? > Application characteristics? > Other libraries in use (eg JDBC)? > > > We profiled our > > application using JProfiler and there are no memory leakages on our > > end. Currently, I'm focusing on some system resource problems such as > > file descriptors. Would this be a valid problem on Windows Server > > 2003? And if so, how can I change the max number of file descriptors? > > I suspect someone else will give a better Java solution, but I'm a > Windows hack who's a relative latecomer to Java... > > You've got 16k to go at by default. How many are you using, according > to Performance Monitor? And how many in the JVM running Tomcat? > > > One last thing... What other resources should I investigate for this > > sort of OOME? > > http://www.sysinternals.com/ for 'handle' and Process Explorer if you > suspect a resource problem on Windows. > > - Peter > > - > 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]
visualgc and tomcat
I hava a problem finding out the lvmid of the running Tomcat instance. I have installed jvmstat 3.0 from Sun. It works perfectly fine for all running Java applications but Tomcat. When I type jps and hit enter, I don't see Tomcat's lvmid. I tried using the PID in task manager, but that didn't work either. Any suggestions? BTW, I'm running Tomcat 5.5.4 on Windows Server 2003 with Sun's jdk1.5.0-b64, and I'm NOT running it as a service. I use the startup.bat file. Thanks, Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP privileges
We want to give FTP access to our customers so that they can create / edit their own JSP pages; however we are afraid of the capabilities of JSP. Technically, it is possible for a user to write a program that would mess up anything else on the server. Is there a get around? How does JSP hosting companies solve this potential security problem? We're not really a hosting company, but an application service provider... Thanks, Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sending a JSP page by email
Here is what I use: // here is a function from my MailUtils class public boolean formSend(String to, String fromAddress, String fromPersonal, String msgSubject, PageContext pc, String templateURL) { if (templateURL == null || templateURL.equals("")) { return formSend(to, msgSubject, pc); } String httpHost = pc.getRequest().getServerName(); Enumeration params = pc.getRequest().getParameterNames(); String queryString = "?"; if (templateURL.indexOf("?") >= 0) queryString = "&"; while (params.hasMoreElements()) { String param = (String) params.nextElement(); try { queryString += param + "=" + URLEncoder.encode(StringUtils.encodeHTML(JSPUtils.getParam(pc, param)), "UTF-8") + "&"; } catch (Exception e) { e.printStackTrace(); } } String url = "http://"; + httpHost + templateURL + queryString; try { // see the Webpage object Webpage wp = new Webpage(url); String msgBody = wp.loadPage(); // replace it your own send mail function send(to, fromAddress, fromPersonal, msgSubject, msgBody, true); } catch (Exception e) { e.printStackTrace(); return false; } return true; } // Here is the Webpage package com.edunet.iwas.util; import java.net.*; import java.io.*; public class Webpage { private static final String NEW_LINE = System.getProperty("line.separator"); private String content; private URL u; public Webpage(String urlString) throws MalformedURLException { urlString = StringUtils.replace(urlString, " ", "%20"); this.u = new URL(urlString); } public String loadPage() throws IOException { BufferedReader in = new BufferedReader( new InputStreamReader(u.openStream())); String temp; content = ""; while ((temp = in.readLine()) != null) content += temp + NEW_LINE; /* you don't really need the NEW_LINE */ in.close(); return content; } public String getContent() { return content; } } Please use it at your own risk... Asim On Tue, 14 Dec 2004 19:15:13 -0300, Gabriel Belingueres <[EMAIL PROTECTED]> wrote: > Hi, > > How can I take advantage of Tomcat's JSP processing engine to use a > JSP page as a template for an email? > > That is, I want to do something like a page forwarding from a servlet, > but this forwarding process the JSP page and, instead of send it to > the browser, it send it by email to somebody. > > Thanks in advance, > Gabriel > > - > 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]
javac and Tomcat 5.5.4
We're using Tomcat 5.5.4 on Windows Server 2003 with Sun's jdk1.5.0. We have over 180 virtual hosts with over 20,000 jsp files. Our Tomcat is running with the fork = true option for compiling the files in a separate JVM. Here are our JVM parameters: -Xms1024m -Xmx1024m -XX:MaxPermSize=128m -XX:MaxNewSize=48m -XX:NewSize=48m -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseConcMarkSweepGC My first concern is about forking. In the old days, when we were using Tomcat 5.0.28 with jdk1.4.2, I used to see multiple instances of javac.exe on Windows Task Manager while my JSP files where being compiled. Even though fork is set to true on Tomcat 5.5.4 with jdk1.5.0, I don't see any javac.exe instances any more... Is this normal? >From time to time (when there is plenty of JSP files to compile), Tomcat suddenly shutdowns with the following error: Background compile failed java.lang.OutOfMemoryError java.util.zip.Inflater init java.util.zip.Inflater79 Visualgc shows me very frequent fluctuations in Eden Space. Any ideas? Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Security Policy while running as a windows service
Hello everyone, I'm running my Tomcat 5.5.4 as a Windows Service. Is there a way to put the -security option to the GUI application? I'm trying to get my service to start with the catalina.policy file for extra security. Thanks, Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Bug or a setup problem?
I have a very strange problem. Here is my setup: Windows Server 2003 Tomcat 5.5.4 Sun's jdk 1.5.0 build 1.5.0-b64 Whenever Tomcat serves a page from my site it gets into an infinite loop. This happens even when serving a simple html file, so I'm pretty sure that it's not related to my application. The strange thing is, even though it gets into an infinite loop (error messages don't stop on the command prompt), it serves the page without any problems. Here is my host setup in server.xml. XXX.com Can this be something to do with my URL? I don't want to provide it for now, but it's a 4 character alphanumberic URL in the AA##.com format (A = Alpha, # = Numeric)... I'm really stuck... Any ideas? Thanks, Asim PS: Here is some of my error log... ... StandardWrapper[:jsp] SEVERE org.apache.catalina.core.ApplicationDispatcher invoke 11 Servlet.service() for servlet jsp threw exception java.lang.StackOverflowError java.security.AccessController doPrivileged org.apache.catalina.connector.RequestFacade getSession 520 javax.servlet.http.HttpServletRequestWrapper getSession 215 org.apache.catalina.core.ApplicationHttpRequest getSession 518 javax.servlet.http.HttpServletRequestWrapper getSession 215 ... org.apache.catalina.security.SecurityUtil execute 251 org.apache.catalina.security.SecurityUtil doAsPrivilege 157 org.apache.catalina.core.ApplicationFilterChain internalDoFilter 231 org.apache.catalina.core.ApplicationFilterChain access$000 50 org.apache.catalina.core.ApplicationFilterChain$1 run 140 java.security.AccessController doPrivileged org.apache.catalina.core.ApplicationFilterChain doFilter 136 org.apache.catalina.core.ApplicationDispatcher invoke 674 org.apache.catalina.core.ApplicationDispatcher doInclude 576 ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Valves
I'm using Tomcat 5.5.5 on Windows Server 2003. I have implemented a new valve. I include the following line in my My valve extends org.apache.catalina.valves.ValveBase Everything works fine on my Mac OS X. However, on Windows, when I start Tomcat as a service or from command line, it cannot find my object com.en.stats.StatsValve This is located under $CATALINA_HOME$/shared/classes/com/en/stats/StatsValve.class When I move it to commons, it finds that class; however this time gives an error message saying that it cannot find org.apache.catalina.valves.ValveBase This class comes with Tomcat. It is located in $CATALINA_HOME$/server/lib/catalina.jar How can I solve this problem? And why does it work fine on my Mac OS X? The configuration is exactly the same... Thanks, Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
IIS Default Document
I've set up IIS 6 to serve jsp files through ISAPI Redirector 1.2.8. Everything is working fine except my default documents. How can I get IIS to server index.jsp files by default. Even though it's added to the default document list, it doesn't seem to work. Thanks, Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
include / c:import problems
Hi, We're using Tomcat 5.5.7 on Windows Server 2003 with Sun's J2SE 5.0. >From time to time, we have problems with jsp:includes and c:imports. For some reason, the whole page gets included more than once. For example; on index.jsp, we have news.jsp and events.jsp includes. >From time to time here is what happens: index.jsp loads. news.jsp gets included. Instead of events.jsp index.jsp gets included. On that second index.jsp, news.jsp and events.jsp gets included successfully. We end up getting very weird looking pages. We have no idea why this happens as the code is correct. In fact, the page loads correctly after a refresh. This seems to happen once every 100 loads... Any ideas? Asim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: include / c:import problems
Here is the web.xml at top level (Tomcat/conf/web.xml), there is really nothing special about it. Our regular applications don't really need web.xml: http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4"> default org.apache.catalina.servlets.DefaultServlet debug 0 listings true 1 jsp org.apache.jasper.servlet.JspServlet fork true xpoweredBy false 3 default / jsp *.jsp jsp *.jspx 30 ...(mime-mappings) index.jsp index.html index.htm JSP code uses cross context includes and it's really complicated although there is nothing wrong with the code. We have 2 contexts. Here is a sample index.jsp from context / <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %> Here is a part of header.jsp from context /apps <%@ page contentType="text/html; charset=utf-8" language="java" import="xxx.EC" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %> <%@ include file="/shared/ec.jsp" %> <% session.setAttribute("ts", new Long(System.currentTimeMillis())); %> <% if (ec.isClosed()) { %> window.location.href = "/apps/closed.jsp"; <% } else if (ec.isUnderConstruction() && ec.getHttpHost().indexOf("ednet.ws") < 0) { %> window.location.href = "/apps/under_construction.jsp"; <% } %> <%= ec.getWebsiteName() %> " /> <c:import url="/shared/main.css" context="/" /> Please note that header.jsp in /apps includes another header.jsp in /. The second header.jsp in / doesn't have any includes. It's plain HTML code... HPNews.jsp in context /apps is something like this: <%@ page contentType="text/html; charset=utf-8" language="java" import="xxx.EC, xxx.MySQLTable, xxx.StringUtils, xxx.News" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %> <%@ include file="/shared/ec.jsp" %> <% News news = new News(ec, pageContext); MySQLTable newsList = news.getHPNews(); %> ... <% if (version.equals("3") || version.equals("4")) { %> <% } %> ... Please let me know what you think. Thanks in advance! Asim On Tue, 29 Mar 2005 15:20:01 -0500, Ramu, Vinod <[EMAIL PROTECTED]> wrote: > Could we get the jsp code and web.xml configuration? > > Vinod > > -Original Message- > From: Asim Alp [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 29, 2005 3:14 PM > To: Tomcat Users List > Subject: include / c:import problems > > Hi, > > We're using Tomcat 5.5.7 on Windows Server 2003 with Sun's J2SE 5.0. > From time to time, we have problems with jsp:includes and c:imports. > For some reason, the whole page gets included more than once. For > example; > > on index.jsp, we have news.jsp and events.jsp includes. > > From time to time here is what happens: > index.jsp loads. news.jsp gets included. Instead of events.jsp > index.jsp gets included. On that second index.jsp, news.jsp and > events.jsp gets included successfully. We end up getting very weird > looking pages. > > We have no idea why this happens as the code is correct. In fact, the > page loads correctly after a refresh. This seems to happen once every > 100 loads... > > Any ideas? > > Asim > > - > 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]