Re: sessionCookieDomain and sessionCookiePath
context.xml On Thu, Nov 10, 2011 at 7:05 PM, Pid * p...@pidster.com wrote: On 10 Nov 2011, at 13:06, Ionut Stoian isto...@tremend.ro wrote: It was a typo, i meant /. They are available also on tomcat 6.0.27: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html -- Forwarded message -- From: Pid p...@pidster.com To: Tomcat Users List users@tomcat.apache.org Date: Thu, 10 Nov 2011 09:28:15 + Subject: Re: sessionCookieDomain and sessionCookiePath On 10/11/2011 08:39, Ionut Stoian wrote: Hello, I have an application serving several subdomains (a1.domain.com, a2.domain.com etc.) and i want to be able to have a single session cookie shared between subdomains (registered on domain .domain.com). However, when using Tomcat's sessionCookieDomain (tried on versions 6.0.33, 7.0.22) i don't get the expected behaviour: 1. If i set the sessionCookiePath to \test for example i get only one JSESSIONID cookie with domain .domain.com, but the path obviously is set to /test. 2. If i set the sessionCookiePath to \, or if i don't set it at all, i get a JSESSIONID cookie with domain .domain.com and a JSESSIONID cookie with domain a1.domain.com, which is not what i expect. Why would you set it to '\' or anything that starts with '\'? sessionCookieDomain, sessionCookiePath are Servlet 3.0 (ie Tomcat 7.0) configuration directives. They won't work in Tomcat 6.0. Where did you set them? In tomcat/conf/context.xml or somewhere else? p Please don't top post. I missed that addition to 6.0. (must read release notes to see what else I missed). Can you confirm which file you set the config in? p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
tomcat-dbcp interceptors
Hello Tomcat users, I have couple of tomcat-dbcp related questions: 1) Can tomcat-dbcp be used outside of tomcat e.g. in non-web apps? 2) If yes, are all features available as when used within tomcat? 3) Most importantly are custom interceptors supported when tomcat-dbcp is used outside tomcat? 4) Can custom interceptor influence/extend connection validation? Would like not only to configure validation query but also to add extra logic which would process result of the query. 5) Are there any examples, documentation, blog posts showing implementations of custom interceptors? Thanks in advance! Regards, Stevo. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat-dbcp interceptors
1) Can tomcat-dbcp be used outside of tomcat e.g. in non-web apps? Yes, but tomcat-dbcp is exactly the same as commons-dbcp. You would probably just want to use commons-dbcp. 2) If yes, are all features available as when used within tomcat? It has the same feature set as commons-dbcp. https://commons.apache.org/dbcp/ 3) Most importantly are custom interceptors supported when tomcat-dbcp is used outside tomcat? 4) Can custom interceptor influence/extend connection validation? Would like not only to configure validation query but also to add extra logic which would process result of the query. 5) Are there any examples, documentation, blog posts showing implementations of custom interceptors? I'm not exactly sure what you are referring to with regard to the interceptors. Which version of Tomcat are you using? How are you configuring this within Tomcat? Dan
Re: tomcat-dbcp interceptors
Hello Daniel, You're right, commons-dbcp and tomcat-dbcp seem to be same, I missed tomcat-jdbc module which seems to provide extensions and judging by the pom (see [1]) it depends only on tomcat-juli. I found the answers at [2] and [3]. Thanks! Regards, Stevo. [1] http://repo1.maven.org/maven2/org/apache/tomcat/tomcat-jdbc/7.0.22/tomcat-jdbc-7.0.22.pom [2] http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html [3] http://vigilbose.blogspot.com/2009/03/apache-commons-dbcp-and-tomcat-jdbc.html On Fri, Nov 11, 2011 at 2:35 PM, Daniel Mikusa dmik...@vmware.com wrote: 1) Can tomcat-dbcp be used outside of tomcat e.g. in non-web apps? Yes, but tomcat-dbcp is exactly the same as commons-dbcp. You would probably just want to use commons-dbcp. 2) If yes, are all features available as when used within tomcat? It has the same feature set as commons-dbcp. https://commons.apache.org/dbcp/ 3) Most importantly are custom interceptors supported when tomcat-dbcp is used outside tomcat? 4) Can custom interceptor influence/extend connection validation? Would like not only to configure validation query but also to add extra logic which would process result of the query. 5) Are there any examples, documentation, blog posts showing implementations of custom interceptors? I'm not exactly sure what you are referring to with regard to the interceptors. Which version of Tomcat are you using? How are you configuring this within Tomcat? Dan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Log exception logging
Hello, Does there is a way to make tomcat log exception (with stacktrace) thrown by servlet? I do not want my app to do that because I like the way tomcat handles exceptions: 500 error and error page is ok, but I need exception stacktrace to be logged so I would be able to configure logging engine to send me emails and save trace to files and so on. Thanks. Ilya Kazakevich, Developer JetBrains Inc http://www.jetbrains.com Develop with pleasure! - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Log exception logging
2011/11/11 Ilya Kazakevich ilya.kazakev...@jetbrains.com: Does there is a way to make tomcat log exception (with stacktrace) thrown by servlet? I do not want my app to do that because I like the way tomcat handles exceptions: 500 error and error page is ok, but I need exception stacktrace to be logged so I would be able to configure logging engine to send me emails and save trace to files and so on. What makes you think that it does not log them? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Log exception logging
I am running tomcat 6.0 Docs say it should log them into stdout but it does not. My stdout starts with: .. INFO: Initializing Coyote HTTP/1.1 on http-8080 11.11.2011 20:18:36 org.apache.coyote.http11.Http11Protocol init My app throws exception. Tomcat displays 500 error. But nothing found in logs. Ilya Kazakevich, Developer JetBrains Inc http://www.jetbrains.com Develop with pleasure! -Original Message- From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] Sent: Friday, November 11, 2011 8:17 PM To: Tomcat Users List Subject: Re: Log exception logging 2011/11/11 Ilya Kazakevich ilya.kazakev...@jetbrains.com: Does there is a way to make tomcat log exception (with stacktrace) thrown by servlet? I do not want my app to do that because I like the way tomcat handles exceptions: 500 error and error page is ok, but I need exception stacktrace to be logged so I would be able to configure logging engine to send me emails and save trace to files and so on. What makes you think that it does not log them? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Log exception logging
2011/11/11 Ilya Kazakevich ilya.kazakev...@jetbrains.com: I am running tomcat 6.0 Do you know there are ~30 different versions of 6.0.x ? Docs say it should log them into stdout but it does not. My stdout starts with: What docs? .. INFO: Initializing Coyote HTTP/1.1 on http-8080 11.11.2011 20:18:36 org.apache.coyote.http11.Http11Protocol init My app throws exception. Tomcat displays 500 error. But nothing found in logs. Please do not top-post. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JVM config for tomcat7.0.19
Is this JAVA setting below OK ? cat /proc/meminfo MemTotal: 4149124 kB MemFree:457884 kB 4Gb total memory on the linux box and have 0.4GB free memory and tomcat(6.0.18) running with below : JAVA_OPTS=-Xmx2000M so that i.e 1.9GB ?? or please suggest me the best settings that i add and not have any memory leak issues on the application.. Pid * wrote: On 10/11/2011 22:45, Igor Cicimov wrote: JAVA_OPTS=-Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m You are allocating here 2.5GB of memory to tomcat ... how do you expect it to start on a box with 2GB in total of which only 500MB are available? +1 It's the perfect way to achieve shockingly bad performance. p On Fri, Nov 11, 2011 at 8:25 AM, Christopher Schultz ch...@christopherschultz.net wrote: Celtic, On 11/10/11 12:02 PM, celtic man wrote: So i have updated the setenv.sh with -Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m and restarted tomcat.. Where is setenv.sh located? Can you give us the full contents of that file? but when i grep for tomcat process i don't see it .. ps -ef | grep tomcat root 10959 1 19 14:57 pts/4 00:00:29 /appl/java/bin/java -Dnop -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/appl/tomcat/endorsed -classpath /appl/tomcat/bin/bootstrap.jar:/appl/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/appl/tomcat -Dcatalina.home=/appl/tomcat -Djava.io.tmpdir=/appl/tomcat/temp org.apache.catalina.startup.Bootstrap start How are you starting Tomcat? Give us the exact command you are running. -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- [key:62590808] -- View this message in context: http://old.nabble.com/JVM-config-for-tomcat7.0.19-tp32819635p32826835.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Log exception logging
Do you know there are ~30 different versions of 6.0.x ? 6.0.32 What docs? http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Console I believe uncought exception should be printed to stderr as it does by java.lang.ThreadGroup.uncaughtException. That is my tomcat misconfiguration not a tomcat bug, is not it? Ilya. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Log exception logging
2011/11/11 Ilya Kazakevich ilya.kazakev...@jetbrains.com: Do you know there are ~30 different versions of 6.0.x ? 6.0.32 What docs? http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Console I believe uncought exception should be printed to stderr as it does by java.lang.ThreadGroup.uncaughtException. And what makes you think that exception thrown by a servlet are uncaught? Only if a servlet starts a thread and that thread throws an exception there is nothing to catch it. A Servlet itself is always executed by Tomcat (if you have ever seen the stacktraces printed by servlets). It does not prevent Servlet form using proper logging framework, or those old log() methods in Servlet API. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JVM config for tomcat7.0.19
On Thu, 2011-11-10 at 12:02 -0800, celtic man wrote: Thanks a lot for the quick response.. So i have updated the setenv.sh with -Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m and restarted tomcat.. but when i grep for tomcat process i don't see it .. ps -ef | grep tomcat root 10959 1 19 14:57 pts/400:00:29 /appl/java/bin/java -Dnop -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/appl/tomcat/endorsed -classpath /appl/tomcat/bin/bootstrap.jar:/appl/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/appl/tomcat -Dcatalina.home=/appl/tomcat -Djava.io.tmpdir=/appl/tomcat/temp org.apache.catalina.startup.Bootstrap start If that's the output of grep after starting tomcat then you are in fact seeing it. Tomcat is a *java* application. Hence it runs under java. do you know why ?? Christopher Schultz-2 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Celtic, On 11/10/11 8:01 AM, celtic man wrote: Can i set the below parameters on the setenv.sh? Sure. application running on tomcat7.0.19 on linux 64 bit with 2GB total memory and 0.5 GB available memory on the machine. JAVA_OPTS=-Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m If you only have 0.5GiB available, perhaps requesting a 2GiB heap isn't wise. The current setting on the setenv.sh file is : CATALINA_OPTS=-Xmx4000M Well, lowering it from 4GiB to 2 GiB will certainly help free up some of your RAM. If you only have a 2GiB machine, why bother running 64-bit? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk68AJEACgkQ9CaO5/Lv0PBL6wCfR7KU0u5uYtX57GBJOZd6oI49 hzYAoLOjPtnLyZjQ7bSoOVI/ti+LO9rC =qUbu -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JVM config for tomcat7.0.19
On Fri, 2011-11-11 at 08:40 -0800, celtic man wrote: Is this JAVA setting below OK ? cat /proc/meminfo MemTotal: 4149124 kB MemFree:457884 kB 4Gb total memory on the linux box and have 0.4GB free memory and I think MemFree misleading. Don't quote me but I think you have to add Buffers as well. Or if you can run gnome apps try running gnome-system-monitor and click the Resources tab. Gives a more realistic picture I think. tomcat(6.0.18) running with below : JAVA_OPTS=-Xmx2000M so that i.e 1.9GB ?? or please suggest me the best settings that i add and not have any memory leak issues on the application.. No setting will fix a memory leak. Eventually you'll get OutOfMemoryExceptions. It becomes a question of when and how often do you want to restart. You haven't actually indicated in this thread whether you're getting OOMs. Is that the problem you're trying to address? Pid * wrote: On 10/11/2011 22:45, Igor Cicimov wrote: JAVA_OPTS=-Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m You are allocating here 2.5GB of memory to tomcat ... how do you expect it to start on a box with 2GB in total of which only 500MB are available? +1 It's the perfect way to achieve shockingly bad performance. p On Fri, Nov 11, 2011 at 8:25 AM, Christopher Schultz ch...@christopherschultz.net wrote: Celtic, On 11/10/11 12:02 PM, celtic man wrote: So i have updated the setenv.sh with -Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m and restarted tomcat.. Where is setenv.sh located? Can you give us the full contents of that file? but when i grep for tomcat process i don't see it .. ps -ef | grep tomcat root 10959 1 19 14:57 pts/4 00:00:29 /appl/java/bin/java -Dnop -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/appl/tomcat/endorsed -classpath /appl/tomcat/bin/bootstrap.jar:/appl/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/appl/tomcat -Dcatalina.home=/appl/tomcat -Djava.io.tmpdir=/appl/tomcat/temp org.apache.catalina.startup.Bootstrap start How are you starting Tomcat? Give us the exact command you are running. -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- [key:62590808] - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JVM config for tomcat7.0.19
On 11/11/2011 16:40, celtic man wrote: Is this JAVA setting below OK ? cat /proc/meminfo MemTotal: 4149124 kB MemFree:457884 kB 4Gb total memory on the linux box and have 0.4GB free memory and tomcat(6.0.18) running with below : JAVA_OPTS=-Xmx2000M so that i.e 1.9GB ?? or please suggest me the best settings that i add and not have any memory leak issues on the application.. Please don't top-post. No-one can really answer the question you have asked, we don't know enough about your application or how much memory it needs to use. We can only advise you to avoid bad configuration. Trying to assign 2Gb to a Java process if the OS only has 0.5Gb free beforehand is bad configuration. And maths, it's also Bad Maths. If you use JAVA_OPTS to set memory config, (as below), you will create a JVM instance with 2Gb of RAM, if you are using the shutdown.sh script which will run as well as the existing Tomcat instance. Both processes will end up using the swap, be horribly slow probably OOM. If you use CATALINA_OPTS, these values are not applied during shutdown but are used during startup. You have 4Gb of physical RAM. The amount of memory you can use for Tomcat is the amount of free RAM when Tomcat is not running. If your server (without Tomcat) has 2Gb free, then Tomcat can use up to 2Gb. The -Xmx and -Xms settings apply to the Object Heap. The Object Heap is only one part of the memory that a Java process consumes. (The Non-Heap area includes the PermGen space, for example.) So, with 2Gb free RAM, you may be able to set -Xmx to 1.2Gb (this is a guess, not a hard rule). You will have to test it yourself to determine what is safe. Use VisualVM or JConsole (both are included with the JDK) to measure heap/non-heap usage and compare it to the amount that the OS says the process is using. p Pid * wrote: On 10/11/2011 22:45, Igor Cicimov wrote: JAVA_OPTS=-Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m You are allocating here 2.5GB of memory to tomcat ... how do you expect it to start on a box with 2GB in total of which only 500MB are available? +1 It's the perfect way to achieve shockingly bad performance. p On Fri, Nov 11, 2011 at 8:25 AM, Christopher Schultz ch...@christopherschultz.net wrote: Celtic, On 11/10/11 12:02 PM, celtic man wrote: So i have updated the setenv.sh with -Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m and restarted tomcat.. Where is setenv.sh located? Can you give us the full contents of that file? but when i grep for tomcat process i don't see it .. ps -ef | grep tomcat root 10959 1 19 14:57 pts/4 00:00:29 /appl/java/bin/java -Dnop -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/appl/tomcat/endorsed -classpath /appl/tomcat/bin/bootstrap.jar:/appl/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/appl/tomcat -Dcatalina.home=/appl/tomcat -Djava.io.tmpdir=/appl/tomcat/temp org.apache.catalina.startup.Bootstrap start How are you starting Tomcat? Give us the exact command you are running. -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- [key:62590808] -- [key:62590808] signature.asc Description: OpenPGP digital signature
RE: Log exception logging
A Servlet itself is always executed by Tomcat (if you have ever seen the stacktraces printed by servlets). I understand that servlet runs in tomcat's thread-pool. It does not prevent Servlet form using proper logging framework, or those old log() methods in Servlet API. But when my servlet throws exception -- tomcat catches it and displays 500 error. Anyway: I found the error. It was my framework (struts), not tomcat trouble. Tomcat itself logs any exception thrown by filter or servlet. I should check it before write to this list. Sorry. Ilya. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JVM config for tomcat7.0.19
we have JAVA_OPTS set in catalina.sh start_tomcat - /usr/local/scripts/start_tomcat stop_tomcat - /usr/local/tomcat/bin/shutdown.sh MemTotal: 4149124 kB MemFree:381644 kB Buffers:106832 kB Cached:2377208 kB SwapCached: 0 kB Active:2646596 kB Inactive: 968884 kB HighTotal: 3276448 kB HighFree: 108160 kB LowTotal: 872676 kB LowFree:273484 kB SwapTotal: 4194288 kB SwapFree: 4194064 kB Pid * wrote: On 11/11/2011 16:40, celtic man wrote: Is this JAVA setting below OK ? cat /proc/meminfo MemTotal: 4149124 kB MemFree:457884 kB 4Gb total memory on the linux box and have 0.4GB free memory and tomcat(6.0.18) running with below : JAVA_OPTS=-Xmx2000M so that i.e 1.9GB ?? or please suggest me the best settings that i add and not have any memory leak issues on the application.. Please don't top-post. No-one can really answer the question you have asked, we don't know enough about your application or how much memory it needs to use. We can only advise you to avoid bad configuration. Trying to assign 2Gb to a Java process if the OS only has 0.5Gb free beforehand is bad configuration. And maths, it's also Bad Maths. If you use JAVA_OPTS to set memory config, (as below), you will create a JVM instance with 2Gb of RAM, if you are using the shutdown.sh script which will run as well as the existing Tomcat instance. Both processes will end up using the swap, be horribly slow probably OOM. If you use CATALINA_OPTS, these values are not applied during shutdown but are used during startup. You have 4Gb of physical RAM. The amount of memory you can use for Tomcat is the amount of free RAM when Tomcat is not running. If your server (without Tomcat) has 2Gb free, then Tomcat can use up to 2Gb. The -Xmx and -Xms settings apply to the Object Heap. The Object Heap is only one part of the memory that a Java process consumes. (The Non-Heap area includes the PermGen space, for example.) So, with 2Gb free RAM, you may be able to set -Xmx to 1.2Gb (this is a guess, not a hard rule). You will have to test it yourself to determine what is safe. Use VisualVM or JConsole (both are included with the JDK) to measure heap/non-heap usage and compare it to the amount that the OS says the process is using. p Pid * wrote: On 10/11/2011 22:45, Igor Cicimov wrote: JAVA_OPTS=-Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m You are allocating here 2.5GB of memory to tomcat ... how do you expect it to start on a box with 2GB in total of which only 500MB are available? +1 It's the perfect way to achieve shockingly bad performance. p On Fri, Nov 11, 2011 at 8:25 AM, Christopher Schultz ch...@christopherschultz.net wrote: Celtic, On 11/10/11 12:02 PM, celtic man wrote: So i have updated the setenv.sh with -Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m and restarted tomcat.. Where is setenv.sh located? Can you give us the full contents of that file? but when i grep for tomcat process i don't see it .. ps -ef | grep tomcat root 10959 1 19 14:57 pts/4 00:00:29 /appl/java/bin/java -Dnop -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/appl/tomcat/endorsed -classpath /appl/tomcat/bin/bootstrap.jar:/appl/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/appl/tomcat -Dcatalina.home=/appl/tomcat -Djava.io.tmpdir=/appl/tomcat/temp org.apache.catalina.startup.Bootstrap start How are you starting Tomcat? Give us the exact command you are running. -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- [key:62590808] -- [key:62590808] -- View this message in context: http://old.nabble.com/JVM-config-for-tomcat7.0.19-tp32819635p32827354.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JVM config for tomcat7.0.19
On Fri, Nov 11, 2011 at 12:59 PM, celtic man dheerajman...@hotmail.comwrote: we have JAVA_OPTS set in catalina.sh start_tomcat - /usr/local/scripts/start_tomcat stop_tomcat - /usr/local/tomcat/bin/shutdown.sh MemTotal: 4149124 kB MemFree:381644 kB Buffers:106832 kB Cached:2377208 kB SwapCached: 0 kB Active:2646596 kB Inactive: 968884 kB HighTotal: 3276448 kB HighFree: 108160 kB LowTotal: 872676 kB LowFree:273484 kB SwapTotal: 4194288 kB SwapFree: 4194064 kB Please don't top-post. Write your answers BELOW the questions they're answering in your reply emails. To confirm something stated above, on a Unix or Linux system, the memory used for cache (Cached) will basically expand to whatever space it has available to it. So, realistically, the amount of usable free memory on your system is closer to 2.5 GB than 400 MB.
Re: JVM config for tomcat7.0.19
- Original Message - From: celtic man dheerajman...@hotmail.com To: users@tomcat.apache.org Cc: Sent: Friday, November 11, 2011 8:40 AM Subject: Re: JVM config for tomcat7.0.19 Is this JAVA setting below OK ? cat /proc/meminfo MemTotal: 4149124 kB MemFree: 457884 kB 4Gb total memory on the linux box and have 0.4GB free memory and tomcat(6.0.18) running with below : JAVA_OPTS=-Xmx2000M so that i.e 1.9GB ?? or please suggest me the best settings that i add and not have any memory leak issues on the application.. Pid * wrote: On 10/11/2011 22:45, Igor Cicimov wrote: JAVA_OPTS=-Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m You are allocating here 2.5GB of memory to tomcat ... how do you expect it to start on a box with 2GB in total of which only 500MB are available? +1 It's the perfect way to achieve shockingly bad performance. p On Fri, Nov 11, 2011 at 8:25 AM, Christopher Schultz ch...@christopherschultz.net wrote: Celtic, On 11/10/11 12:02 PM, celtic man wrote: So i have updated the setenv.sh with -Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m and restarted tomcat.. Where is setenv.sh located? Can you give us the full contents of that file? but when i grep for tomcat process i don't see it .. ps -ef | grep tomcat root 10959 1 19 14:57 pts/4 00:00:29 /appl/java/bin/java -Dnop -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/appl/tomcat/endorsed -classpath /appl/tomcat/bin/bootstrap.jar:/appl/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/appl/tomcat -Dcatalina.home=/appl/tomcat -Djava.io.tmpdir=/appl/tomcat/temp org.apache.catalina.startup.Bootstrap start How are you starting Tomcat? Give us the exact command you are running. -chris That memory listing is really a snapshot of what's going on in your system. Without more information, it's impossible to say. You really need to do a few things here in order to figure out optimal memory settings. From a systems standpoint: 1. Read about how memory management works on a Linux system. Here are a few quick references (search for more) http://youadmin.net/wiki/Linux:RedHat_meminfo_metrics http://www.redhat.com/magazine/001nov04/features/vm/ http://www.linuxweblog.com/meminfo 2. Run some long term monitoring on your system. vmstat iostat sar Plotting vmstat and iostat over a period of time when your application is being heavily used is useful. Use the above tools to tune your system. From an applications standpoint: You mention a memory leak in your application. Feeding it more memory will just delay the inevitable. You need to fix your leaks. First of all, you need to determine if you have a leak. Tools like JConsole, VisualVM, and mat will help with this. Mark Thomas has given a nice presentation on out of memory issues. He's posted the link in the mailing list several times. I found one link here: http://www.infoq.com/presentations/Diagnosing-Memory-Leaks Once you've fixed memory leaks in your application, you'll then (with information available from the tools above) be able to set appropriate Xmx and XX:MaxPermSize. Note, PermSize issues can be related to classes in your application registering themselves with a class loaded in a parent classloader. When you undeploy or redeploy your application, references stay around and you'll eventually get a PermGen space exception. A good explanation (along with an example to illustrate PermGen issues) can be found here: http://blogs.oracle.com/fkieviet/entry/classloader_leaks_the_dreaded_java In short: 1. Measure system with system tools such as vmstat 2. Measure application with tools such as jconsole, visualvm, mat 3. Fix memory leaks (resource and classloader) 4. Then set memory based on the information from the first 3 steps . . . just my two cents. /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: sessionCookieDomain and sessionCookiePath
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ionut, On 11/11/11 12:11 AM, Ionut Stoian wrote: context.xml Seriously, please don't top-post. On Thu, Nov 10, 2011 at 7:05 PM, Pid * p...@pidster.com wrote: On 10 Nov 2011, at 13:06, Ionut Stoian isto...@tremend.ro wrote: Where did you set them? In tomcat/conf/context.xml or somewhere else? Can you confirm which file you set the config in? Please post your context.xml file. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk69j2QACgkQ9CaO5/Lv0PCaKgCgpqmCKNTeMDxaXbkyb3/cn4fT PoQAn1SMzXGcCdTvGfVWi3weV8PE9v6q =MeKM -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: SSIFilter for Tomcat 6.0.33 and Tomcat 7.0.22
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rogelio, On 11/10/11 4:49 AM, Rogelio Lamas wrote: My name is Roger and this is the first time that i use a mailing list. Sorry for my english. Welcome to the list. Your English is just fine. I am currently trying to set up SSI filter on the tomcat for an application that I'm developing. I followed the How to of Tomcat 6 and 7 but it wasn't work properly. Which version of Tomcat are you actually running? If you have a choice, use the latest version available, which is currently 7.0.22. All SSI instructions are similar to !--#include virtual=/ path/ file.html -- Desperately I tried it with tomcat 5.5.34 and this works correctly activating the SSI filter according to your How to. Just to confirm: your setup works in Tomcat 5.5? In the SSI Filter i actived the parameter isVirtualWebappRelative but is a requirementof my application. You need isVirtualWebappRelative to be true, or you need it to be false? When I run on Tomcat 6 I get the following exception: GRAVE: #include--Couldn't include file: /includes/holamundo.html java.io.IOException: Couldn't get context for path: /includes/holamundo.html Can you post your Context element and give us an overview of your webapp's layout? And in tomcat 7 do not get any data from the log. How are you configuring the SSIFilter? What is the problem? It could be one (or more) of several problems. What are the differences between tomcat 5.5, tomcat 6.0.22 and tomcat 7.0.22? Briefly, TC t.t, 6.0, and 7.0 support different versions of the servlet spec. There are many other non-spec-related differences as well. The SSI stuff should be relatively similar between versions because the requirements have not changed very much. I recommend reading the changelog for each version and searching for ssi to see what has changed, specifically: http://tomcat.apache.org/tomcat-7.0-doc/changelog.html http://tomcat.apache.org/tomcat-6.0-doc/changelog.html http://tomcat.apache.org/tomcat-5.5-doc/changelog.html I attach eclipse project application testing and configuration files tomcat 6 and 5 This list strips most attachments. Try copy/pasting into your next post. The only interesting parts of your configuration will be your context.xml file (you *are* using a context.xml file, right?) and the SSI-related portions of your web.xml file. -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk69kc0ACgkQ9CaO5/Lv0PBJnwCgvJSnKp5noY5JgAzBoLhrH8dM iSQAn1Muq4wPhaDmUqYB67cZO46FKzyl =IL9j -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Log exception logging
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ilya, On 11/11/11 9:33 AM, Ilya Kazakevich wrote: A Servlet itself is always executed by Tomcat (if you have ever seen the stacktraces printed by servlets). I understand that servlet runs in tomcat's thread-pool. It does not prevent Servlet form using proper logging framework, or those old log() methods in Servlet API. But when my servlet throws exception -- tomcat catches it and displays 500 error. Anyway: I found the error. It was my framework (struts), not tomcat trouble. Tomcat itself logs any exception thrown by filter or servlet. Struts 1 and 2 have different ways of handling exceptions. Both are quite flexible -- you just need to become familiar with the configuration and/or coding required. The struts mailing list is a great place to ask questions, but you certainly should read the documentation before you post. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk69koAACgkQ9CaO5/Lv0PCuLwCgvfTYmNmlvjXYMKSD2nys+SId kN4An0Qi87Sx5IhL6gNLV+KDMnBARA5u =dorn -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Service auction is not available
Hi everyone, I successfully deployed and executed first web project(MVC type example) using eclipse and tomcat. But when i try to create second one.. it gives error: org.apache.catalina.core.StandardWrappervalue invoke Info: Servlet auction is currently unavailable I didnt understand whats going wrong. The configurations are exactly as per first one. I searched google and i found others also had faced this problem but could not find right answer. can anyone please help me
Re: Service auction is not available
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Anisha, On 11/11/11 1:54 PM, Anisha Karki wrote: org.apache.catalina.core.StandardWrappervalue invoke Info: Servlet auction is currently unavailable I didnt understand whats going wrong. The configurations are exactly as per first one. Please post your entire catalina.out file (after stopping Tomcat, emptying the file, re-starting Tomcat and triggering your error, of course). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk69pEUACgkQ9CaO5/Lv0PAmqQCgkLGQxa5qY/9FwUHspcFLgKUQ F/wAoLuMrmgA5FGdHIlBLXty1iEck/m5 =XzrN -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Service auction is not available
From: Anisha Karki [mailto:karki.ani...@gmail.com] Subject: Service auction is not available when i try to create second one.. it gives error: org.apache.catalina.core.StandardWrappervalue invoke Info: Servlet auction is currently unavailable Clearly, the above is your version of what was actually displayed, rather than the actual output, with at least two obvious typos and possibly others. Please use copy paste rather than retyping and corrupting the information. Also, you should always tell us the version of Tomcat you're using, the JVM level it's running on, and the platform being used. We can't read your mind. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org