ajp_get_reply, ajp_connection_tcp_get_message Errors
I have been trouble-shooting a problem that appears constantly in my mod_jk.log but is only visible intermittently to users for a few months now. Searching the web and this archive for similar error messages, I have found some solutions that have led me to better Apache and Tomcat setups, but have not solved the problem. The problem is that a commercial application we are serving via Apache/Tomcat will periodically display a "Service Temporarily Unavailable" message in a random frame within the application, refreshing the browser usually allows the users to recover but this becomes painful when users go through the multi-step process of entering data or uploading files only to be interrupted by this and have to start over. Support for the commercial application has not been particularly helpful so I am hoping to find suggestions here to further try to solve this problem. Our setup is Apache 2.0.59 (Win32) mod_ssl/2.0.59 OpenSSL/0.9.8d mod_jk/1.2.19 and Tomcat 5.5.15 running on Windows Server 2003 R2 Service Pack 1. I will include httpd.conf, ssl.conf, workers.properties, and server.xml below. Regardless of whether or not users see the "Service Temporarily Unavailable" message in any of the frames within the application, my mod_jk.log is full of errors like this: [Fri Apr 27 09:38:14 2007] [2764:1792] [error] ajp_get_reply::jk_ajp_common.c (1536): (myworker) Tomcat is down or refused connection. No response has been sent to the client (yet) [Fri Apr 27 09:38:22 2007] [2764:3596] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (947): (myworker) can't receive the response message from tomcat, network problems or tomcat is down (127.0.0.1:8009), err=-54 [Fri Apr 27 09:38:22 2007] [2764:3596] [error] ajp_get_reply::jk_ajp_common.c (1536): (myworker) Tomcat is down or refused connection. No response has been sent to the client (yet) [Fri Apr 27 09:38:25 2007] [2764:2148] [error] ajp_get_reply::jk_ajp_common.c (1536): (myworker) Tomcat is down or refused connection. No response has been sent to the client (yet) [Fri Apr 27 09:38:31 2007] [2764:1792] [error] ajp_connection_tcp_send_message::jk_ajp_common.c (914): sendfull returned -53 with errno=53 [Fri Apr 27 09:38:31 2007] [2764:1792] [error] ajp_send_request::jk_ajp_common.c (1350): (myworker) error sending request body Setting my log level to debug does not tell me much more: [Tue May 15 14:21:38 2007] [1804:3328] [debug] ajp_service::jk_ajp_common.c (1734): processing myworker with 2 retries [Tue May 15 14:21:38 2007] [1804:3328] [info] ajp_send_request::jk_ajp_common.c (1170): (myworker) socket 748 is not connected any more (errno=0) [Tue May 15 14:21:38 2007] [1804:3328] [info] ajp_send_request::jk_ajp_common.c (1194): (myworker) error sending request. Will try another pooled connection [Tue May 15 14:21:38 2007] [1804:3328] [info] ajp_send_request::jk_ajp_common.c (1170): (myworker) socket 784 is not connected any more (errno=0) [Tue May 15 14:21:38 2007] [1804:3328] [info] ajp_send_request::jk_ajp_common.c (1194): (myworker) error sending request. Will try another pooled connection [Tue May 15 14:21:38 2007] [1804:3328] [info] ajp_send_request::jk_ajp_common.c (1218): (myworker) all endpoints are disconnected or dead [Tue May 15 14:21:38 2007] [1804:3328] [info] ajp_service::jk_ajp_common.c (1867): (myworker) sending request to tomcat failed, recoverable operation attempt=1 As these are the only errors I see in any of my log files, I am convinced this is why users will periodically see frames that think Tomcat is not responding, why users do not see these unavailable errors in frames every time it occurs in the mod_jk.log is a little beyond me. We are tied to this version of Tomcat (5.5.15) and to Java 1.5.0_05 by the commercial application we are running, for support purposes, even though their support has been unable to help us. Any help I can get to at least resolve the errors I see in the mod_jk.log would be great or if you see any other errors in my configuration, although I think I have corrected it pretty well. See below. Thanks Brice workers.properties # workers.tomcat_home=D:\Tomcat5515 workers.java_home=D:\jdk1.5.0_05 ps=/ worker.list=myworker worker.myworker.type=ajp13 worker.myworker.host=localhost worker.myworker.port=8009 worker.myworker.cachesize=10 worker.myworker.cache_timeout=600 worker.myworker.socket_keepalive=1 worker.myworker.recycle_timeout=30 worker.myworker.lbfactor=1 # ssl.conf # Listen 443 AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl.crl SSLPassPhraseDialog builtin SSLSessionCache dbm:logs/ssl_scache SSLSessionCacheTimeout 1500 SSLMutex default SSLRandomSeed startup builtin SSLRandomSeed connect builtin # httpd.conf snippet that I feel is relevant, I can post more if needed ###
webapps examples and security manager
ions apply to the servlet API classes // and those that are shared across all class loaders // located in the "common" directory grant codeBase "file:${catalina.home}/common/-" { permission java.security.AllPermission; }; // These permissions apply to the container's core code, plus any additional // libraries installed in the "server" directory grant codeBase "file:${catalina.home}/server/-" { permission java.security.AllPermission; }; // The permissions granted to the balancer WEB-INF/classes and WEB-INF/lib directory grant codeBase "file:${catalina.home}/webapps/balancer/-" { permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester.*"; }; // == WEB APPLICATION PERMISSIONS = // These permissions are granted by default to all web applications // In addition, a web application will be given a read FilePermission // and JndiPermission for all files and directories in its document root. grant { // Required for JNDI lookup of named JDBC DataSource's and // javamail named MimePart DataSource used to send mail permission java.util.PropertyPermission "java.home", "read"; permission java.util.PropertyPermission "java.naming.*", "read"; permission java.util.PropertyPermission "javax.sql.*", "read"; // OS Specific properties to allow read access permission java.util.PropertyPermission "os.name", "read"; permission java.util.PropertyPermission "os.version", "read"; permission java.util.PropertyPermission "os.arch", "read"; permission java.util.PropertyPermission "file.separator", "read"; permission java.util.PropertyPermission "path.separator", "read"; permission java.util.PropertyPermission "line.separator", "read"; // JVM properties to allow read access permission java.util.PropertyPermission "java.version", "read"; permission java.util.PropertyPermission "java.vendor", "read"; permission java.util.PropertyPermission "java.vendor.url", "read"; permission java.util.PropertyPermission "java.class.version", "read"; permission java.util.PropertyPermission "java.specification.version", "read"; permission java.util.PropertyPermission "java.specification.vendor", "read"; permission java.util.PropertyPermission "java.specification.name", "read"; permission java.util.PropertyPermission "java.vm.specification.version", "read"; permission java.util.PropertyPermission "java.vm.specification.vendor", "read"; permission java.util.PropertyPermission "java.vm.specification.name", "read"; permission java.util.PropertyPermission "java.vm.version", "read"; permission java.util.PropertyPermission "java.vm.vendor", "read"; permission java.util.PropertyPermission "java.vm.name", "read"; // Required for OpenJMX permission java.lang.RuntimePermission "getAttribute"; // Allow read of JAXP compliant XML parser debug permission java.util.PropertyPermission "jaxp.debug", "read"; // Precompiled JSPs need access to this package. permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime.*"; // Precompiled JSPs need access to this system property. permission java.util.PropertyPermission "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read"; }; Any help would be more than appreciated. Many thanks in advance, Alan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: webapps examples and security manager
Thanks for your reply. Not yet, which one would suggest me please? Alan On Tue, Sep 22, 2009 at 17:27, Mark Thomas wrote: > Alan wrote: > >> Any help would be more than appreciated. > > And when you try with a more recent version? > > Mark > > > > > - > 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: webapps examples and security manager
Ok, I downloaded the latest and did: wget -c http://mirror.ox.ac.uk/sites/rsync.apache.org/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz tar xvfz apache-tomcat-5.5.28.tar.gz # gnu tar cd ~/Programmes/apache-tomcat-6.0.20 export CATALINA_HOME=$PWD amadeus[2161]:~/Programmes/apache-tomcat-6.0.20% $CATALINA_HOME/bin/catalina.sh run -securityUsing CATALINA_BASE: /Users/alan/Programmes/apache-tomcat-6.0.20 Using CATALINA_HOME: /Users/alan/Programmes/apache-tomcat-6.0.20 Using CATALINA_TMPDIR: /Users/alan/Programmes/apache-tomcat-6.0.20/temp Using JRE_HOME: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home Using Security Manager Please use CMSClassUnloadingEnabled in place of CMSPermGenSweepingEnabled in the future Could not load Logmanager "org.apache.juli.ClassLoaderLogManager" java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) [snip] I got basically the same thing as in tomcat 5.5. So, how do I do to make at least the webapps examples that come with tomcat to run smoothly with security manager? How to tweak catalina.policy in order to not see all this issues in log? Many thanks in advance, Alan On Tue, Sep 22, 2009 at 18:49, Caldarale, Charles R wrote: >> From: Alan [mailto:alanwil...@gmail.com] >> Subject: Re: webapps examples and security manager >> >> Not yet, which one would suggest me please? > > The latest, always (6.0.20). > > - 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
Re: webapps examples and security manager
Thanks Mark, let's deal by parts: On Wed, Sep 23, 2009 at 16:33, Mark Thomas wrote: > Alan wrote: >> Ok, I downloaded the latest and did: >> >> wget -c >> http://mirror.ox.ac.uk/sites/rsync.apache.org/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz >> tar xvfz apache-tomcat-5.5.28.tar.gz # gnu tar > > What is going on here? Which version of Tomcat are you using? amadeus[2195]:~/Programmes% $CATALINA_HOME/bin/catalina.sh version Using CATALINA_BASE: /Users/alan/Programmes/apache-tomcat-6.0.20 Using CATALINA_HOME: /Users/alan/Programmes/apache-tomcat-6.0.20 Using CATALINA_TMPDIR: /Users/alan/Programmes/apache-tomcat-6.0.20/temp Using JRE_HOME: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home Server version: Apache Tomcat/6.0.20 Server built: May 14 2009 01:13:50 Server number: 6.0.20.0 OS Name:Mac OS X OS Version: 10.6.1 Architecture: x86_64 JVM Version:1.6.0_15-b03-219 JVM Vendor: Apple Inc. >> cd ~/Programmes/apache-tomcat-6.0.20 >> export CATALINA_HOME=$PWD >> amadeus[2161]:~/Programmes/apache-tomcat-6.0.20% >> $CATALINA_HOME/bin/catalina.sh run -securityUsing CATALINA_BASE: >> /Users/alan/Programmes/apache-tomcat-6.0.20 >> Using CATALINA_HOME: /Users/alan/Programmes/apache-tomcat-6.0.20 >> Using CATALINA_TMPDIR: /Users/alan/Programmes/apache-tomcat-6.0.20/temp >> Using JRE_HOME: >> /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home > > Which JVM is this? What does: > java -version > return? amadeus[2197]:~/Programmes% java -version java version "1.6.0_15" Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219) Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-90, mixed mode) >> Using Security Manager >> Please use CMSClassUnloadingEnabled in place of >> CMSPermGenSweepingEnabled in the future > > Hmm. You shouldn't see that with a default Tomcat install so it looks > like you aren't running what you think you are running. Indeed, testing on Ubuntu, I don't get this message. More below. >> Could not load Logmanager "org.apache.juli.ClassLoaderLogManager" >> java.security.AccessControlException: access denied >> (java.lang.RuntimePermission setContextClassLoader) >> at >> java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) >> [snip] > > This works out of the for me on Leopard. I don't have access to a > machine with Snow Leopard although it is unlikely that is the issue. > >> So, how do I do to make at least the webapps examples that come with >> tomcat to run smoothly with security manager? How to tweak >> catalina.policy in order to not see all this issues in log? > > Indications are you aren't running a vanilla Tomcat 6.0.20 install. A > clean install works for me in Windows, OSX and linux. > > Mark I frankly don't understand what's going on, so I will put in a sort of script-like what I did. First I got tomcat from http://tomcat.apache.org/download-60.cgi (Binary distr. -> Core). Should I get the source code and compile myself? #-- # commands cd # get binary core package from a mirror wget -c http://mirror.lividpenguin.com/pub/apache/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz # uncompress with gnu tar tar xvfz apache-tomcat-6.0.20.tar.gz cd apache-tomcat-6.0.20 export CATALINA_HOME=$PWD $CATALINA_HOME/bin/catalina.sh version $CATALINA_HOME/bin/catalina.sh run -security #-- I did the same commands in a clean install of Ubuntu Linux 9.04 64 bits and got the same problem. I would love to see what you get doing the commands above, or please tell me what should I change if they are not OK. >From Ubuntu: a...@ubuntu:~/apache-tomcat-6.0.20/logs$ $CATALINA_HOME/bin/catalina.sh version Using CATALINA_BASE: /home/alan/apache-tomcat-6.0.20 Using CATALINA_HOME: /home/alan/apache-tomcat-6.0.20 Using CATALINA_TMPDIR: /home/alan/apache-tomcat-6.0.20/temp Using JRE_HOME: /usr Server version: Apache Tomcat/6.0.20 Server built: May 14 2009 01:13:50 Server number: 6.0.20.0 OS Name:Linux OS Version: 2.6.28-15-generic Architecture: amd64 JVM Version: 1.6.0_16-b01 JVM Vendor: Sun Microsystems Inc. a...@ubuntu:~/apache-tomcat-6.0.20/logs$ $CATALINA_HOME/bin/catalina.sh run -security Using CATALINA_BASE: /home/alan/apache-tomcat-6.0.20 Using CATALINA_HOME: /home/alan/apache-tomcat-6.0.20 Using CATALINA_TMPDIR: /home/alan/apache-tomcat-6.0.20/temp Using JRE_HOME: /usr Using Security Manager Could not load Logmanager "org.apache.juli.ClassLoaderLogManager" java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextCla
Re: webapps examples and security manager
Many thanks dear Mark. It's late here too but I finally, with your diligent and precious help, I could figure out what's going on here and even manage to have tomcat with security working for tomcat6.0.20 and tomcat5.5.28 (but not for tomcat5.5.26, last version available for Mac via Fink). Thank you very much. Alan On Wed, Sep 23, 2009 at 21:42, Mark Thomas wrote: > Mark Thomas wrote: >> Mark Thomas wrote: >>> Alan wrote: >>>> Thanks Mark, let's deal by parts: >>> OK. I've reproduced it. It is happening with 1.6.0_14 and 1.6.0_16 JVMs >>> but not a 1.6.0_00 JVM. >>> >>> The latest 1.5 JVM seems OK too. >>> >>> Time to check the release notes. I'll hopefully have a workaround (other >>> than using Java 1.5) shortly. >> >> Still not clear why it is required for later JVM versions > > > > It is late and I have been in front my PC for too long today. This has > already been fixed (by me!) in trunk and proposed for 6.0.x and 5.5.x. > It looks the implementation of LogManager (ClassLoaderLogManager extends > LogManager) has changed - hence the need for the new permission. > > Mark > > > > - > 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: webapps examples and security manager
Hallelujah! I finally figured out what's going on with tomcat 5.5.26 when running webapps in security mode. In Ubuntu 9.04, with just the addition of 'permission java.lang.RuntimePermission "setContextClassLoader";' in catalina.policy solved the problem. This is happen because ubuntu has its own way of starting the deamon and apparently they fixed some problems that in tomcat 5.5.26 official distribution is not. Since Fink also use the official distribution, I found out that I need to tweak catalina.policy a bit further there. See the patch: --- catalina.policy 2009-09-24 13:51:41.00000 +0100 +++ /Users/alan/SCRIPTS/catalina.policy 2009-09-24 13:50:24.0 +0100 @@ -66,7 +66,7 @@ }; // These permissions apply to the commons-logging API -grant codeBase "file:${catalina.home}/bin/commons-logging-api.jar" { +grant codeBase "file:${catalina.home}/bin/commons-logging-api-1.1.1.jar" { permission java.security.AllPermission; }; @@ -82,6 +82,7 @@ // These permissions apply to JULI grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" { +permission java.lang.RuntimePermission "setContextClassLoader"; permission java.util.PropertyPermission "java.util.logging.config.class", "read"; permission java.util.PropertyPermission "java.util.logging.config.file", "read"; permission java.lang.RuntimePermission "shutdownHooks"; @@ -95,6 +96,8 @@ // Be sure that the logging configuration is secure before enabling such access // eg for the examples web application: // permission java.io.FilePermission "${catalina.base}${file.separator}webapps${file.separator}examples${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties", "read"; +permission java.io.FilePermission "${catalina.base}${file.separator}webapps${file.separator}jsp-examples${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties", "read"; +permission java.io.FilePermission "${catalina.base}${file.separator}webapps${file.separator}servlets-examples${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties", "read"; }; // These permissions apply to the servlet API classes This basic solved my problems. Alan On Wed, Sep 23, 2009 at 22:58, Alan wrote: > Many thanks dear Mark. > > It's late here too but I finally, with your diligent and precious > help, I could figure out what's going on here and even manage to have > tomcat with security working for tomcat6.0.20 and tomcat5.5.28 (but > not for tomcat5.5.26, last version available for Mac via Fink). > > Thank you very much. > > Alan > > On Wed, Sep 23, 2009 at 21:42, Mark Thomas wrote: >> Mark Thomas wrote: >>> Mark Thomas wrote: >>>> Alan wrote: >>>>> Thanks Mark, let's deal by parts: >>>> OK. I've reproduced it. It is happening with 1.6.0_14 and 1.6.0_16 JVMs >>>> but not a 1.6.0_00 JVM. >>>> >>>> The latest 1.5 JVM seems OK too. >>>> >>>> Time to check the release notes. I'll hopefully have a workaround (other >>>> than using Java 1.5) shortly. >>> >>> Still not clear why it is required for later JVM versions >> >> >> >> It is late and I have been in front my PC for too long today. This has >> already been fixed (by me!) in trunk and proposed for 6.0.x and 5.5.x. >> It looks the implementation of LogManager (ClassLoaderLogManager extends >> LogManager) has changed - hence the need for the new permission. >> >> Mark >> >> >> >> - >> 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: webapps examples and security manager
Well, I'll try to make it clearer: Situation: Ubuntu 9.04 with SUN Java 1.6 and tomcat 5.5.26 with security mode (default in Debian/Ubuntu). Testing tomcat-webapps examples. A clean install and everything seems to work, except that nothing is written in /var/log/tomcat5.5 To solve this issue, I had to add: permission java.lang.RuntimePermission "setContextClassLoader"; in /etc/tomcat5.5/policy.d/03catalina.policy. If using openJDK instead of Sun Java, this is not necessary. The patch I sent before is for those using tomcat5.5.26 in Mac OSX and Fink use this distribution. Did it help? Alan On Thu, Sep 24, 2009 at 14:57, Pid wrote: > On 24/09/2009 14:11, Alan wrote: >> >> Hallelujah! >> >> I finally figured out what's going on with tomcat 5.5.26 when running >> webapps in security mode. >> >> In Ubuntu 9.04, with just the addition of 'permission >> java.lang.RuntimePermission "setContextClassLoader";' in >> catalina.policy solved the problem. This is happen because ubuntu has >> its own way of starting the deamon and apparently they fixed some >> problems that in tomcat 5.5.26 official distribution is not. > > Really? Could you let us know what? > > p > > >> Since Fink also use the official distribution, I found out that I need >> to tweak catalina.policy a bit further there. See the patch: >> >> --- catalina.policy 2009-09-24 13:51:41.0 +0100 >> +++ /Users/alan/SCRIPTS/catalina.policy 2009-09-24 13:50:24.0 >> +0100 >> @@ -66,7 +66,7 @@ >> }; >> >> // These permissions apply to the commons-logging API >> -grant codeBase "file:${catalina.home}/bin/commons-logging-api.jar" { >> +grant codeBase "file:${catalina.home}/bin/commons-logging-api-1.1.1.jar" >> { >> permission java.security.AllPermission; >> }; >> >> @@ -82,6 +82,7 @@ >> >> // These permissions apply to JULI >> grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" { >> + permission java.lang.RuntimePermission "setContextClassLoader"; >> permission java.util.PropertyPermission >> "java.util.logging.config.class", "read"; >> permission java.util.PropertyPermission >> "java.util.logging.config.file", "read"; >> permission java.lang.RuntimePermission "shutdownHooks"; >> @@ -95,6 +96,8 @@ >> // Be sure that the logging configuration is secure before >> enabling such access >> // eg for the examples web application: >> // permission java.io.FilePermission >> >> "${catalina.base}${file.separator}webapps${file.separator}examples${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties", >> "read"; >> + permission java.io.FilePermission >> >> "${catalina.base}${file.separator}webapps${file.separator}jsp-examples${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties", >> "read"; >> + permission java.io.FilePermission >> >> "${catalina.base}${file.separator}webapps${file.separator}servlets-examples${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties", >> "read"; >> }; >> >> // These permissions apply to the servlet API classes >> >> >> This basic solved my problems. >> >> Alan >> >> On Wed, Sep 23, 2009 at 22:58, Alan wrote: >>> >>> Many thanks dear Mark. >>> >>> It's late here too but I finally, with your diligent and precious >>> help, I could figure out what's going on here and even manage to have >>> tomcat with security working for tomcat6.0.20 and tomcat5.5.28 (but >>> not for tomcat5.5.26, last version available for Mac via Fink). >>> >>> Thank you very much. >>> >>> Alan >>> >>> On Wed, Sep 23, 2009 at 21:42, Mark Thomas wrote: >>>> >>>> Mark Thomas wrote: >>>>> >>>>> Mark Thomas wrote: >>>>>> >>>>>> Alan wrote: >>>>>>> >>>>>>> Thanks Mark, let's deal by parts: >>>>>> >>>>>> OK. I've reproduced it. It is happening with 1.6.0_14 and 1.6.0_16 >>>>>> JVMs >>>>>> but not a 1.6.0_00 JVM. >>>>>> >>>>>> The latest 1.5 JVM seems OK too. >&
my webapps and security manager
* read,write) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) [snip] Is not 'permission java.util.PropertyPermission "*", "read,write";' too lax? If so, how then can I find out what "java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)" wants to tell me? Obviously I am doing something wrong, but the fact I've been playing with that for more than a week and I'm getting really tired, which is likely weakening my sense of observation and reason and I am probably skipping something obvious if not the whole thing at all. Any help would be very very appreciated. Many thanks in advance, Alan -- Alan Wilter Sousa da Silva, D.Sc. PDBe group, PiMS project http://www.pims-lims.org/ EMBL - EBI, Wellcome Trust Genome Campus, Hinxton, Cambridge CB10 1SD, UK +44 (0)1223 492 583 (office) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Fwd: NoClassDefFoundError: javax/mail/Authenticator
I am attempting to send e-mail from Tomcat using an external mail host - mail.btinternet.com. I have included javax.mail jar in my build path and can see javax.mail.Authenticator in this library. When trying to start up apache-tomcat-9.0.91 I get IllegalStateException: Error starting child Caused by: java.lang.NoClassDefFoundError: javax/mail/Authenticator any help would be appreciated please.
Where do find debug logging
We have some applications which are pushing out to their own applogs clearly showing 'Debug' on most lines with a large amount of data and CI. I would like to find out where the app team are setting this level, I have check in the obvious in the war files as it's a Spring Boot app in application.properties and logback.xml but mention error only there. Any advice appreciated thanks
Dealing with an insecure Struts application on Tomcat
I am looking at security steps to mitigate issues with a 1.x Struts based app. I have recommended the following until an upgrade resource is available Remove application from current shared datasource Remediate high risk CVE scored vulnerabilities (x4 with high EPSS rating) Reduce exposure to internal audience. Create new db and instance for above isolated datasource Would you take it further and ensure this runs on it's own separate Tomcat instance? Any other recommendations?
Problem starting Tomcat localhost
I have configured apache-tomcat-9.0.91 to run as localhost:8080 on Windows 11. Once I have executed the startup.bat, and open localhost:8080 and get: If you're seeing this, you've successfully installed Tomcat. Congratulations However frequently when closing down with shutdown.bat and re-starting with startup.bat then opening localhost:8080 I get: HTTP Status 404 – Not Found *Type*Status Report *Message*The requested resource [/] is not available *Description*The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. Apache Tomcat/9.0.91 After various attempts to shutdown / re-start I get some success, but this is quite frustrating and makes using it for testing purposes difficult. Any suggestions would be welcome. Alan.
How to Call a Java Class in JSP
Hello, I am attempting to revise on JSP which I used as a full time developer before my retirement over 8 years ago. The article How to Call a Java Class in JSP <https://www.javaguides.net/2019/01/how-to-call-java-class-in-jsp.html#google_vignette> provides a simple example of the code, but avoids explaining how to deploy to Tomcat. I have created a WAR file from this example and attempted to deploy via the "Tomcat Web Application Manager" which does not work. I suspect I need a web.xml file, but not clear how that should be organised. So sorry for this basic question, but I would be very grateful for some simple guidance. Alan.
Re: How to Call a Java Class in JSP
: Alan, On 03.08.2024 17:33, Alan Masters wrote: Hello, I am attempting to revise on JSP which I used as a full time developer before my retirement over 8 years ago. The article How to Call a Java Class in JSP <https://www.javaguides.net/2019/01/how-to-call-java-class-in-jsp.html#google_vignette> provides a simple example of the code, but avoids explaining how to deploy to Tomcat. I have created a WAR file from this example and attempted to deploy via the "Tomcat Web Application Manager" which does not work. I suspect I need a web.xml file, but not clear how that should be organised. How did you create the WAR file? Usually you just drop the WAR file into tomcat/webapps and the app will be deployed automatically. If you want to redeploy the app, just overwrite the existing WAR file with the updated one. Also, what "does not work"? Any errors? Please look into the log files in tomcat/logs. Sebastian - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: How to Call a Java Class in JSP
Many thanks Sebastian, I was over-complicating what appears to be a fairly straightforward matter. Alan. On 03/08/2024 17:51, Sebastian Trost wrote: Alan, On 03.08.2024 18:19, Alan Masters wrote: This is the extract from the logs: 03-Aug-2024 15:15:16.500 SEVERE [http-nio-8080-exec-10] org.apache.catalina.startup.ExpandWar.copy Error copying [C:\Program Files\apache-tomcat-9.0.91\apache-tomcat-9.0.91\webapps\Downloads\CalculatorJSP.war] to [C:\Program Files\apache-tomcat-9.0.91\apache-tomcat-9.0.91\webapps\CalculatorJSP.war] java.io.FileNotFoundException: C:\Program Files\apache-tomcat-9.0.91\apache-tomcat-9.0.91\webapps\Downloads\CalculatorJSP.war (The system cannot find the path specified) I'm not sure what you're doing - please just manually drop your CalculatorJSP.war in C:\Program Files\apache-tomcat-9.0.91\apache-tomcat-9.0.91\webapps. Then check if inside the webapps directory a new directory calles 'CalculatorJSP' has been created. If so, please try to open http://localhost:8080/CalculatorJSP/calculator.jsp with your browser. Sebastian - 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
Tomcat Unable to Read JNDI xml file
I have just created a JNDI file for the spring boot application to read in the db info But I have this error during startup: java.util.InvalidPropertiesFormatException: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 53; Document root element "Context", must match DOCTYPE root "null". I think there is something wrong with the DOCTYPE. How should I specify it? Please help. Thanks. Alan CONFIDENTIALITY CAUTION: This message is intended only for the use of the individual or entity to whom it is addressed and is privileged and confidential. If you are not the intended recipient, please notify us immediately by return e-mail, delete this message and you should not disseminate, distribute or copy any information contained herein.
Tomcat 9 Encrpytion of JDBC
All, Interested to know your best practices on securing jdbc plain text passwords, in my last place they used a mechanism to encrypt all passwords. Is this the best method as I read some people don't recommend this. Any details or procs on best practice appreciated. Thanks Ken - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 9 Encrpytion of JDBC
OK thanks Bill! -Original Message- From: Bill Stewart Sent: 14 January 2022 19:02 To: Tomcat Users List Subject: Re: Tomcat 9 Encrpytion of JDBC On Fri, Jan 14, 2022 at 10:25 AM Alan F wrote: > Interested to know your best practices on securing jdbc plain text > passwords, in my last place they used a mechanism to encrypt all passwords. > Is this the best method as I read some people don't recommend this. > Any details or procs on best practice appreciated. > The "best practice," generally speaking, is that doing so is basically pointless from a security perspective. https://cwiki.apache.org/confluence/display/TOMCAT/Password Bill
Tomcat jdbc connections
I have an issue with connections on Tomcat9 Oracle showing connections made for about 2seconds then dropped again. Is this normal when the server is not being used? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat jdbc connections
Hi Christopher Thanks for your time here. You mean like, a connection is made, no queries are executed, and then the connection is terminated? - ANSWER - DBAs are saying connections last a minute or so and are replaced by a new set of connections 1 session each pool. Presumably, you have an application running on Tomcat with a JDBC connection configured. Are you using Tomcat's built-in pooling, or is your application managing its own pooling/connections? - ANSWER we are using dbcp2 Do you have any background tasks (in the JVM) that will run even when there is no user activity? Cache-management? Lazy-writes? - ANSWER I don't think so. Are you using Tomcat's clustering? Are you using a database-backed session management or any kind? - - ANSWER YES clustered B node down, A node up this Tomcat node is not live or receiving any traffic currently in test. Are the connections definitely being made from the application itself and/or Tomcat? Or do you just see those connections coming from the IP where the application is running? - ANSWER im assuming according to server.xml they are utlising these declared connections via Tomcat. Do you have any background tasks (outside the JVM) that will run even when there are no user actions? For example, some monitoring system that pings the server to say "can you reach the database?" - ANSWER NO O -Original Message- From: Christopher Schultz Sent: 20 January 2022 17:34 To: users@tomcat.apache.org Subject: Re: Tomcat jdbc connections Alan, On 1/20/22 09:33, Alan F wrote: > I have an issue with connections on Tomcat9 Oracle showing connections > made for about 2seconds then dropped again. Is this normal when the > server is not being used? You mean like, a connection is made, no queries are executed, and then the connection is terminated? Presumably, you have an application running on Tomcat with a JDBC connection configured. Are you using Tomcat's built-in pooling, or is your application managing its own pooling/connections? Do you have any background tasks (in the JVM) that will run even when there is no user activity? Cache-management? Lazy-writes? Are you using Tomcat's clustering? Are you using a database-backed session management or any kind? Are the connections definitely being made from the application itself and/or Tomcat? Or do you just see those connections coming from the IP where the application is running? Do you have any background tasks (outside the JVM) that will run even when there are no user actions? For example, some monitoring system that pings the server to say "can you reach the database?" -chris - 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: Tomcat jdbc connections
Thanks John, Here is an example of a connection below I see timeBetweenEvictionRunsMillis but not maxConnLifetimeMillis if the server has no traffic does this mean So above does that mean every 60 secs Eviction runs, does this mean a server with no traffic evicts unused connections to DB? -Original Message- From: john.e.gr...@wellsfargo.com.INVALID Sent: 21 January 2022 14:50 To: users@tomcat.apache.org Subject: RE: Tomcat jdbc connections Alan, > -Original Message- > From: Alan F > Sent: Friday, January 21, 2022 6:53 AM > To: Tomcat Users List > Subject: RE: Tomcat jdbc connections > > Hi Christopher > > Thanks for your time here. > > You mean like, a connection is made, no queries are executed, and then > the connection is terminated? > - ANSWER - DBAs are saying connections last a minute or so and are > replaced by a new set of connections 1 session each pool. > > > Presumably, you have an application running on Tomcat with a JDBC > connection configured. Are you using Tomcat's built-in pooling, or is > your application managing its own pooling/connections? > - ANSWER we are using dbcp2 > > > Do you have any background tasks (in the JVM) that will run even when > there is no user activity? Cache-management? Lazy-writes? > - ANSWER I don't think so. > > > Are you using Tomcat's clustering? Are you using a database-backed > session management or any kind? - > - ANSWER YES clustered B node down, A node up this Tomcat node is not > live or receiving any traffic currently in test. > > > Are the connections definitely being made from the application itself > and/or Tomcat? Or do you just see those connections coming from the IP > where the application is running? - ANSWER im assuming according to > server.xml they are utlising these declared connections via Tomcat. > > > Do you have any background tasks (outside the JVM) that will run even > when there are no user actions? For example, some monitoring system > that pings the server to say "can you reach the database?" - ANSWER NO > > > O > Could your pool be closing the connections after a set time? Look at timeBetweenEvictionRunsMillis and maxConnLifetimeMillis here: https://commons.apache.org/proper/commons-dbcp/configuration.html B CB [ X ܚX KK[XZ[ \ \ ][ X ܚX P X ] \X K ܙ B ܈Y][ۘ[ [X[ K[XZ[ \ \ Z[ X ] \X K ܙ B - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat jdbc connections
Ok thanks Phil ok I checked other connections in the same host and see minIdle="2" and initialSize="7" Ive run a diff on this server.xml between our active prod hosts which shows connections on Toad up for at least a day as to this idle server reconnecting after minutes! And diff is identical apart from Cluster ips. -Original Message- From: Phil Steitz Sent: 21 January 2022 16:10 To: users@tomcat.apache.org Subject: Re: Tomcat jdbc connections On 1/21/22 8:19 AM, Alan F wrote: > Thanks John, > > Here is an example of a connection below I see > timeBetweenEvictionRunsMillis but not maxConnLifetimeMillis if the > server has no traffic does this mean > > timeBetweenEvictionRunsMillis="6" testWhileIdle="true" > testOnReturn="false" > testOnBorrow="true" removeAbandonedOnBorrow="true" maxWaitmillis="3" > defaultQueryTimeout="30" validationQuery="select * from dual" maxTotal="10" > maxIdle="5" > url="jdbc:oracle:thin:@XXX:X:" username="XXX" > password="" driverClassName="oracle.jdbc.OracleDriver" /> > > > So above does that mean every 60 secs Eviction runs, does this mean a server > with no traffic evicts unused connections to DB? One more note on this config. Since you have not specified minIIdle or initialSize, the pool will not create connections until they are requested by clients. Phil > > > -Original Message- > From: john.e.gr...@wellsfargo.com.INVALID > > Sent: 21 January 2022 14:50 > To: users@tomcat.apache.org > Subject: RE: Tomcat jdbc connections > > Alan, > > >> -Original Message- >> From: Alan F >> Sent: Friday, January 21, 2022 6:53 AM >> To: Tomcat Users List >> Subject: RE: Tomcat jdbc connections >> >> Hi Christopher >> >> Thanks for your time here. >> >> You mean like, a connection is made, no queries are executed, and >> then the connection is terminated? >> - ANSWER - DBAs are saying connections last a minute or so and are >> replaced by a new set of connections 1 session each pool. >> >> >> Presumably, you have an application running on Tomcat with a JDBC >> connection configured. Are you using Tomcat's built-in pooling, or is >> your application managing its own pooling/connections? >> - ANSWER we are using dbcp2 >> >> >> Do you have any background tasks (in the JVM) that will run even when >> there is no user activity? Cache-management? Lazy-writes? >> - ANSWER I don't think so. >> >> >> Are you using Tomcat's clustering? Are you using a database-backed >> session management or any kind? - >> - ANSWER YES clustered B node down, A node up this Tomcat node is not >> live or receiving any traffic currently in test. >> >> >> Are the connections definitely being made from the application itself >> and/or Tomcat? Or do you just see those connections coming from the >> IP where the application is running? - ANSWER im assuming according >> to server.xml they are utlising these declared connections via Tomcat. >> >> >> Do you have any background tasks (outside the JVM) that will run even >> when there are no user actions? For example, some monitoring system >> that pings the server to say "can you reach the database?" - ANSWER >> NO >> >> >> O >> > Could your pool be closing the connections after a set time? Look at > timeBetweenEvictionRunsMillis and maxConnLifetimeMillis here: > > https://commons.apache.org/proper/commons-dbcp/configuration.html > B CB > [ X ܚX KK[XZ[ > \ \ ][ X ܚX P X ] > \X K ܙ B ܈Y][ۘ[ [X[ K[XZ[ > \ \ Z[ X ] > \X K ܙ B > > - > 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: Tomcat jdbc connections
Thanks for your input Phil! Arghh will keep looking. -Original Message- From: Phil Steitz Sent: 21 January 2022 17:50 To: users@tomcat.apache.org Subject: Re: Tomcat jdbc connections On 1/21/22 9:28 AM, Alan F wrote: > Ok thanks Phil ok I checked other connections in the same host and see > minIdle="2" and initialSize="7" > > Ive run a diff on this server.xml between our active prod hosts which shows > connections on Toad up for at least a day as to this idle server reconnecting > after minutes! And diff is identical apart from Cluster ips. Most likely culprit is network or other issue causing validations to fail. With testWhileIdle on, idle connections in the pool will be tested when visited and closed if validation fails. Phil > > > > > -Original Message- > From: Phil Steitz > Sent: 21 January 2022 16:10 > To: users@tomcat.apache.org > Subject: Re: Tomcat jdbc connections > > > > On 1/21/22 8:19 AM, Alan F wrote: >> Thanks John, >> >> Here is an example of a connection below I see >> timeBetweenEvictionRunsMillis but not maxConnLifetimeMillis if the >> server has no traffic does this mean >> >> > timeBetweenEvictionRunsMillis="6" testWhileIdle="true" >> testOnReturn="false" >> testOnBorrow="true" removeAbandonedOnBorrow="true" maxWaitmillis="3" >> defaultQueryTimeout="30" validationQuery="select * from dual" maxTotal="10" >> maxIdle="5" >> url="jdbc:oracle:thin:@XXX:X:" username="XXX" >> password="" driverClassName="oracle.jdbc.OracleDriver" /> >> >> >> So above does that mean every 60 secs Eviction runs, does this mean a server >> with no traffic evicts unused connections to DB? > One more note on this config. Since you have not specified minIIdle or > initialSize, the pool will not create connections until they are requested by > clients. > > Phil >> >> -Original Message- >> From: john.e.gr...@wellsfargo.com.INVALID >> >> Sent: 21 January 2022 14:50 >> To: users@tomcat.apache.org >> Subject: RE: Tomcat jdbc connections >> >> Alan, >> >> >>> -Original Message- >>> From: Alan F >>> Sent: Friday, January 21, 2022 6:53 AM >>> To: Tomcat Users List >>> Subject: RE: Tomcat jdbc connections >>> >>> Hi Christopher >>> >>> Thanks for your time here. >>> >>> You mean like, a connection is made, no queries are executed, and >>> then the connection is terminated? >>> - ANSWER - DBAs are saying connections last a minute or so and are >>> replaced by a new set of connections 1 session each pool. >>> >>> >>> Presumably, you have an application running on Tomcat with a JDBC >>> connection configured. Are you using Tomcat's built-in pooling, or >>> is your application managing its own pooling/connections? >>> - ANSWER we are using dbcp2 >>> >>> >>> Do you have any background tasks (in the JVM) that will run even >>> when there is no user activity? Cache-management? Lazy-writes? >>> - ANSWER I don't think so. >>> >>> >>> Are you using Tomcat's clustering? Are you using a database-backed >>> session management or any kind? - >>> - ANSWER YES clustered B node down, A node up this Tomcat node is >>> not live or receiving any traffic currently in test. >>> >>> >>> Are the connections definitely being made from the application >>> itself and/or Tomcat? Or do you just see those connections coming >>> from the IP where the application is running? - ANSWER im assuming >>> according to server.xml they are utlising these declared connections via >>> Tomcat. >>> >>> >>> Do you have any background tasks (outside the JVM) that will run >>> even when there are no user actions? For example, some monitoring >>> system that pings the server to say "can you reach the database?" - >>> ANSWER NO >>> >>> >>> O >>> >> Could your pool be closing the connections after a set time? Look at >> timeBetweenEvictionRunsMillis and maxConnLifetimeMillis here: >> >> https://commons.apache.org/proper/commons-dbcp/configuration.html >> B CB >> [ X ܚX KK[XZ[ >>\ \ ][ X ܚX P X ] >>\X K ܙ B ܈Y][ۘ[ [X[ K[XZ[ >>\ \ Z[ X ] >>\X K ܙ B >> >> - >> 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 > > > - > 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: Tomcat jdbc connections
Can I just follow up here what would be the next steps how would I go about capturing the root cause of these very short connection times to Oracle from Tomcat. Would it be along the lines of Wireshark or TCP dump to see what's occurring as I gather this won't be captured in tomcat logging via Catalina.out? Or can it be. -Original Message- From: Phil Steitz Sent: 21 January 2022 17:50 To: users@tomcat.apache.org Subject: Re: Tomcat jdbc connections On 1/21/22 9:28 AM, Alan F wrote: > Ok thanks Phil ok I checked other connections in the same host and see > minIdle="2" and initialSize="7" > > Ive run a diff on this server.xml between our active prod hosts which shows > connections on Toad up for at least a day as to this idle server reconnecting > after minutes! And diff is identical apart from Cluster ips. Most likely culprit is network or other issue causing validations to fail. With testWhileIdle on, idle connections in the pool will be tested when visited and closed if validation fails. Phil > > > > > -Original Message- > From: Phil Steitz > Sent: 21 January 2022 16:10 > To: users@tomcat.apache.org > Subject: Re: Tomcat jdbc connections > > > > On 1/21/22 8:19 AM, Alan F wrote: >> Thanks John, >> >> Here is an example of a connection below I see >> timeBetweenEvictionRunsMillis but not maxConnLifetimeMillis if the >> server has no traffic does this mean >> >> > timeBetweenEvictionRunsMillis="6" testWhileIdle="true" >> testOnReturn="false" >> testOnBorrow="true" removeAbandonedOnBorrow="true" maxWaitmillis="3" >> defaultQueryTimeout="30" validationQuery="select * from dual" maxTotal="10" >> maxIdle="5" >> url="jdbc:oracle:thin:@XXX:X:" username="XXX" >> password="" driverClassName="oracle.jdbc.OracleDriver" /> >> >> >> So above does that mean every 60 secs Eviction runs, does this mean a server >> with no traffic evicts unused connections to DB? > One more note on this config. Since you have not specified minIIdle or > initialSize, the pool will not create connections until they are requested by > clients. > > Phil >> >> -Original Message- >> From: john.e.gr...@wellsfargo.com.INVALID >> >> Sent: 21 January 2022 14:50 >> To: users@tomcat.apache.org >> Subject: RE: Tomcat jdbc connections >> >> Alan, >> >> >>> -Original Message- >>> From: Alan F >>> Sent: Friday, January 21, 2022 6:53 AM >>> To: Tomcat Users List >>> Subject: RE: Tomcat jdbc connections >>> >>> Hi Christopher >>> >>> Thanks for your time here. >>> >>> You mean like, a connection is made, no queries are executed, and >>> then the connection is terminated? >>> - ANSWER - DBAs are saying connections last a minute or so and are >>> replaced by a new set of connections 1 session each pool. >>> >>> >>> Presumably, you have an application running on Tomcat with a JDBC >>> connection configured. Are you using Tomcat's built-in pooling, or >>> is your application managing its own pooling/connections? >>> - ANSWER we are using dbcp2 >>> >>> >>> Do you have any background tasks (in the JVM) that will run even >>> when there is no user activity? Cache-management? Lazy-writes? >>> - ANSWER I don't think so. >>> >>> >>> Are you using Tomcat's clustering? Are you using a database-backed >>> session management or any kind? - >>> - ANSWER YES clustered B node down, A node up this Tomcat node is >>> not live or receiving any traffic currently in test. >>> >>> >>> Are the connections definitely being made from the application >>> itself and/or Tomcat? Or do you just see those connections coming >>> from the IP where the application is running? - ANSWER im assuming >>> according to server.xml they are utlising these declared connections via >>> Tomcat. >>> >>> >>> Do you have any background tasks (outside the JVM) that will run >>> even when there are no user actions? For example, some monitoring >>> system that pings the server to say "can you reach the database?" - >>> ANSWER NO >>> >>> >>> O >>> >> Could your pool be closing the connections after a set time? Look at
RE: Tomcat jdbc connections
Hi Chris, Thankyou so much for your time and detail here. I had been working on this yesterday and posted my findings below. In the end It turned out to be my lack of understanding on Tomcat, but hey we are always learning! I would just like to update on my discovery of the issue I had with Tomcat resetting connections to DB. Main issue being lack of familiarity of parameters and how connection pooling worked. One thing I was unable to see without using a DBA admin was the connections resetting, no level of logging in Tomcat seemed to reveal this, and in the end I used a simple netstat query to check connections. watch -n1 "netstat -ant | grep ':1521.*ESTABLISHED' | nl | tail -n20 (last number depends on how many connections to monitor.) Obvs local ports will change outgoing therefore highlighting a new connection when these change. Once I had this I was able to tinker with current settings until I discovered the issue. Which in reality wasn't an issue per se its just that I discovered a non live Tomcat was behaving differently with pooled connections over a live host! Just to Recap Symptom: Tomcat closing DBCP pooled connections to Database every 60 seconds Cause: Tomcat was idle, therefore the configuration param was causing idle connections to be reset the period specified below (60 secs) timeBetweenEvictionRunsMillis=6 Resolution: The behaviour above is by design, a busy server will be less likely to trigger this due to connections being used! -Original Message- From: Christopher Schultz Sent: 24 January 2022 22:42 To: users@tomcat.apache.org Subject: Re: Tomcat jdbc connections Alan, On 1/23/22 09:17, Alan F wrote: > Can I just follow up here what would be the next steps how would I go > about capturing the root cause of these very short connection times to > Oracle from Tomcat. Honestly, I would want to know what query or queries are being run by these short-lived connections. Something tells me that if you are able to audit those queries, you'll immediately know what's going on. SELECT * FROM query_details WHERE connection_id='deadbeef' user | start_time | end_time | query zabbix | 12:00:00 | 12:00:00 | SELECT COUNT(*) FROM some_queue zabbix | 12:01:00 | 12:01:00 | SELECT COUNT(*) FROM some_queue zabbix | 12:02:00 | 12:02:00 | SELECT COUNT(*) FROM some_queue zabbix | 12:03:00 | 12:03:00 | SELECT COUNT(*) FROM some_queue zabbix | 12:04:00 | 12:04:00 | SELECT COUNT(*) FROM some_queue zabbix | 12:05:00 | 12:05:00 | SELECT COUNT(*) FROM some_queue /me says "Oh, right. We have monitoring." > Would it be along the lines of Wireshark or TCP dump to see what's > occurring as I gather this won't be captured in tomcat logging via > Catalina.out? Or can it be. I would only resort to reading TCP dumps if all else fails. Why? 1. TCP dumps are large and "expensive" 2. You are encrypting connections to your database... right?! Knowing the nature of the queries will help. If you see no queries being executed, then no TCP dump will help you because you won't be able to prove what component is making those connection anyway (unless dbcp2 pushes some environmental information over to Oracle whenever it makes a connection like "I'm connecting to Oracle on behalf of application X on Tomcat, but I'm not going to execute any queries mmm'kay"). I don't think dbcp does that kind of thing, so you'd have to crank-up the logging level on that application and/or Tomcat instance to see what's happening with the connection pool. Hope that helps, -chris > -Original Message- > From: Phil Steitz > Sent: 21 January 2022 17:50 > To: users@tomcat.apache.org > Subject: Re: Tomcat jdbc connections > > > > On 1/21/22 9:28 AM, Alan F wrote: >> Ok thanks Phil ok I checked other connections in the same host and see >> minIdle="2" and initialSize="7" >> >> Ive run a diff on this server.xml between our active prod hosts which shows >> connections on Toad up for at least a day as to this idle server >> reconnecting after minutes! And diff is identical apart from Cluster ips. > Most likely culprit is network or other issue causing validations to fail. > With testWhileIdle on, idle connections in the pool will be tested when > visited and closed if validation fails. > > Phil >> >> >> >> >> -Original Message- >> From: Phil Steitz >> Sent: 21 January 2022 16:10 >> To: users@tomcat.apache.org >> Subject: Re: Tomcat jdbc connections >> >> >> >> On 1/21/22 8:19 AM, Alan F wrote: >>> Thanks John, >>> >>> Here is an example of a connection below I see >>> timeBetweenEvictionRunsMillis but
Tomcat 9 Session replication
We are currently getting traffic from all cluster members in other environments using .staticmember opposed to multicast can I confirm why this is see below. What do we need to set here for a clustered pair to make them unique and talk to eachother only without seeing traffic from other members in Catalina.out This is how they are currently configured as you can see only difference between nodes is the receiver and member ips are reversed. Im concerned uniqueID is the same, do we also need to specify domain? WE have hostname A and B if you could check below: HOSTNAME A config
RE: Tomcat 9 Session replication
OK with your advice I tried what I thought would work from example and doesn't at all. The old example below works but this doesn’t even detect members. Below is example to which Im using on both nodes which are remote to eachother. -Original Message- From: Mark Thomas Sent: 28 January 2022 18:15 To: users@tomcat.apache.org Subject: Re: Tomcat 9 Session replication On 28/01/2022 17:05, Alan F wrote: > We are currently getting traffic from all cluster members in other > environments using .staticmember opposed to multicast can I confirm why this > is see below. > > What do we need to set here for a clustered pair to make them unique > and talk to eachother only without seeing traffic from other members > in Catalina.out > > This is how they are currently configured as you can see only difference > between nodes is the receiver and member ips are reversed. Im concerned > uniqueID is the same, do we also need to specify domain? uniqueID should be unique at least within the subnet, ideally globally. Yes, you should use a separate domain for each cluster. Looking at your config: You are missing the local member definition https://tomcat.apache.org/tomcat-10.0-doc/config/cluster-interceptor.html#Static_Membership The deployer should be defined under the cluster, not under an interceptor. Mark > > WE have hostname A and B if you could check below: > > HOSTNAME A config > > > > channelSendOptions="8"> > expireSessionsOnShutdown="false" > notifyListenersOnReplication="true"/> > > > > className="org.apache.catalina.tribes.transport.ReplicationTransmitter"> > className="org.apache.catalina.tribes.transport.nio.PooledParallelSender" /> > >address="hostnameA" > autoBind="0" > className="org.apache.catalina.tribes.transport.nio.NioReceiver" > maxThreads="6" > port="4100" > selectorTimeout="5000" > /> > > className="org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor" > staticOnly="true"/> > className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector" > /> > className="org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor"> > > className="org.apache.catalina.tribes.membership.StaticMember" > port="4100" > host="HostnameB" > uniqueId="{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}" > /> > tempDir="/opt/tomcat/war-temp/" > deployDir="/opt/tomcat/war-deploy/" > watchDir="/opt/tomcat/war-listen/" > watchEnabled="true"/> > > > className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor" > /> > > > - > 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: Tomcat 9 Session replication
Many thanks Chris, Don't laugh I was looking at those values after Keiichi kindly mentioned this too (thankyou!) and was thinking hmm where is 15 no mention! Ok makes sense now. Im trying to find out why we chose static, I think it was a guess at trying to stop the multicast interference from other hosts. I think we just had it all set wrong to start with. Looking at many online examples like here https://tomcat.apache.org/tomcat-9.0-doc/cluster-howto.html is what i looked would this suffice? If you could recommend the params I need just for two hosts to talk without interference ie specifying group or unique id etc. -Original Message- From: Christopher Schultz Sent: 31 January 2022 14:46 To: users@tomcat.apache.org Subject: Re: Tomcat 9 Session replication All, On 1/31/22 08:04, Keiichi Fujino wrote: > If you use StaticMembershipService, you must set > Cluster#channelStartOptions to 15 (default). To spell that out (since the docs aren't very explicit), the value of "15" is the combination of the following flags: SND_RX_SEQ (1) - Starts the data receiver. SND_TX_SEQ (2) - Starts the data transmitter ("sender"). MBR_RX_SEQ (4) - Starts the membership receiver ("listener"). MBR_TX_SEQ (8) - Starts the membership transmitter ("broadcaster"). |= 15 (0xf) I'm curious why, if one is using static membership, are the membership transmitter and receiver flags required? It seems to be that the membership should remain static and therefore no membership comms shuould be required. Are those important to ensure that the cluster members (through static) are actually present during operation? -chris > 2022年1月31日(月) 16:47 Alan F : > >> OK with your advice I tried what I thought would work from example >> and doesn't at all. The old example below works but this doesn’t even >> detect members. >> >> Below is example to which Im using on both nodes which are remote to >> eachother. >> >> >> > channelSendOptions="8" channelStartOptions = "3"> >>> expireSessionsOnShutdown="false" >> notifyListenersOnReplication="true"/> >> >>> className="org.apache.catalina.tribes.group.GroupChannel"> >> >> > className="org.apache.catalina.tribes.membership.StaticMembershipService"> >> > className="org.apache.catalina.tribes.membership.StaticMember" >>port="4110" >>host="local-tomcat" >>domain="tomcat-pc2" >> >> uniqueId="{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0}" /> >> > className="org.apache.catalina.tribes.membership.StaticMember" >>port="4110" >>host="remote-tomcat" >>domain="tomcat-pc2" >> >> uniqueId="{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}" /> >> >> >> > className="org.apache.catalina.tribes.transport.nio.NioReceiver" >> address="local-tomcat" >> port="4110" >> autoBind="9" >> selectorTimeout="2000" >> maxThreads="6"/> >> >> > className="org.apache.catalina.tribes.transport.ReplicationTransmitter"> >> > className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/> >> >> >> > className="org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor" >> staticOnly="true"/> >> > className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector" >> /> >> > className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor"/> >> > className="org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor"/> >> > className="org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor"> >> >> >> >> >>> filter=""/> >>> className="org.apache.catalina.ha.session.JvmRouteBinderValve"/> >> >>> className="org.apache.catalina.ha.deploy.FarmWarDeployer" >>
RE: Tomcat 9 Session replication
Many thanks Mark! -Original Message- From: Mark Thomas Sent: 01 February 2022 09:25 To: users@tomcat.apache.org Subject: Re: Tomcat 9 Session replication On 31/01/2022 14:54, Alan F wrote: > Many thanks Chris, > > Don't laugh I was looking at those values after Keiichi kindly mentioned this > too (thankyou!) and was thinking hmm where is 15 no mention! Ok makes sense > now. > > Im trying to find out why we chose static, I think it was a guess at trying > to stop the multicast interference from other hosts. I think we just had it > all set wrong to start with. > > Looking at many online examples like here > https://tomcat.apache.org/tomcat-9.0-doc/cluster-howto.html is what i looked > would this suffice? > > If you could recommend the params I need just for two hosts to talk without > interference ie specifying group or unique id etc. This is a working static cluster example from my 4-node test cluster. https://people.apache.org/~markt/dev/server-static-cluster-example.xml Things you'll need to change: - the jvmRoute on the Engine element - must be unique for each node - must match the reverse proxy config for sticky sessions to work - you'll only need two members - LocalMember needs to be correct on each node - The address attribute of the receiver needs to be correct on each node Mark > > -Original Message- > From: Christopher Schultz > Sent: 31 January 2022 14:46 > To: users@tomcat.apache.org > Subject: Re: Tomcat 9 Session replication > > All, > > On 1/31/22 08:04, Keiichi Fujino wrote: >> If you use StaticMembershipService, you must set >> Cluster#channelStartOptions to 15 (default). > > To spell that out (since the docs aren't very explicit), the value of "15" is > the combination of the following flags: > > SND_RX_SEQ (1) - Starts the data receiver. > SND_TX_SEQ (2) - Starts the data transmitter ("sender"). > MBR_RX_SEQ (4) - Starts the membership receiver ("listener"). > MBR_TX_SEQ (8) - Starts the membership transmitter ("broadcaster"). > |= 15 (0xf) > > I'm curious why, if one is using static membership, are the membership > transmitter and receiver flags required? It seems to be that the membership > should remain static and therefore no membership comms shuould be required. > Are those important to ensure that the cluster members (through static) are > actually present during operation? > > -chris > >> 2022年1月31日(月) 16:47 Alan F : >> >>> OK with your advice I tried what I thought would work from example >>> and doesn't at all. The old example below works but this doesn’t >>> even detect members. >>> >>> Below is example to which Im using on both nodes which are remote to >>> eachother. >>> >>> >>> >> channelSendOptions="8" channelStartOptions = "3"> >>> >> expireSessionsOnShutdown="false" >>> notifyListenersOnReplication="true"/> >>> >>> >> className="org.apache.catalina.tribes.group.GroupChannel"> >>> >>> >> className="org.apache.catalina.tribes.membership.StaticMembershipService"> >>> >> className="org.apache.catalina.tribes.membership.StaticMember" >>> port="4110" >>> host="local-tomcat" >>> domain="tomcat-pc2" >>> >>> uniqueId="{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0}" /> >>> >> className="org.apache.catalina.tribes.membership.StaticMember" >>> port="4110" >>> host="remote-tomcat" >>> domain="tomcat-pc2" >>> >>> uniqueId="{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}" /> >>> >>> >>> >> className="org.apache.catalina.tribes.transport.nio.NioReceiver" >>>address="local-tomcat" >>>port="4110" >>>autoBind="9" >>>selectorTimeout="2000" >>>maxThreads="6"/> >>> >>> >> className="org.apache.catalina.tribes.transport.ReplicationTransmitter
help with high cpu usage
Had some issues today with one prod host. One is fine the other has stuck around 80%Cpu. Ive taken a thread dump from both hosts and would appreciate someone give a once over what it may be before I kill and restart. They are clustered nodes so running identical apps and loadbalanced by a hardware balancer. Node1 is ok (relatively!) https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS1hODllYzBkZS01OGJjLTQ2ZDQtYWRhNS1kYjkxZjM2NjI1ZTAudHh0&; Node 2 still has high CPU usage https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS0yN2I0YWY4Mi05OWFhLTQ3YjYtOGQ2My0wMDMwZjlkNDQzNjMudHh0&;
RE: help with high cpu usage
HI John, Thankyou kindly for taking the time here. First of all looking back at the historical chart for the day I observed node 2 rise in cpu activity about 11am this morning and stayed high node1 has dropped back to idle. ##Do you know for sure that its the Tomcat process that is using the CPU?## A simple top -i showing the only process still running here at 189% is a java process under tomcat account. 24667 tomcat20 0 365.6g 17.2g 23080 S 189.7 54.9 2663:45 java I have taken 2 dumps here 10 secs apart if this helps at all? https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS0zNzY2ZmZmNy0wZDgyLTRhZTItYmE3Mi0zMWQyYTYwN2M1ZjgudHh0&; https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS0yMzFjOGYzZS01MjYzLTRiYWYtOTJjMS1jN2RiMWRlZmEwN2QudHh0&; We do have Prometheus hooked in via jmx with Grafana but im struggling to see anything glaring apart from GC I see old Gen taking about 5hrs before it drops back one node2 as opposed to 3 on node 1. -Original Message- From: john.e.gr...@wellsfargo.com.INVALID Sent: 03 February 2022 19:33 To: users@tomcat.apache.org Subject: RE: help with high cpu usage Alan, > -Original Message----- > From: Alan F > Sent: Thursday, February 03, 2022 12:19 PM > To: Tomcat Users List > Subject: help with high cpu usage > > Had some issues today with one prod host. One is fine the other has > stuck around 80%Cpu. > Ive taken a thread dump from both hosts and would appreciate someone > give a once over what it may be before I kill and restart. They are > clustered nodes so running identical apps and loadbalanced by a hardware > balancer. > > Node1 is ok (relatively!) > https://urldefense.com/v3/__https://fastthread.io/my-thread- > report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS1hODllYzBkZS01OGJjLTQ > 2ZDQtYWRhNS1kYjkxZjM2NjI1ZTAudHh0&__;!!F9svGWnIaVPGSwU!91fvMc > RzcMYr95RrClT-eCrcDNp3fKUDpupDSNtn-mDKbTl_dmUSa0LaAolXlhipl- > Fk2pQ$ > > > Node 2 still has high CPU usage > https://urldefense.com/v3/__https://fastthread.io/my-thread- > report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS0yN2I0YWY4Mi05OWFhL > TQ3YjYtOGQ2My0wMDMwZjlkNDQzNjMudHh0&__;!!F9svGWnIaVPGSwU!9 > 1fvMcRzcMYr95RrClT-eCrcDNp3fKUDpupDSNtn- > mDKbTl_dmUSa0LaAolXlhipkmLFr3E$ Taking thread dumps was a good idea but I see very little activity on node 2. It looks like two threads are in Hibernate's EntityEntryContext.downgradeLocks() method, one is taking the thread dump itself, and another is reading a request from a client, I think. I would not expect this to add up to 80% CPU usage unless one of those threads is stuck in a loop. Comparing multiple thread dumps taken 5-10 seconds apart would help answer this question. How much GC is there? Could these Hibernate queries be pulling a huge amount of data from the DB, thus causing a lot of GC activity? Node 1 looks idle except for the thread taking the thread dump. Do you know for sure that it's the Tomcat process that is using the CPU?
RE: help with high cpu usage
My bad here are the correct dumps 10 secs apart https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS0zNzY2ZmZmNy0wZDgyLTRhZTItYmE3Mi0zMWQyYTYwN2M1ZjgudHh0&; https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS00NTE3MWUxNy1jYWRiLTRkY2UtODBlNS1lMDk0YTJjNTg1OGEudHh0&; -Original Message- From: john.e.gr...@wellsfargo.com.INVALID Sent: 03 February 2022 19:33 To: users@tomcat.apache.org Subject: RE: help with high cpu usage Alan, > -Original Message----- > From: Alan F > Sent: Thursday, February 03, 2022 12:19 PM > To: Tomcat Users List > Subject: help with high cpu usage > > Had some issues today with one prod host. One is fine the other has > stuck around 80%Cpu. > Ive taken a thread dump from both hosts and would appreciate someone > give a once over what it may be before I kill and restart. They are > clustered nodes so running identical apps and loadbalanced by a hardware > balancer. > > Node1 is ok (relatively!) > https://urldefense.com/v3/__https://fastthread.io/my-thread- > report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS1hODllYzBkZS01OGJjLTQ > 2ZDQtYWRhNS1kYjkxZjM2NjI1ZTAudHh0&__;!!F9svGWnIaVPGSwU!91fvMc > RzcMYr95RrClT-eCrcDNp3fKUDpupDSNtn-mDKbTl_dmUSa0LaAolXlhipl- > Fk2pQ$ > > > Node 2 still has high CPU usage > https://urldefense.com/v3/__https://fastthread.io/my-thread- > report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS0yN2I0YWY4Mi05OWFhL > TQ3YjYtOGQ2My0wMDMwZjlkNDQzNjMudHh0&__;!!F9svGWnIaVPGSwU!9 > 1fvMcRzcMYr95RrClT-eCrcDNp3fKUDpupDSNtn- > mDKbTl_dmUSa0LaAolXlhipkmLFr3E$ Taking thread dumps was a good idea but I see very little activity on node 2. It looks like two threads are in Hibernate's EntityEntryContext.downgradeLocks() method, one is taking the thread dump itself, and another is reading a request from a client, I think. I would not expect this to add up to 80% CPU usage unless one of those threads is stuck in a loop. Comparing multiple thread dumps taken 5-10 seconds apart would help answer this question. How much GC is there? Could these Hibernate queries be pulling a huge amount of data from the DB, thus causing a lot of GC activity? Node 1 looks idle except for the thread taking the thread dump. Do you know for sure that it's the Tomcat process that is using the CPU?
Re: help with high cpu usage
John thanks so much !! Will pass this on tomorrow. Cheers. From: john.e.gr...@wellsfargo.com.INVALID Sent: 03 February 2022 22:45 To: users@tomcat.apache.org Subject: RE: help with high cpu usage Alan, > -Original Message- > From: Alan F > Sent: Thursday, February 03, 2022 2:51 PM > To: Tomcat Users List > Subject: RE: help with high cpu usage > > My bad here are the correct dumps 10 secs apart > > https://urldefense.com/v3/__https://fastthread.io/my-thread- > report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS0zNzY2ZmZmNy0wZDgyL > TRhZTItYmE3Mi0zMWQyYTYwN2M1ZjgudHh0&__;!!F9svGWnIaVPGSwU!- > fDbBdZmwXsUn9QT9ftL8f4PTLoASDZOXCeB4UEo7qKgcIHhANQVT6VMoGvG > st67ghaaLsg$ > > > https://urldefense.com/v3/__https://fastthread.io/my-thread- > report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS00NTE3MWUxNy1jYWRi > LTRkY2UtODBlNS1lMDk0YTJjNTg1OGEudHh0&__;!!F9svGWnIaVPGSwU!- > fDbBdZmwXsUn9QT9ftL8f4PTLoASDZOXCeB4UEo7qKgcIHhANQVT6VMoGvG > st67j-3O5xU$ > > > > > -Original Message- > From: john.e.gr...@wellsfargo.com.INVALID > > Sent: 03 February 2022 19:33 > To: users@tomcat.apache.org > Subject: RE: help with high cpu usage > > Alan, > > > > -Original Message- > > From: Alan F > > Sent: Thursday, February 03, 2022 12:19 PM > > To: Tomcat Users List > > Subject: help with high cpu usage > > > > Had some issues today with one prod host. One is fine the other has > > stuck around 80%Cpu. > > Ive taken a thread dump from both hosts and would appreciate someone > > give a once over what it may be before I kill and restart. They are > > clustered nodes so running identical apps and loadbalanced by a hardware > balancer. > > > > Node1 is ok (relatively!) > > https://urldefense.com/v3/__https://fastthread.io/my-thread- > > > report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS1hODllYzBkZS01OGJjLTQ > > > 2ZDQtYWRhNS1kYjkxZjM2NjI1ZTAudHh0&__;!!F9svGWnIaVPGSwU!91fvMc > > RzcMYr95RrClT-eCrcDNp3fKUDpupDSNtn-mDKbTl_dmUSa0LaAolXlhipl- > > Fk2pQ$ > > > > > > Node 2 still has high CPU usage > > https://urldefense.com/v3/__https://fastthread.io/my-thread- > > > report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS0yN2I0YWY4Mi05OWFhL > > > TQ3YjYtOGQ2My0wMDMwZjlkNDQzNjMudHh0&__;!!F9svGWnIaVPGSwU!9 > > 1fvMcRzcMYr95RrClT-eCrcDNp3fKUDpupDSNtn- > > mDKbTl_dmUSa0LaAolXlhipkmLFr3E$ > > Taking thread dumps was a good idea but I see very little activity on node 2. > It looks like two threads are in Hibernate's > EntityEntryContext.downgradeLocks() method, one is taking the thread > dump itself, and another is reading a request from a client, I think. I would > not expect this to add up to 80% CPU usage unless one of those threads is > stuck in a loop. Comparing multiple thread dumps taken 5-10 seconds apart > would help answer this question. How much GC is there? Could these > Hibernate queries be pulling a huge amount of data from the DB, thus > causing a lot of GC activity? > > Node 1 looks idle except for the thread taking the thread dump. > > Do you know for sure that it's the Tomcat process that is using the CPU? Of the 3 dumps from the same node, the first two are 3 hours apart, yet the two query threads seem to still be doing the same thing. (I verified that the timestamps in the dumps are different but maybe I made a mistake.) They are both making the Hibernate downgradeLocks call. This is occurring in the context of committing a transaction. That definitely makes it look like those threads are somehow either stuck or are looping. The 3rd dump has those same two threads actually making queries to Oracle. So within about 10 seconds, we have two threads committing transactions followed by making additional queries. Definitely show these to the developers if you haven't already. I didn't follow what you said about the GC. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: help with high cpu usage
Hello Thomas, Thanks for your input here, what's your weapon of choice to identify this thread bar thread dump? I just downloaded jvmtop from github but that didn't seem to give me any clue at all about independent threads. Cheers Alan -Original Message- From: Thomas Hoffmann (Speed4Trade GmbH) Sent: 04 February 2022 09:18 To: Tomcat Users List Subject: AW: help with high cpu usage Hello, when I encounter high CPU usage, it's best to identify the thread Id which is eating CPU. Making a thread dump, you can then search for the thread id within this dump. This works good for long lasting threads. If the CPU eating thread changes quickly, it's harder to figure out. Greetings, Thomas ____ Von: Alan F Gesendet: Freitag, 4. Februar 2022 00:02:49 An: Tomcat Users List Betreff: Re: help with high cpu usage John thanks so much !! Will pass this on tomorrow. Cheers. From: john.e.gr...@wellsfargo.com.INVALID Sent: 03 February 2022 22:45 To: users@tomcat.apache.org Subject: RE: help with high cpu usage Alan, > -Original Message- > From: Alan F > Sent: Thursday, February 03, 2022 2:51 PM > To: Tomcat Users List > Subject: RE: help with high cpu usage > > My bad here are the correct dumps 10 secs apart > > https://urldefense.com/v3/__https://fastthread.io/my-thread- > report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS0zNzY2ZmZmNy0wZDgyL > TRhZTItYmE3Mi0zMWQyYTYwN2M1ZjgudHh0&__;!!F9svGWnIaVPGSwU!- > fDbBdZmwXsUn9QT9ftL8f4PTLoASDZOXCeB4UEo7qKgcIHhANQVT6VMoGvG > st67ghaaLsg$ > > > https://urldefense.com/v3/__https://fastthread.io/my-thread- > report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS00NTE3MWUxNy1jYWRi > LTRkY2UtODBlNS1lMDk0YTJjNTg1OGEudHh0&__;!!F9svGWnIaVPGSwU!- > fDbBdZmwXsUn9QT9ftL8f4PTLoASDZOXCeB4UEo7qKgcIHhANQVT6VMoGvG > st67j-3O5xU$ > > > > > -Original Message- > From: john.e.gr...@wellsfargo.com.INVALID > > Sent: 03 February 2022 19:33 > To: users@tomcat.apache.org > Subject: RE: help with high cpu usage > > Alan, > > > > -Original Message- > > From: Alan F > > Sent: Thursday, February 03, 2022 12:19 PM > > To: Tomcat Users List > > Subject: help with high cpu usage > > > > Had some issues today with one prod host. One is fine the other has > > stuck around 80%Cpu. > > Ive taken a thread dump from both hosts and would appreciate someone > > give a once over what it may be before I kill and restart. They are > > clustered nodes so running identical apps and loadbalanced by a > > hardware > balancer. > > > > Node1 is ok (relatively!) > > https://urldefense.com/v3/__https://fastthread.io/my-thread- > > > report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS1hODllYzBkZS01OGJjLTQ > > > 2ZDQtYWRhNS1kYjkxZjM2NjI1ZTAudHh0&__;!!F9svGWnIaVPGSwU!91fvMc > > RzcMYr95RrClT-eCrcDNp3fKUDpupDSNtn-mDKbTl_dmUSa0LaAolXlhipl- > > Fk2pQ$ > > > > > > Node 2 still has high CPU usage > > https://urldefense.com/v3/__https://fastthread.io/my-thread- > > > report.jsp?p=c2hhcmVkLzIwMjIvMDIvMy8tLWFwaS0yN2I0YWY4Mi05OWFhL > > > TQ3YjYtOGQ2My0wMDMwZjlkNDQzNjMudHh0&__;!!F9svGWnIaVPGSwU!9 > > 1fvMcRzcMYr95RrClT-eCrcDNp3fKUDpupDSNtn- > > mDKbTl_dmUSa0LaAolXlhipkmLFr3E$ > > Taking thread dumps was a good idea but I see very little activity on node 2. > It looks like two threads are in Hibernate's > EntityEntryContext.downgradeLocks() method, one is taking the thread > dump itself, and another is reading a request from a client, I think. > I would not expect this to add up to 80% CPU usage unless one of those > threads is stuck in a loop. Comparing multiple thread dumps taken > 5-10 seconds apart would help answer this question. How much GC is > there? Could these Hibernate queries be pulling a huge amount of data > from the DB, thus causing a lot of GC activity? > > Node 1 looks idle except for the thread taking the thread dump. > > Do you know for sure that it's the Tomcat process that is using the CPU? Of the 3 dumps from the same node, the first two are 3 hours apart, yet the two query threads seem to still be doing the same thing. (I verified that the timestamps in the dumps are different but maybe I made a mistake.) They are both making the Hibernate downgradeLocks call. This is occurring in the context of committing a transaction. That definitely makes it look like those threads are somehow either stuck or are looping. The 3rd dump has those same two threads actually making queries to Oracle. So within about 10 seconds, we have two threads committing transactions followed by making additional queries. Definitely show these to the developers if you
403 whilst reading from ROOT
Im trying to read robots.txt from '/' on a few tomcat servers to block web search engines. Obviously placed the txt file in ./webapps/ROOT/ Works fine on a few tomcat hosts that have identical server.xml / web.xml so im puzzled as to why these two Tomcat servers are blocking requests, obviously something is different. Ive checked ./Catalina/localhost and see some restrictions here but only apply to /webapps/manager Im not sure where else to look? The error im seeing is: HTTP Status 403 - Forbidden Type Status Report Description The server understood the request but refuses to authorize it.
Constant errors in Tomcat logs
HI I have a Tomcat clustered pair running, I see this 3 times a minute in the logs. I don't see this IP in server.xml I do have a DEV Tomcat pair is this somehow interfering? 06-Jun-2022 11:15:18.836 WARNING [Catalina-utility-2] org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.performBasicCheck Member added, even though we weren't notified:[org.apache.catalina.tribes.membership.MemberImpl[tcp://{192, 168, 217, 57}:4102,{192, 168, 217, 57},4102, alive=3547745427, securePort=-1, UDP Port=-1, id={-119 -107 23 88 119 -39 74 -49 -118 57 -61 -49 -28 -91 11 43 }, payload={}, command={}, domain={}]]
tomcat logging
Tomcat logging I would like to add a delimiter or characters " " around {user-agent} for logging, I wanted it in double quotes for example "Mozilla 5.0.." but can't seem to make it work. Or even adding a # symbol before would help any ideas? Thanks - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat Deployment scripts
Anyone have an example deployment script or method used to deploy a simple war and context root, also with rollback preferably. Thanks
RE: Tomcat Deployment scripts
This is great thankyou Thomas. Just wondering how secure this is, prefer to be able to deploy with a non 'admin' account does this support a deploy only profile there? -Original Message- From: Thomas Hoffmann (Speed4Trade GmbH) Sent: 29 June 2023 09:08 To: Tomcat Users List Subject: AW: Tomcat Deployment scripts Hello Alan, > Von: Alan F > Gesendet: Mittwoch, 28. Juni 2023 18:24 > An: users@tomcat.apache.org > Betreff: Tomcat Deployment scripts > > Anyone have an example deployment script or method used to deploy a simple > war and context root, also with rollback preferably. > > Thanks you could use tomcat-manager. A war file can be deployed using curl for example: https://stackoverflow.com/questions/4432684/tomcat-manager-remote-deploy-script Greetings, Thomas - 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: Tomcat on a server
> is it possible to have one tomcat running on a server and allow > multiple clients to execute their programs on the tomcat > running on the server without affecting other clients > execution.How can we configure tomcat for this purpose? If I understand everything correctly, when Tomcat receives a request it creates a new thread and runs the servlet in that thread that matches the servlet or JSP requested. Multiple requests can be processed concurrently, whether they are requests for the same servlet or for different servlets. Each thread will normally get its own stack for automatically allocated variables and objects. Depending upon how your program is written however, it is possible for the threads to interfere with each other if they use any static variables - so you must use synchronization if it is required. Alan Alan Meyer [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple t hreads
> how to start multiple threads of a single instance of a tomcat > where each thread runs a different application.is it possible > with tomcat if so how This can be done in the normal way. Your servlet can start separate threads, each of which runs somewhat independently. However, there is a problem with this if you are intending to run a thread in the background while returning information to the client in the primary thread. When I tried to do that on older versions of Tomcat (4.x), all output to the user was suspended until _all_ of the threads completed. So you can't use this technique to run a batch job on behalf of the user. In fact, running a long batch job will time out the webserver and abort the job. What I did to overcome that was to spawn a new Java virtual machine that ran apart from Tomcat. To do this, I used an open source routine by Marty Hall. You can exec "java classname" or exec a shell script or batch file that starts the JVM. See: http://www.apl.jhu.edu/~hall/java/Exec.html Alan Alan Meyer [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple t hreads
Chris, Thank you for the excellent advice and suggestions. >> When I tried to [spawn a new thread on behalf of the remote >> user] on older versions of Tomcat (4.x), all output to the >> user was suspended until _all_ of the threads completed. > This was probably due to mismanagement of the thread; a new > thread will run independently of your request handler thread, > unless you call "join" on that thread, which will block the > current thread until the "joined" thread completes. I take it you've actually tried this and it worked for you. Which version of Tomcat were you using? I'm positive that I didn't call join to wait for completion of the threads that I started. Is it possible that earlier versions of Tomcat did that beneath the covers, or perhaps that this was configurable and our systems administrators (I wasn't administering Tomcat myself) forced this to happen? I agree that my technique was worse than spawning a thread. I didn't want the overhead of running two JVMs. But, try as I might (and I tried mightily hard), I wasn't able to make it work on the installation of Tomcat that I was using. I only allowed one batch job to run at a time, for just the reasons you mentioned. I wasn't worried about a malicious denial of service attack since our server was running on an intranet for vetted users, and I wasn't concerned about starting arbitrary jobs since the users could only pick from my menu of jobs to run. But I was worried about a user starting a long running job, not seeing results right away, and starting it again and again. > You are better off creating a thread pool and re-using threads > to complete long-running operations. Is this just to limit the number of threads that can run? I wouldn't be much worried about the overhead of starting a new thread since I already know I'm running a batch job which is going to take a long time. Starting a new thread is in the noise, performance wise. > You can have your long-running thread write some status to > somewhere convenient (such as the user's session) so that > subsequent requests can display some kind of status information > each time. There's no need to worry about request timeouts, > etc. That's a very neat idea! I never thought of anything like that. > If possible, a better solution would be to actually run the > batch job /as a batch job/ -- i.e. store the job in a > database/file/whatever, and have another process come along and > process that request as necessary. Another excellent idea. I thought of it and have used it on other projects but, alas, the sys admins hated the idea of running another daemon and I didn't want to fight with them. > This is all academic, since I think the original question was > something along the lines of "Does Tomcat actually work like an > app server should? with threads and everything? Does it?!". Well, the original poster may not have learned anything from this, but I certainly did. Thanks again. Alan Alan Meyer [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struggling with basic database connection
I am struggling to figure out why my Tomcat installation is failing to allow me to connect my java web application to a database. I am looking for ideas as to how to find out what is wrong. I have (what I think) is the same setup on another machine and it works fine. The only difference between these is that the working one in tomcat 5.0 and this machine is tomcat 5.5 (although I am just about and try with a 5.0 setup). I am trying with this simple piece of code - plucked from the tomcat docs. Context initCtx; try { initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup("java:comp/env"); DataSource ds = (DataSource) envCtx.lookup("jdbc/akcmoney"); Connection conn = ds.getConnection(); } catch (Exception e1) { e1.printStackTrace(); } and with debug, I can see that initCtX, envCtx and ds all are assigned non null values, but the ds.getConnection() results in the following. org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' I have the postgresql jdbc driver jar in $CATALINA.BASE/common/lib Server.xml contains factory org.apache.commons.dbcp.BasicDataSourceFactory driverClassName org.postgresql.Driver url jdbc:postgresql://127.0.0.1:5432/akcmoney username tomcat4 password xxx maxActive 20 maxIdle 10 maxWait -1 my WEB-INF/web.xml contains this reference. AKCMoney Database jdbc/akcmoney javax.sql.DataSource Container Shareable Anyone any ideas where I am going wrong, or how to look at the contents of the nitCtX, envCtx and ds variables in the above code snippet to understand how far I have got -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struggling with basic database connection
On Saturday 23 September 2006 09:57, Andrew Stepanenko wrote: > Hello, > > there is a difference between how resources are defined in 5.0 and > 5.5. In 5.0 you could provide your resource definitions right in the > server.xml, but in 5.5 you need to create a separate context.xml file > ($CATALINA_HOME/conf/Catalina//context.xml) and put resource > definitions there. > See this link: > http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html > > I also had this problem when migrating from 5.0 to 5.5. After I > defined a separate context.xml it started to work again. The docs seem very vague on this issue, but it does imply that I could still use $CATALINA_HOME/conf/server.xml One question that isn't answered in the docs is what the root element should be - the best seems to be the example for accessing a database, and even there it puts I tried with context.xml in the directory you mentioned and it said it couldn't find the webapp "context", so I renamed it to my application and tried again. But it didn't work. So still stumped -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struggling with basic database connection
On Saturday 23 September 2006 15:23, David Smith wrote: > Correction: context.xml belongs in META-INF of the war archive. OK, I am begining to comprehend - and knowledge about the context.xml in the META-INF file for a WAR archive is good. I was looking for a way to wrap all the info about the application in one directory structure - for my version control. Does this work with Tomcat 5.0 - thats my current production environment? HOWEVER, in the short term I am not working with WAR files - instead I am trying to deploy the application inside Eclipse. I tried creating a directory etc under eclipse's (probably WTP plugin's) server configuration, but it doesn't publish that to the conf directory inside it's CATALINA_HOME. So still not sure how to proceed. -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struggling with basic database connection
On Saturday 23 September 2006 15:23, David Smith wrote: > Correction: context.xml belongs in META-INF of the war archive. > I have just conducted experiments with Tomcat 5.0 putting a context.xml file in META-INF doesn't appear to work I have not been having success with putting in conf/server.xml - but I have had success with putting the context in conf/Catalina/localhost/akcmoney.xml -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struggling with basic database connection
On Sunday 01 October 2006 17:27, John Najarian wrote: > Alan, > > Did you ever resolve this? I don't have enough > information here to help you. ... Sort of ... The WTP plugin for eclipse copies what is in META-INF/context.xml and writes it into CATALINA_BASE/conf/server.xml. So for tomcat5.0, I have relied on testing/debuging like that so far, and achieving the same manually when I come to deploy on the production server. At some stage soon, I will be changing to tomcat 5.5 but I am not sure where to go to make things work then, as I am still not sure there is any definitive guide to where these things go and how tomcat deals with a META-INF/context.xml > > --- Alan Chandler <[EMAIL PROTECTED]> wrote: > > On Saturday 23 September 2006 15:23, David Smith > > > > wrote: > > > Correction: context.xml belongs in META-INF of the > > > > war archive. > > > > > > I have just conducted experiments with Tomcat 5.0 > > > > putting a context.xml file in META-INF doesn't > > appear to work > > > > I have not been having success with putting in > > conf/server.xml - but I have > > had success with putting the context in > > conf/Catalina/localhost/akcmoney.xml > > > > > > -- > > Alan Chandler > > http://www.chandlerfamily.org.uk > > - > > > To start a new topic, e-mail: > > users@tomcat.apache.org > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Max Memory Reading
Hi, I was having some problems with perm gen space on one of our tomcat instances and decided to increase the perm gen size and review the JAVA_OPTS settings in general when I noticed something curious. No settings are currently made so its just running with default values, but the manager status page shows the following... >Free memory: 158.53 MB Total memory: 373.75 MB Max memory: 913.37 MB That max memory figure in particular looks like a pretty strange default! I thought the default was 64m. The installation details are as follows... Apache Tomcat/5.5.16 1.5.0_06-b05 Sun Microsystems Inc. SunOS 5.9 sparc The system has 16G of RAM. Has anybody any thoughts? Regards, Alan This e-mail and any accompanying documents contain confidential information intended for a specific individual which is private and protected by law. If you are not the intended recipient, any disclosure, copying, distribution or other use of this information is strictly prohibited. You are also requested to advise us immediately if you receive information which is not addressed to you. beCogent is Authorised and Regulated by the Financial Services Authority. *
Re: Max Memory Reading
Already checked that, it's not in the environment and not set in either startup.sh or catalina.sh. On Fri, 2006-10-13 at 14:17 +0700, Lintang JP wrote: > maybe the value for environment variables called JAVA_OPTS equals those > values ? > try to echo $JAVA_OPTS and see if theres any value. > > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > > > Hi, > > > > I was having some problems with perm gen space on one of our tomcat > > instances and decided to increase the perm gen size and review the > > JAVA_OPTS settings in general when I noticed something curious. No > > settings are currently made so its just running with default values, but > > the manager status page shows the following... > > > > >Free memory: 158.53 MB Total memory: 373.75 MB Max memory: 913.37 MB > > > > That max memory figure in particular looks like a pretty strange > > default! I thought the default was 64m. > > > > The installation details are as follows... > > Apache Tomcat/5.5.16 1.5.0_06-b05 Sun Microsystems Inc. SunOS 5.9 sparc > > The system has 16G of RAM. > > > > Has anybody any thoughts? > > > > Regards, > > Alan > > > > > > > > > > This e-mail and any accompanying documents contain confidential > > information intended for a specific individual which is private and > > protected by law. > > If you are not the intended recipient, any disclosure, copying, > > distribution or other use of this information is strictly prohibited. > > You are also requested to advise us immediately if you receive information > > which is not addressed to you. > > beCogent is Authorised and Regulated by the Financial Services Authority. > > > > * > > > > > Alan Flisch Senior Developer beCogent Ltd. www.beCogent.com T: +44 (0)1236 628 113 F: +44 (0)1236 628 101 E: [EMAIL PROTECTED] This e-mail and any accompanying documents contain confidential information intended for a specific individual which is private and protected by law. If you are not the intended recipient, any disclosure, copying, distribution or other use of this information is strictly prohibited. You are also requested to advise us immediately if you receive information which is not addressed to you. beCogent is Authorised and Regulated by the Financial Services Authority. *
Re: Max Memory Reading
Good idea, but nothing set there either. The fact it's such an odd number is another perplexing issue. On Fri, 2006-10-13 at 09:36 +0200, Pascal Alberty wrote: > /etc/init.d/tomcat5 ? > Check for -Xms and -Xmm options > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > Already checked that, it's not in the environment and not set in either > > startup.sh or catalina.sh. > > > > On Fri, 2006-10-13 at 14:17 +0700, Lintang JP wrote: > > > > > maybe the value for environment variables called JAVA_OPTS equals those > > > values ? > > > try to echo $JAVA_OPTS and see if theres any value. > > > > > > > > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > Hi, > > > > > > > > I was having some problems with perm gen space on one of our tomcat > > > > instances and decided to increase the perm gen size and review the > > > > JAVA_OPTS settings in general when I noticed something curious. No > > > > settings are currently made so its just running with default values, but > > > > the manager status page shows the following... > > > > > > > > >Free memory: 158.53 MB Total memory: 373.75 MB Max memory: 913.37 MB > > > > > > > > That max memory figure in particular looks like a pretty strange > > > > default! I thought the default was 64m. > > > > > > > > The installation details are as follows... > > > > Apache Tomcat/5.5.16 1.5.0_06-b05 Sun Microsystems Inc. SunOS 5.9 sparc > > > > The system has 16G of RAM. > > > > > > > > Has anybody any thoughts? > > > > > > > > Regards, > > > > Alan > > > > > > > > > > > > > > > > > > > > This e-mail and any accompanying documents contain confidential > > > > information intended for a specific individual which is private and > > > > protected by law. > > > > If you are not the intended recipient, any disclosure, copying, > > > > distribution or other use of this information is strictly prohibited. > > > > You are also requested to advise us immediately if you receive > > > > information > > > > which is not addressed to you. > > > > beCogent is Authorised and Regulated by the Financial Services > > > > Authority. > > > > > > > > * > > > > > > > > > > > > > This e-mail and any accompanying documents contain confidential information intended for a specific individual which is private and protected by law. If you are not the intended recipient, any disclosure, copying, distribution or other use of this information is strictly prohibited. You are also requested to advise us immediately if you receive information which is not addressed to you. beCogent is Authorised and Regulated by the Financial Services Authority. *
Re: Max Memory Reading
Thanks, I suspected that, but couldn't find a reference in any JVM docs. Do you have a reference I could look at so I could better understand what is going on? In order for me to set an appropriate larger perm gen size, I suppose I'd need to know what it currently is. I seem to remember it is independent of the max heap size. Any thoughts on this? Regards, Alan On Fri, 2006-10-13 at 12:28 +0200, Leon Rosenberg wrote: > The default memory values depends on your machine (processor speed and > count, total amount of memory) and are guessed by the vm (if not > explicitely specified) upon application start. > Times of 64Mb max memory are long over now. > > regards > Leon > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I was having some problems with perm gen space on one of our tomcat > > instances and decided to increase the perm gen size and review the > > JAVA_OPTS settings in general when I noticed something curious. No > > settings are currently made so its just running with default values, but > > the manager status page shows the following... > > > > >Free memory: 158.53 MB Total memory: 373.75 MB Max memory: 913.37 MB > > > > That max memory figure in particular looks like a pretty strange > > default! I thought the default was 64m. > > > > The installation details are as follows... > > Apache Tomcat/5.5.16 1.5.0_06-b05 Sun Microsystems Inc. SunOS 5.9 sparc > > The system has 16G of RAM. > > > > Has anybody any thoughts? > > > > Regards, > > Alan > > > > > > > > This e-mail and any accompanying documents contain confidential information > > intended for a specific individual which is private and protected by law. > > If you are not the intended recipient, any disclosure, copying, > > distribution or other use of this information is strictly prohibited. > > You are also requested to advise us immediately if you receive information > > which is not addressed to you. > > beCogent is Authorised and Regulated by the Financial Services Authority. > > * > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any accompanying documents contain confidential information intended for a specific individual which is private and protected by law. If you are not the intended recipient, any disclosure, copying, distribution or other use of this information is strictly prohibited. You are also requested to advise us immediately if you receive information which is not addressed to you. beCogent is Authorised and Regulated by the Financial Services Authority. *
Re: Max Memory Reading
Thanks. Found a reference too: http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html Going to set the following... -server -Xmx2000m -XX:MaxPermSize=256m On Fri, 2006-10-13 at 12:38 +0200, Leon Rosenberg wrote: > def perm size is 64Mb > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > Thanks, I suspected that, but couldn't find a reference in any JVM docs. > > Do you have a reference I could look at so I could better understand > > what is going on? > > > > In order for me to set an appropriate larger perm gen size, I suppose > > I'd need to know what it currently is. I seem to remember it is > > independent of the max heap size. Any thoughts on this? > > > > Regards, > > Alan > > > > > > On Fri, 2006-10-13 at 12:28 +0200, Leon Rosenberg wrote: > > > > > The default memory values depends on your machine (processor speed and > > > count, total amount of memory) and are guessed by the vm (if not > > > explicitely specified) upon application start. > > > Times of 64Mb max memory are long over now. > > > > > > regards > > > Leon > > > > > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > > > > > Hi, > > > > > > > > I was having some problems with perm gen space on one of our tomcat > > > > instances and decided to increase the perm gen size and review the > > > > JAVA_OPTS settings in general when I noticed something curious. No > > > > settings are currently made so its just running with default values, but > > > > the manager status page shows the following... > > > > > > > > >Free memory: 158.53 MB Total memory: 373.75 MB Max memory: 913.37 MB > > > > > > > > That max memory figure in particular looks like a pretty strange > > > > default! I thought the default was 64m. > > > > > > > > The installation details are as follows... > > > > Apache Tomcat/5.5.16 1.5.0_06-b05 Sun Microsystems Inc. SunOS 5.9 sparc > > > > The system has 16G of RAM. > > > > > > > > Has anybody any thoughts? > > > > > > > > Regards, > > > > Alan > > > > > > > > > > > > > > > > This e-mail and any accompanying documents contain confidential > > > > information intended for a specific individual which is private and > > > > protected by law. > > > > If you are not the intended recipient, any disclosure, copying, > > > > distribution or other use of this information is strictly prohibited. > > > > You are also requested to advise us immediately if you receive > > > > information which is not addressed to you. > > > > beCogent is Authorised and Regulated by the Financial Services > > > > Authority. > > > > * > > > > > > > > > > - > > > To start a new topic, e-mail: users@tomcat.apache.org > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > This e-mail and any accompanying documents contain confidential information > > intended for a specific individual which is private and protected by law. > > If you are not the intended recipient, any disclosure, copying, > > distribution or other use of this information is strictly prohibited. > > You are also requested to advise us immediately if you receive information > > which is not addressed to you. > > beCogent is Authorised and Regulated by the Financial Services Authority. > > * > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > Alan Flisch Senior Developer beCogent Ltd. www.beCogent.com T: +44 (0)1236 628 113 F: +44 (0)1236 628 101 E: [EMAIL PROTECTED] This e-mail and any accompanying documents contain confidential information intended for a specific individual which is private and protected by law. If you are not the intended recipient, any disclosure, copying, distribution or other use of this information is strictly prohibited. You are also requested to advise us immediately if you receive information which is not addressed to you. beCogent is Authorised and Regulated by the Financial Services Authority. *
Re: Max Memory Reading
I thought you were safe up to 4000m (in practice a little lower) for the 32 bit VM. Regards, Alan On Fri, 2006-10-13 at 13:04 +0200, Leon Rosenberg wrote: > just as note Xmx2000m works on 64bit vm only > and you can use g instead of 1000m -> -Xmx2g > > regards > Leon > > P.S. You should set your ms=mx, saves time :-) > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > Thanks. Found a reference too: > > http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html > > > > Going to set the following... > > > > -server > > -Xmx2000m > > -XX:MaxPermSize=256m > > > > > > > > On Fri, 2006-10-13 at 12:38 +0200, Leon Rosenberg wrote: > > > > > def perm size is 64Mb > > > > > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > > > > > Thanks, I suspected that, but couldn't find a reference in any JVM docs. > > > > Do you have a reference I could look at so I could better understand > > > > what is going on? > > > > > > > > In order for me to set an appropriate larger perm gen size, I suppose > > > > I'd need to know what it currently is. I seem to remember it is > > > > independent of the max heap size. Any thoughts on this? > > > > > > > > Regards, > > > > Alan > > > > > > > > > > > > On Fri, 2006-10-13 at 12:28 +0200, Leon Rosenberg wrote: > > > > > > > > > The default memory values depends on your machine (processor speed and > > > > > count, total amount of memory) and are guessed by the vm (if not > > > > > explicitely specified) upon application start. > > > > > Times of 64Mb max memory are long over now. > > > > > > > > > > regards > > > > > Leon > > > > > > > > > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > Hi, > > > > > > > > > > > > I was having some problems with perm gen space on one of our tomcat > > > > > > instances and decided to increase the perm gen size and review the > > > > > > JAVA_OPTS settings in general when I noticed something curious. No > > > > > > settings are currently made so its just running with default > > > > > > values, but > > > > > > the manager status page shows the following... > > > > > > > > > > > > >Free memory: 158.53 MB Total memory: 373.75 MB Max memory: 913.37 > > > > > > >MB > > > > > > > > > > > > That max memory figure in particular looks like a pretty strange > > > > > > default! I thought the default was 64m. > > > > > > > > > > > > The installation details are as follows... > > > > > > Apache Tomcat/5.5.16 1.5.0_06-b05 Sun Microsystems Inc. SunOS 5.9 > > > > > > sparc > > > > > > The system has 16G of RAM. > > > > > > > > > > > > Has anybody any thoughts? > > > > > > > > > > > > Regards, > > > > > > Alan > > > > > > > > > > > > > > > > > > > > > > > > This e-mail and any accompanying documents contain confidential > > > > > > information intended for a specific individual which is private and > > > > > > protected by law. > > > > > > If you are not the intended recipient, any disclosure, copying, > > > > > > distribution or other use of this information is strictly > > > > > > prohibited. > > > > > > You are also requested to advise us immediately if you receive > > > > > > information which is not addressed to you. > > > > > > beCogent is Authorised and Regulated by the Financial Services > > > > > > Authority. > > > > > > * > > > > > > > > > > > > > > > > - > > > > > To start a new topic, e-mai
Re: Max Memory Reading
It could actually be a 64 bit JVM (I didn't install it) although I suspect not, but as I have no need to push the memory up any further just now, I'll leave addressing that till later. I'll maybe just make it 1600m or something for now as that should be more than adequate. The server isn't hammered but hosts quite a few apps and that is why the demands on the perm gen space are higher than is typical. Regards, Alan On Fri, 2006-10-13 at 15:03 +0200, Leon Rosenberg wrote: > Hmm, > I'm not familiar with limitations on solaris. On linux 32bit VM can > allocate 1.6-1.8 GB depending on vendor (1.6 for sun-jdk). > > On the other side, if you are on 64bit OS (and you probably are, or > how could you adress 16GB otherwise), why not using 64bit jdk? > > regards > Leon > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > I thought you were safe up to 4000m (in practice a little lower) for the > > 32 bit VM. > > > > Regards, > > Alan > > > > On Fri, 2006-10-13 at 13:04 +0200, Leon Rosenberg wrote: > > > > > just as note Xmx2000m works on 64bit vm only > > > and you can use g instead of 1000m -> -Xmx2g > > > > > > regards > > > Leon > > > > > > P.S. You should set your ms=mx, saves time :-) > > > > > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > > > > > Thanks. Found a reference too: > > > > http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html > > > > > > > > Going to set the following... > > > > > > > > -server > > > > -Xmx2000m > > > > -XX:MaxPermSize=256m > > > > > > > > > > > > > > > > On Fri, 2006-10-13 at 12:38 +0200, Leon Rosenberg wrote: > > > > > > > > > def perm size is 64Mb > > > > > > > > > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > Thanks, I suspected that, but couldn't find a reference in any JVM > > > > > > docs. > > > > > > Do you have a reference I could look at so I could better understand > > > > > > what is going on? > > > > > > > > > > > > In order for me to set an appropriate larger perm gen size, I > > > > > > suppose > > > > > > I'd need to know what it currently is. I seem to remember it is > > > > > > independent of the max heap size. Any thoughts on this? > > > > > > > > > > > > Regards, > > > > > > Alan > > > > > > > > > > > > > > > > > > On Fri, 2006-10-13 at 12:28 +0200, Leon Rosenberg wrote: > > > > > > > > > > > > > The default memory values depends on your machine (processor > > > > > > > speed and > > > > > > > count, total amount of memory) and are guessed by the vm (if not > > > > > > > explicitely specified) upon application start. > > > > > > > Times of 64Mb max memory are long over now. > > > > > > > > > > > > > > regards > > > > > > > Leon > > > > > > > > > > > > > > On 10/13/06, Alan Flisch <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > I was having some problems with perm gen space on one of our > > > > > > > > tomcat > > > > > > > > instances and decided to increase the perm gen size and review > > > > > > > > the > > > > > > > > JAVA_OPTS settings in general when I noticed something curious. > > > > > > > > No > > > > > > > > settings are currently made so its just running with default > > > > > > > > values, but > > > > > > > > the manager status page shows the following... > > > > > > > > > > > > > > > > >Free memory: 158.53 MB Total memory: 373.75 MB Max memory: > > > > > > > > >913.37 M
RE: Max Memory Reading
It seems to be contradicted by this document http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html and by my experience of seeing a near 1GB heap with no -Xmx option set anywhere. It's a little on the confusing side! On Fri, 2006-10-13 at 09:31 -0500, Caldarale, Charles R wrote: > > From: Leon Rosenberg [mailto:[EMAIL PROTECTED] > > Subject: Re: Max Memory Reading > > > > unfortunately google is not your friend in this case and the document > > seems outdated :-) > > > > http://java.sun.com/docs/hotspot/gc5.0/ergo5.html > > Why do you think it's outdated? What's described is what the current > 5.0 code does. > > - 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 start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > Alan Flisch Senior Developer beCogent Ltd. www.beCogent.com T: +44 (0)1236 628 113 F: +44 (0)1236 628 101 E: [EMAIL PROTECTED] This e-mail and any accompanying documents contain confidential information intended for a specific individual which is private and protected by law. If you are not the intended recipient, any disclosure, copying, distribution or other use of this information is strictly prohibited. You are also requested to advise us immediately if you receive information which is not addressed to you. beCogent is Authorised and Regulated by the Financial Services Authority. *
RE: Max Memory Reading
The document Leon thought was outdated was this one - http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html#0.0.0.%20Total% 20Heap%7Coutline - which also relates to 5.0! I'm guessing from the evidence that this doc is simply wrong. Regards, Alan On Fri, 2006-10-13 at 09:41 -0500, Caldarale, Charles R wrote: > > From: Alan Flisch [mailto:[EMAIL PROTECTED] > > Subject: RE: Max Memory Reading > > > > It seems to be contradicted by this document > > http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html and by > > my experience of seeing a near 1GB heap with no -Xmx option set > > anywhere. > > Maybe I'm confused by which doc Leon thought was outdated (the perils of > doing top-posting). The doc referenced above matches the 5.0 code. > > - 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 start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any accompanying documents contain confidential information intended for a specific individual which is private and protected by law. If you are not the intended recipient, any disclosure, copying, distribution or other use of this information is strictly prohibited. You are also requested to advise us immediately if you receive information which is not addressed to you. beCogent is Authorised and Regulated by the Financial Services Authority. *
Authentication when Tomcat is fronted by Apache
I have apache2 as my main web server. I have configured it to pass all paths that begin with /famtree to them through to tomcat via the ajp connector (using jk_mod). I am trying to get basic authentication working using the UserDatabase Realm. I get the basic dialog box to appear so I can enter my username and password, but what ever I type it fails to authenticate when I hit theOK button.. Thinking about it, I have probably not configured jk_mod in my apache2 configuration file to pass the authentication dialog data back to tomcat. This is not mentioned in any documentation I have seen. How do I do this? [PS if I could use apache to authenticate before even getting as far as tomcat that would be better, but as far as I can see it only works if the url is translated into a an actual location and not passed on] -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Still failing authentication - need help on how to Debug
I am still struggling to get tomcat to authenticate access to my application. As a starting point I am trying to use BASIC authentication with the DataSource Realm (basically because I can check the query SQL) Whatever I do the user is presented with the authentication dialog box, but this authentication ALWAYS fails. Any way, as can be seen from the logs I am doing an authenticate test and failing. But thats not suprising when you look at the SQL that is being requested. The username is null Why? I can't see how I have anything wrong in server.xml - otherwise the postgres query would not have happened. I can't see what I could possibly have wrong in my web.xml as this does not even mention username!. Nevertheless - here is my web.xml is below How can I get further info that would be helpful in debugging this? ===famtree log (from tomcat4) 2005-11-01 19:53:00 famtree: init 2005-11-01 19:54:29 Authenticator[/famtree]: Security checking request GET /famtree/app 2005-11-01 19:54:29 Authenticator[/famtree]: Checking constraint 'SecurityConstraint[Famtree Application]' against GET /app --> true 2005-11-01 19:54:29 Authenticator[/famtree]: Subject to constraint SecurityConstraint[Famtree Application] 2005-11-01 19:54:29 Authenticator[/famtree]: Calling checkUserData() 2005-11-01 19:54:29 Authenticator[/famtree]: User data constraint has no restrictions 2005-11-01 19:54:29 Authenticator[/famtree]: Calling authenticate() 2005-11-01 19:54:30 Authenticator[/famtree]: Failed authenticate() test roo:/var/log/tomcat4# =postgres.log 2005-11-01 19:54:30 [3756] LOG: duration: 0.283 ms statement: set client_encoding = 'UNICODE' 2005-11-01 19:54:30 [3756] LOG: duration: 5.291 ms statement: SELECT password FROM users WHERE name = null ===web.xml http://java.sun.com/dtd/web-app_2_3.dtd";> Family Tree Manager redirect org.apache.tapestry.RedirectFilter redirect / famtree org.apache.tapestry.ApplicationServlet 0 famtree /app famtree *.page famtree *.do famtree *.sdo famtree *.svc famtree /assets/* 15 index.html index.htm index.jsp default.html default.htm default.jsp Family Tree Database jdbc/family_tree javax.sql.DataSource Container Shareable Famtree Application /* family BASIC Family Member family -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Still failing authentication - need help on how to Debug
On Tuesday 01 Nov 2005 20:26, Andoni wrote: > Hi Alan, > > Show us the relevant section of your server.xml. > > Are you using a view in your database? > > What the authenticator is doing is basically two select statements on your > database to find the usernames and passwords. If the name of the username > column is not correctly corresponding to the username column in the > database then you may be in trouble! > You are not going to believe this, but I was fiddling about putting ethereal up to try and check what username was going between the machines and it suddenly just started working. I have no idea what I have done that makes it work, or why it wasn't working before. (I have only just switched over the Datasource Realm because I couldn't get the UserDatabase Realm to work either.). -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do you debug Authentication Problems
I have tomcat4 fronted by apache2 and linked via mod_jk. I am running well with basic applications, but up until now I have been manually loading applications. I tried to use the manager application, and it is asking me to authenticate myself. I have added myself into the manager role in the tomcat-users, but I get into a loop of authentication failures. As a TEMPORARY measure, I have added the authentication into the Apache configuration (inside a directive and removed it from the web.xml of the manager application. And that works. There is nothing in any of my standardly configured logs to indicate what is happening. But, given this effect of getting it to work when I delegate security control to Apache, I suspect that the front ending of tomcat with apache is playing some effect on the failures. It also explains why I could never get my application with user login to work and had to give up trying to build authentication into a web app. But what is the problem? and how do I debug this to get a clear picture of what is happening? Surely others have had the same issues - front ending Tomcat with apache must be a relatively frequent configuration - and have overcome them. -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What is the correct way to install a new version of a war
I am trying to install a new version of my application war I tried various ways, using the HTML manager, including removing the application and then installing by uploading a new war file, but all of them seemed to screw up one way or the other. The option I mention above (complete re-install) seemed to have a problem with re-initiallising my connection to the database (which is using the built in Tomcat pooling). In the end I had to shutdown and restart the server. Is there a recommended step by step approach to doing this safely? -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
question regarding jdk log in Tomcat
Hi, I have a question about java logging within a context. I´d like to have a way to isolate the jdk1.4 log between Tomcat contexts. In my own lines of code, I create a JDK1.4 logger with an associated name, Handler and Formatter. This way, I have one log file per context. My problem is when I add Frameworks like Struts and Hibernate to my context. I would like them logging into my current context log file. Since they use commons logging, I´ve had to call LogManager.getLogManager().readConfiguration(InputStream is); in order to make the logging engine load my configurations and let me log where I wish. But that affects in a global way. If I have only one context running, everything is fine, but with many, the last context that called readConfiguration redefines all the precedents. I looked to the sources of the jdk and found it relies on the System Classloader... I am a little bit trapped here, as I do not know how to redirect the log of the instances of hibernate and struts to the log of my context of tomcat. I appreciate very much any suggestions. TIA, Alan Honczar AVISO LEGAL - Esta mensagem e seu conteúdo - inclusive anexos - são para uso exclusivo de seu(s) destinatário(s), podendo conter informações confidenciais e/ou legalmente privilegiadas sobre a APPI Tecnologia S/A. Qualquer modificação, retransmissão, disseminação, impressão ou utilização não autorizada fica estritamente proibida. Se você recebeu esta mensagem por engano, por favor informe ao remetente e apague o material e as cópias de sua máquina. LEGAL ADVICE - This message - including any attachments - contains confidential and privileged information from APPI Tecnologia S/A intended for the named recipient(s) only. Any modification, copying, printing or distribution of this message or the taking of any action based on it is strictly prohibited. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
need suggestion about jdk 1.4 logging in Tomcat
Hi, I need a suggestion about java logging within a context. I´d like to have a way to isolate the jdk1.4 log between Tomcat contexts. In my own lines of code, I create a JDK1.4 logger with an associated name, Handler and Formatter. This way, I have one log file per context. My problem is when I add Frameworks like Struts and Hibernate to my context. I would like them logging into my current context log file. Since they use commons logging, I´ve had to call LogManager.getLogManager().readConfiguration(InputStream is); in order to make the logging engine load my configurations and let me log where I wish. But that affects in a global way. If I have only one context running, everything is fine, but with many, the last context that called readConfiguration redefines all the precedents. I looked to the sources of the jdk and found it relies on the System Classloader... I am a little bit trapped here, as I do not know how to redirect the log of the instances of hibernate and struts to the log of my context of tomcat. I appreciate very much any suggestions. TIA, Alan Honczar AVISO LEGAL - Esta mensagem e seu conteúdo - inclusive anexos - são para uso exclusivo de seu(s) destinatário(s), podendo conter informações confidenciais e/ou legalmente privilegiadas sobre a APPI Tecnologia S/A. Qualquer modificação, retransmissão, disseminação, impressão ou utilização não autorizada fica estritamente proibida. Se você recebeu esta mensagem por engano, por favor informe ao remetente e apague o material e as cópias de sua máquina. LEGAL ADVICE - This message - including any attachments - contains confidential and privileged information from APPI Tecnologia S/A intended for the named recipient(s) only. Any modification, copying, printing or distribution of this message or the taking of any action based on it is strictly prohibited. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RES: need suggestion about jdk 1.4 logging in Tomcat
Yes, I did not bother... sorry. I was using 4.0 and 5.0, not 5.5. I upgraded Tomcat to 5.5 and tested my application. Fisrt of all, I commented my call to LogManager.readConfiguration(InputStream), and put my logging.properties under WEB-INF/classes in order lo let Tomcat read the file. Everything worked fine. But I think it will only run under Tomcat. So, I will keep looking into x4juli.jar to find a general solution. Thanks all! Boris Unckel, I am testing x4juli.jar. I will send you the results. Thanks again. -Mensagem original- De: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 3 de fevereiro de 2006 13:02 Para: Tomcat Users List Assunto: RE: need suggestion about jdk 1.4 logging in Tomcat > From: Alan Honczar [mailto:[EMAIL PROTECTED] > Subject: need suggestion about jdk 1.4 logging in Tomcat > > I need a suggestion about java logging within a context. > I´d like to have a way to isolate the jdk1.4 log between > Tomcat contexts. You didn't bother to tell us what Tomcat version you're using. If you're on the current one (5.5.x), have you read this? http://tomcat.apache.org/tomcat-5.5-doc/logging.html - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] AVISO LEGAL - Esta mensagem e seu conteúdo - inclusive anexos - são para uso exclusivo de seu(s) destinatário(s), podendo conter informações confidenciais e/ou legalmente privilegiadas sobre a APPI Tecnologia S/A. Qualquer modificação, retransmissão, disseminação, impressão ou utilização não autorizada fica estritamente proibida. Se você recebeu esta mensagem por engano, por favor informe ao remetente e apague o material e as cópias de sua máquina. LEGAL ADVICE - This message - including any attachments - contains confidential and privileged information from APPI Tecnologia S/A intended for the named recipient(s) only. Any modification, copying, printing or distribution of this message or the taking of any action based on it is strictly prohibited. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RES: need suggestion about jdk 1.4 logging in Tomcat
tomcat-juli.jar works fine under Tomcat5.0 too. I could not put x4juli.jar running... the WAR of the sample application did not open. The properties did not work at first, and after fixed, did not work at all. I will stop spending time on it, all right Boris? Thank you all! Do anyone know of any standard or possibility of standard for this behavior of logging in contexts? Thanks again. Alan Honczar -Mensagem original- De: Alan Honczar [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 3 de fevereiro de 2006 15:04 Para: Tomcat Users List Assunto: RES: need suggestion about jdk 1.4 logging in Tomcat Yes, I did not bother... sorry. I was using 4.0 and 5.0, not 5.5. I upgraded Tomcat to 5.5 and tested my application. Fisrt of all, I commented my call to LogManager.readConfiguration(InputStream), and put my logging.properties under WEB-INF/classes in order lo let Tomcat read the file. Everything worked fine. But I think it will only run under Tomcat. So, I will keep looking into x4juli.jar to find a general solution. Thanks all! Boris Unckel, I am testing x4juli.jar. I will send you the results. Thanks again. -Mensagem original- De: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 3 de fevereiro de 2006 13:02 Para: Tomcat Users List Assunto: RE: need suggestion about jdk 1.4 logging in Tomcat > From: Alan Honczar [mailto:[EMAIL PROTECTED] > Subject: need suggestion about jdk 1.4 logging in Tomcat > > I need a suggestion about java logging within a context. > I´d like to have a way to isolate the jdk1.4 log between > Tomcat contexts. You didn't bother to tell us what Tomcat version you're using. If you're on the current one (5.5.x), have you read this? http://tomcat.apache.org/tomcat-5.5-doc/logging.html - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] AVISO LEGAL - Esta mensagem e seu conteúdo - inclusive anexos - são para uso exclusivo de seu(s) destinatário(s), podendo conter informações confidenciais e/ou legalmente privilegiadas sobre a APPI Tecnologia S/A. Qualquer modificação, retransmissão, disseminação, impressão ou utilização não autorizada fica estritamente proibida. Se você recebeu esta mensagem por engano, por favor informe ao remetente e apague o material e as cópias de sua máquina. LEGAL ADVICE - This message - including any attachments - contains confidential and privileged information from APPI Tecnologia S/A intended for the named recipient(s) only. Any modification, copying, printing or distribution of this message or the taking of any action based on it is strictly prohibited. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. - - 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]
Trouble understanding security constraints
My normal deployment of Tomcat is behind apache2, and up to now I have been using basic authentication defined by Apache's configuration file as to who has access to what. I am about to implement the piece of the application that allows users to change their own passwords, and the administrator to set up and administer users. In order to develop and test the application where I am only running tomcat (controlled via eclipse) I need to replicate the security controls I will eventually be putting in place via apache. given a servlet application called /usermgr, then relative to that root, I need url patterns /* to require that any user who has an entry in the user table of the JDBCRealm I am using is prompted to login, and must successfully do so, whereas to access a url pattern of /admin/* I need to ensure that the person who has logged in has the role of 'admin'. I think I need something like this in my web.xml file. Have I understood this correctly? Valid Users /* * Site Admin /admin/* admin but where I am stuck is with the login config BASIC Is realm name just some descriptive text to prompt the user with, or has it any other significance, and am I limited to only one user prompt for both security constraints? Finally, what does security role mean within there. ie do I need the following Site administrator admin and what does it acutally mean? -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trouble understanding security constraints
On Thursday 09 February 2006 04:05, Bill Barker wrote: > "Alan Chandler" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] ... > This works correctly in TC 5.x. You need to reverse the order for TC 4.1.x > (this is due to a change in the respective versions of the servlet spec > they implement). > > > > > > > > >Valid Users > > > > /* > > > > > > * > > > > > > > > > > > > > >Site Admin > > > > /admin/* > > > > > > admin > > > > > > Since I am doing everything for TC 4.1.3 (Debian Stable) and just to be clear, do you mean the following (ie swapping round the security-constraints) Site Admin /admin/* admin Valid Users /* * Otherwise thank you very much that was very clear. -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Setting up a parallel test environment on the same machine as main server
I have a setup on my home web site that consists of apache2 front ending Tomcat 4.1, connected via jk_mod. Both software packages actually sit on the same machine, which is the gateway between the WAN and my LAN, and has two Ethernet Cards The external web site (www.chandlerfamily.org.uk) has the WAN address, my other addresses are several IP addresses from the 192.168.0.0 range, all simultaneously served off the LAN side interface. An internal dns allocates lan addresses with names of the form *.home At the current time, the definition of all the jk directives is held in a file called jk.conf, which is included into the apache configuration at a global level (ie outside any virtual hosts directives). There is a single workers.properties file which defines a worker called tomcat sitting on appserv.home (one of the ip addresses refered to in the first paragraph) There is a single JkMountFile directive inside the jk.conf file that refers to a urimap.properties file that maps what gets mapped to be served by the tomcat worker and what gets mapped to be served as static content. I want to set up a testing environment in apache such that prior to new versions of the application going live, I would like to run them in some form of test mode in a separate (apache) virtual host. I will use the name test.home which is yet another ip address on this same box for the apache virtual host. I am doing that so I can access the same database engine (also on this machine) [Full testing on a separate machine will have happened first, so this not as daft as it might seem] Unless anyone here can suggest a better way, I would like to move the JkMountFile directive from global scope to virtual host scope and have two separate files urimap files so that I can map different things dependent on which virtual host. However, since this is a live site I don't want to just conduct the simple experiment to see if will work, so I am asking here if this is OK. Although this is a simplistic approach, the downside seems to be that unless I also separate tomcat into two separate virtual hosts I cannot use the same servlet name for both production and test instances of my application. However, I don't fully understand the relationship between , and stanza's in the server.xml file, and until I do, I am reluctant to muck about with it and potentially screw the currently working arrangement. Can I ask, am I right in thinking... and have a one to one mapping and effectively map on to a single IP address assigned to the server (although it never seems to be specified directly as it gets picked up from one of the defaulthost attribute), and that each represents a single name from the dns that maps onto that IP address. Therefore there may be several host stanza's but all hosts must have the same IP address. However I am confused about workers and the jvmRoute attribute on the tag. Inside the workers.properties file you define the host for a given instance of a worker. Therefore, how to the workers get mapped on to the virtual hosts? In otherwords, in order to separate namespaces for my apache virtual hosts' connection to tomcat do I need one or two stanza's mapped to one or two separate -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting up a parallel test environment on the same machine as main server
On Sunday 12 February 2006 17:07, Alan Chandler wrote: ... > Unless anyone here can suggest a better way, I would like to move the > JkMountFile directive from global scope to virtual host scope and have two > separate files urimap files so that I can map different things dependent on > which virtual host. > > However, since this is a live site I don't want to just conduct the simple > experiment to see if will work, so I am asking here if this is OK. Is there really nobody on this list who can answer this simple question? ... > However, I don't fully understand the relationship between , > and stanza's in the server.xml file, and until I do, I am > reluctant to muck about with it and potentially screw the currently working > arrangement. Specifically, there was some conversation here about it best that if tomcat was running on the same box as the web server (which it is in my case) that it would be best to make the connection between apache2 and tomcat be via localhost. That being the case, how can I map the SAME servlet name but from a different virtual host (albeit ip based) on apache to DIFFERENT hosts on the same tomcat engine. -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting up a parallel test environment on the same machine as main server
On Tuesday 14 February 2006 12:36, Tim Lucia wrote: > 1. Moving the JkMount directive inside a will make it > accesible from only that virtual host. So, you must repeat common ones, > such as /jkmanager. I put the mappings (JkMount(s)) right in the virtual > host definition(s) with no trouble at all. Thanks - just what I needed confirmation on > > 2. The virtual host is determined by the http host header, not by the > connector host name. This is true for both httpd and tomcat (and any other > web server.) Not sure I understand what you are mean here by "http host header", isn't that the name of the web site that I am accessing (ie as known by apache) rather than as known by a backend topcat At the moment, I have apache, with two virtual host names of home.chandlerfamily.org.uk (also known as www.chandlerfamily.org.uk) (ip address of my WAN) money.home (ip address of 192.168.0.32) based on ip addressing only (ie not named virtual hosts - because it also needs to support https where named virtual hosts are not supported) which all end up using tomcat services for parts of the web site (urls as defined in JkMountFile). It is all directed to a single tomcat host via a single worker.properties file with the following worker.list=tomcat worker.tomcat.type=ajp13 worker.tomcat.host=appserv.home worker.tomcat.port=8009 worker.tomcat.connect_timeout=10 and a single host on the server.xml line defined as appserv.home This appserv.home (ip address 192.168.0.31) is certainly currently getting all the traffic it should get from apache - but I don't see how that is related to the http host in the header. BUT ... Do you mean that if I had changed my workers thusly worker.list=production,test worker.production.host=prodserv.home worker.test.host=testserv.home ... for the other parameters but where both prodserv.home, and testserv.home had the SAME ip address (say 127.0.0.1 :-) ) AND i add an apache virtual host of test.home (ip address 192.168.0.39) That I can differenciate them in the server.xml file by having an engine running of localhost, but with two hosts with names of prodserv.home and testserv.home respectively, and that provided the JkMountFile was then moved into the correct apache virtual host context, then the same url could be mapped by one apache virtual host to worker production and the other apache virtual host could map to worker test. I could then have different versions of the same app running on production and test. > > You can always install Apache httpd + Tomcat on a second machine (or on the > same machine on a separate set of ports), if you are reluctant to try it on > you production host. > > HTH, > Tim > > > -Original Message- > From: Alan Chandler [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 14, 2006 3:50 AM > To: users@tomcat.apache.org > Subject: Re: Setting up a parallel test environment on the same machine as > main server > > > On Sunday 12 February 2006 17:07, Alan Chandler wrote: > ... > > > Unless anyone here can suggest a better way, I would like to move the > > JkMountFile directive from global scope to virtual host scope and have > > two separate files urimap files so that I can map different things > > dependent on which virtual host. > > > > However, since this is a live site I don't want to just conduct the > > simple experiment to see if will work, so I am asking here if this is > > OK. > > Is there really nobody on this list who can answer this simple question? > > ... > > > However, I don't fully understand the relationship between , > > and stanza's in the server.xml file, and until I do, I > > am reluctant to muck about with it and potentially screw the currently > > working arrangement. > > Specifically, there was some conversation here about it best that if tomcat > was running on the same box as the web server (which it is in my case) that > it would be best to make the connection between apache2 and tomcat be via > localhost. That being the case, how can I map the SAME servlet name but > from > a different virtual host (albeit ip based) on apache to DIFFERENT hosts on > the same tomcat engine. -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting up a parallel test environment on the same machine as main server
On Tuesday 14 February 2006 12:36, Tim Lucia wrote: > > > You can always install Apache httpd + Tomcat on a second machine (or on the > same machine on a separate set of ports), if you are reluctant to try it on > you production host. Of course in an ideal world I would - but this is my home, and I don't have any more spare machines. I am already testing on an independant machine first, but I want to essentially bring a new version gently into play - running off of a single database on my main server - just to prove that I can bring the application up in as close to production environment as possible in a test environment before switching it to live. -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting up a parallel test environment on the same machine as main server
On Wednesday 15 February 2006 01:13, Tim Lucia wrote: > The http host header is sent by the user-agent ("browser") based on the > address requested in the URL. This is how virtual hosts are > differentiated. Tomcat supports a container for virtual host > differentiation, just like Apache does. You do not need to change the > workers at all. Tomcat sees the same host header that Apache does. I.e., > using Tamper Data and FireFox, I see > > Host=www.chandlerfamily.org.uk Yes - I get that part. > > When I request your web site. (Along with a photo of you, presumably, in a > tie & sunglasses ;-) You might also want to send just "Apache" for the > server, rather then Yes its me (although they are my normal glasses that I wear all the time - they just have light sensitive lenses), taken at my daughters graduation from Southampton University in the summer 2004 :-) > > Server=Apache/2.0.54 (Debian GNU/Linux) mod_auth_pgsql/2.0.2b1 DAV/2 > SVN/1.1.4 mod_jk/1.2.14 mod_python/3.1.3 Python/2.3.5 PHP/4.3.10-16 > mod_ssl/2.0.54 OpenSSL/0.9.7e mod-xslt/1.0.0rc1 > > As it is "more secure". How to do this was recently discussed on this > list. Low priority - but I'll look at it. > > So, you should have two virtual hosts (by name) in both server.xml and > httpd.conf. Not sure how to solve the https problem -- never tried to > myself. This is where I get lost. I currently have two virtual hosts on apache pointing at the same virtual host on tomcat ALL with different names - so this doesn't square with what you are saying of there being a one to one mapping. This server is running linux, with two ethernet cards. On the WAN side (which is what you can see) my ISP allocated via dhcp a single IP address. That is the www.chandlerfamily.org.uk address. On the lan side, I can allocate multiple IP addresses to the card in a set of "psuedo devices", so at the moment it has address 192.168.0.20 and 192.168.0.30, 31, 32 and 39. Each of these is given separate names such as roo.home, appserv.home, webmail.home money.home and test.home by a nameserver also running on that machine On apache I have a number of virtual hosts set up (but because of the https problem they MUST be differenciated by ip address). At the moment I have the virtual hosts www.chandlerfamily.org.uk and money.home directing traffic to tomcat on the host appserv.home (the home page you saw was being generated in a java application). I want to add a tomcat host to serve java applications to an apache virtual host running on test.home. If I understand you correctly you would advocate creating additional elements of my server.xml file with names of www.chandlerfamily.org.uk and test.home (I presume I have to keep default host of appserv.home just so that tomcat knows which ip address to listen on). If I do that how do I pick up traffic to money.home? add another statement with repeated contexts? -- Alan Chandler http://www.chandlerfamily.org.uk Open Source. It's the difference between trust and antitrust. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: error in tomcat
One place to start might be in your web.xml file. About half way down you have a message saying Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig SEVERE: Parse error in application web.xml java.lang.IllegalArgumentException: addChild: Child name 'default' is not unique at o And at the end you have at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig SEVERE: Occurred at line 43 column 15 Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig start SEVERE: Marking this application unavailable due to previous error(s) Does 'line 43 column 15' refer to something relevant in web.xml? Regards Alan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how can I run normal web sites using Tomcat?
Hi Andrew Tomcat is not a 'general purpose' web server - rather, it is a 'Java web application' server and is specifically designed to support a number of standards for serving Java web-based applications (eg, the 'servlet spec'). If you need to run a 'mixed' set of web applications, including static (.htm or .html) pages and PHP and CGI scripts you should probably consider running both the Apache HTTP server and Tomcat together. I've had quite a lot of success with this, but its not exactly trivial to setup. See http://httpd.apache.org/ for more details on the Apache server. See the http://tomcat.apache.org/connectors-doc/ page for more information on linking Tomcat to Apache. You can combine Apache and Tomcat with the mod_jk connector, which means that when you can configure the system to pass Java specific requests to Tomcat and serve PHP and CGI with Apache. Although it is possible to serve static HTML pages with Tomcat such as you can create with Dreamweaver etc, it certainly doesn't offer the ability to serve PHP content except as CGI. You can see http://tomcat.apache.org/tomcat-5.5-doc/cgi-howto.html for how to serve CGI with Tomcat. You *could* use a command line PHP script as a CGI program but frankly it's not a very good way to do it. To recap - if you want to serve Java, PHP and other CGI (say PERL) then use Apache as the front end and Tomcat for the Java side of things. If you don't need to serve Java applications at all, then you probably don't need Tomcat! Regards Alan Chaney Andrew E. Davidson wrote: Hello Does anyone one know how I can run normal web sites on Tomcat? By normal I mean sites that are produced using a tool like Microsoft's front page, or Dream weaver. The web masters of these sites want to publish their site changes using FTP. They do not have the ability to create WAR files. Does anyone know what I would have to do to run a web site that was implemented using PHP or CGI scripts? Thanks Andy p.s. I did not find anything about this topic on the documentation, FAQ's, or Tomcat reference books I have purchased - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
question regarding alias for context
Hi, Maybe I will ask a stupid question but I did not found how to do it yet... I have 2 contexts in my Tomcat 4.1 ctxA and ctxB. My clients access them with full URLs: https://myserver.com/ctxA/page.jsp and https://myserver.com/ctxB/page.jsp Those contexts have different revisions of an application. I´d like to kill the ctxA making the clients access ctxB in a transparent way. I am trying to find a way of removing the webapp ctxA and configure the string "ctxA" as an alias to the context ctxB. Anyone could give me directions? Thank you very much. Alan AVISO LEGAL - Esta mensagem e seu conteúdo - inclusive anexos - são para uso exclusivo de seu(s) destinatário(s), podendo conter informações confidenciais e/ou legalmente privilegiadas sobre a APPI Tecnologia S/A. Qualquer modificação, retransmissão, disseminação, impressão ou utilização não autorizada fica estritamente proibida. Se você recebeu esta mensagem por engano, por favor informe ao remetente e apague o material e as cópias de sua máquina. LEGAL ADVICE - This message - including any attachments - contains confidential and privileged information from APPI Tecnologia S/A intended for the named recipient(s) only. Any modification, copying, printing or distribution of this message or the taking of any action based on it is strictly prohibited. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. - Só imprima se for realmente necessário. Cada tonelada de papel poupado economiza de 17 a 20 eucaliptos com 7 anos de idade. Sua empresa também agradece. Print only if necessary. Each ton of non-used paper is equivalent to 17-20 young eucalyptus trees. Your company will also appreciate this economy. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RES: question regarding alias for context
Sorry the persistence, but as I still did not found a way of doing that I am reposting and trying to explain myself better. The problem is that my clients are POS based applications and the URL used is fixed. Part of the POSs are pointing to context A and the others to context B because of different app versions (different branches). Now, ctx B is able to receive the old requests that are now for ctx A, but the URL is fixed in the POSs. I have 3 alternatives: a. recall the terminals. (not recommendable) b. substitute the context A with an app that replaces the fixed URL. (implies in lots of burocracy) c. configuring an alias to context B, forcing the old URL to reach ctx B. I tried making Apache redirect the requests of ctxA to the connector of ctxB, but it did not work. TomCat is still loading the classes of ctxA. I´d like TomCat to understand ctxA as ctxB. Please help, and thanks in advance... Alan -Mensagem original- De: Alan Honczar [mailto:[EMAIL PROTECTED] Enviada em: segunda-feira, 20 de março de 2006 19:26 Para: Tomcat Users List Assunto: question regarding alias for context Hi, Maybe I will ask a stupid question but I did not found how to do it yet... I have 2 contexts in my Tomcat 4.1 ctxA and ctxB. My clients access them with full URLs: https://myserver.com/ctxA/page.jsp and https://myserver.com/ctxB/page.jsp Those contexts have different revisions of an application. I´d like to kill the ctxA making the clients access ctxB in a transparent way. I am trying to find a way of removing the webapp ctxA and configure the string "ctxA" as an alias to the context ctxB. Anyone could give me directions? Thank you very much. Alan AVISO LEGAL - Esta mensagem e seu conteúdo - inclusive anexos - são para uso exclusivo de seu(s) destinatário(s), podendo conter informações confidenciais e/ou legalmente privilegiadas sobre a APPI Tecnologia S/A. Qualquer modificação, retransmissão, disseminação, impressão ou utilização não autorizada fica estritamente proibida. Se você recebeu esta mensagem por engano, por favor informe ao remetente e apague o material e as cópias de sua máquina. LEGAL ADVICE - This message - including any attachments - contains confidential and privileged information from APPI Tecnologia S/A intended for the named recipient(s) only. Any modification, copying, printing or distribution of this message or the taking of any action based on it is strictly prohibited. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. - Só imprima se for realmente necessário. Cada tonelada de papel poupado economiza de 17 a 20 eucaliptos com 7 anos de idade. Sua empresa também agradece. Print only if necessary. Each ton of non-used paper is equivalent to 17-20 young eucalyptus trees. Your company will also appreciate this economy. - 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]
RES: question regarding alias for context
Yes, Apache 1.3.29. I will try to find those rules. Thank you very much. -Mensagem original- De: Allistair Crossley [mailto:[EMAIL PROTECTED] Enviada em: quinta-feira, 23 de março de 2006 11:12 Para: Tomcat Users List Assunto: RE: question regarding alias for context I would have thought some Apache [RewriteRule]s would do the trick. Do you use an Apache web server in front of Tomcat (you seem to suggest so with (c)) Allistair -Original Message- From: Alan Honczar [mailto:[EMAIL PROTECTED] Sent: 23 March 2006 14:06 To: Tomcat Users List Subject: RES: question regarding alias for context Sorry the persistence, but as I still did not found a way of doing that I am reposting and trying to explain myself better. The problem is that my clients are POS based applications and the URL used is fixed. Part of the POSs are pointing to context A and the others to context B because of different app versions (different branches). Now, ctx B is able to receive the old requests that are now for ctx A, but the URL is fixed in the POSs. I have 3 alternatives: a. recall the terminals. (not recommendable) b. substitute the context A with an app that replaces the fixed URL. (implies in lots of burocracy) c. configuring an alias to context B, forcing the old URL to reach ctx B. I tried making Apache redirect the requests of ctxA to the connector of ctxB, but it did not work. TomCat is still loading the classes of ctxA. I´d like TomCat to understand ctxA as ctxB. Please help, and thanks in advance... Alan -Mensagem original- De: Alan Honczar [mailto:[EMAIL PROTECTED] Enviada em: segunda-feira, 20 de março de 2006 19:26 Para: Tomcat Users List Assunto: question regarding alias for context Hi, Maybe I will ask a stupid question but I did not found how to do it yet... I have 2 contexts in my Tomcat 4.1 ctxA and ctxB. My clients access them with full URLs: https://myserver.com/ctxA/page.jsp and https://myserver.com/ctxB/page.jsp Those contexts have different revisions of an application. I´d like to kill the ctxA making the clients access ctxB in a transparent way. I am trying to find a way of removing the webapp ctxA and configure the string "ctxA" as an alias to the context ctxB. Anyone could give me directions? Thank you very much. Alan AVISO LEGAL - Esta mensagem e seu conteúdo - inclusive anexos - são para uso exclusivo de seu(s) destinatário(s), podendo conter informações confidenciais e/ou legalmente privilegiadas sobre a APPI Tecnologia S/A. Qualquer modificação, retransmissão, disseminação, impressão ou utilização não autorizada fica estritamente proibida. Se você recebeu esta mensagem por engano, por favor informe ao remetente e apague o material e as cópias de sua máquina. LEGAL ADVICE - This message - including any attachments - contains confidential and privileged information from APPI Tecnologia S/A intended for the named recipient(s) only. Any modification, copying, printing or distribution of this message or the taking of any action based on it is strictly prohibited. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. - Só imprima se for realmente necessário. Cada tonelada de papel poupado economiza de 17 a 20 eucaliptos com 7 anos de idade. Sua empresa também agradece. Print only if necessary. Each ton of non-used paper is equivalent to 17-20 young eucalyptus trees. Your company will also appreciate this economy. - 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] --- QAS Ltd. Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- Disclaimer: The information contained within this e-mail is confidential and may be privileged. This email is intended solely for the named recipient only; if you are not authorised you must not disclose, copy, distribute, or retain this message or any part of it. If you have received this message in error please contact the sender at once so that we may take the appropriate action and avoid troubling you further. Any views expressed in this message are those of the individual sender. QAS Limited has the right lawfully to record, monitor and inspect messages between its employees and any third party. Your messages shall be subject to s
RES: RES: question regarding alias for context
You are very right, I could do this within my app in context A, but I would have to keep and maintain context A for forwarding... If I change the context A, I will do a permanent solution by writing a JSP that changes the client variable that defines the context name that forms the URL (affecting the next gets and posts). That would force the app to download the newer version. After verified that all the clients have migrated, I could rm the ctx A. I think that it will be the way, because mod_rewrite is available for Apache2 and latest... Thank you very much! Best regards, Alan -Mensagem original- De: Lothar Krenzien [mailto:[EMAIL PROTECTED] Enviada em: quinta-feira, 23 de março de 2006 12:08 Para: Tomcat Users List Assunto: Re: RES: question regarding alias for context Please be aware of the difference between *redirect* and *forward* ( http://www.javapractices.com/Topic181.cjp ). With the java UrlRewriteFilter package ( http://tuckey.org/urlrewrite/ ) you can only do a *redirect* between different contexts. To do a transparently forwarding you need a web server like Apache or IIS. But maybe you can define a (servlet) mapping for your clients in your web.xml. Hope that helps Lothar > -Ursprüngliche Nachricht- > Von: "Tomcat Users List" > Gesendet: 23.03.06 15:24:59 > An: "Tomcat Users List" > Betreff: RES: question regarding alias for context > Yes, Apache 1.3.29. I will try to find those rules. > Thank you very much. > > -Mensagem original- > De: Allistair Crossley [mailto:[EMAIL PROTECTED] > Enviada em: quinta-feira, 23 de março de 2006 11:12 > Para: Tomcat Users List > Assunto: RE: question regarding alias for context > > I would have thought some Apache [RewriteRule]s would do the trick. Do you > use an Apache web server in front of Tomcat (you seem to suggest so with (c)) > > Allistair > > -Original Message- > From: Alan Honczar [mailto:[EMAIL PROTECTED] > Sent: 23 March 2006 14:06 > To: Tomcat Users List > Subject: RES: question regarding alias for context > > Sorry the persistence, but as I still did not found a way of doing that I am > reposting and trying to explain myself better. > > The problem is that my clients are POS based applications and the URL used is > fixed. > Part of the POSs are pointing to context A and the others to context B > because of different app versions (different branches). > Now, ctx B is able to receive the old requests that are now for ctx A, but > the URL is fixed in the POSs. > > I have 3 alternatives: > > a. recall the terminals. (not recommendable) b. substitute the context A with > an app that replaces the fixed URL. (implies in lots of burocracy) c. > configuring an alias to context B, forcing the old URL to reach ctx B. > > I tried making Apache redirect the requests of ctxA to the connector of ctxB, > but it did not work. TomCat is still loading the classes of ctxA. IŽd like > TomCat to understand ctxA as ctxB. > > Please help, and thanks in advance... > Alan > > -Mensagem original- > De: Alan Honczar [mailto:[EMAIL PROTECTED] Enviada em: segunda-feira, 20 de > março de 2006 19:26 > Para: Tomcat Users List > Assunto: question regarding alias for context > > Hi, > Maybe I will ask a stupid question but I did not found how to do it yet... > > I have 2 contexts in my Tomcat 4.1 ctxA and ctxB. > My clients access them with full URLs: > https://myserver.com/ctxA/page.jsp and > https://myserver.com/ctxB/page.jsp > > Those contexts have different revisions of an application. > > IŽd like to kill the ctxA making the clients access ctxB in a transparent way. > > I am trying to find a way of removing the webapp ctxA and configure the > string "ctxA" as an alias to the context ctxB. > > Anyone could give me directions? > > Thank you very much. > > Alan > > > > AVISO LEGAL - Esta mensagem e seu conteúdo - inclusive anexos - são para uso > exclusivo de seu(s) destinatário(s), podendo conter informações confidenciais > e/ou legalmente privilegiadas sobre a APPI Tecnologia S/A. Qualquer > modificação, retransmissão, disseminação, impressão ou utilização não > autorizada fica estritamente proibida. Se você recebeu esta mensagem por > engano, por favor informe ao remetente e apague o material e as cópias de sua > máquina. > > LEGAL ADVICE - This message - including any attachments - contains > confidential and privileged information from APPI Tecnologia S/A intended for > the named recipient(s) only. Any modification, copying, printing or > distribution of this message or the taking of any action based on it is > strictly prohibited. If you have received
problem building tcnative
Trying to get rid of this error message when I start tomcat 5.5.17 "The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path" I discovered I have to build the tcnative library, but its giving me problems. I am running under Debian unstable, having installed libapr1-dev . In essence I run this command ./configure --with-apr=/usr/bin/apr-config --with-java-home=/usr/lib/jvm/java-1.5.0-sun && make && make install and after configuring correctly, the first line of the make file fails make[1]: Entering directory `/home/alan/dev/tomcat-native-1.1.3/jni/native' /bin/sh /usr/share/apr-1.0/build/libtool --silent --mode=compile i486-linux-gnu-gcc -pipe -Wall -g -O2 -pthread -pipe -Wall -g -O2 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -DHAVE_OPENSSL -I/home/alan/dev/tomcat-native-1.1.3/jni/native/include -I/usr/lib/jvm/java-1.5.0-sun/include -I/usr/lib/jvm/java-1.5.0-sun/include/linux -I/usr/include/apr-1.0 -o src/os.lo -c src/os.c && touch src/os.lo /bin/sh: /usr/share/apr-1.0/build/libtool: No such file or directory Tracking back what seems to be happening is that configure runs build/tcnative.m4 which includes this APR_BUILD_DIR="`$apr_config --installbuilddir`" ($apr_config is the apr-config tool I specified on the command line, and outputs this - /usr/share/apr-1.0/build ) and then it sets up build/rules.mk where APR_BUILD_DIR gets turned into apr_builddir. Then this line inside rules.mk defines libtool thus LIBTOOL=$(SHELL) $(apr_builddir)/libtool which is where the error occurs, because libtool is (in Debian) in /usr/bin, not in /usr/share/apr-1.0/build/ The question is - where is the error? in the Debian packaging or in this piece of tomcat, or have I missed some parameter of the ./configure? -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Changing defaultHost from localhost to a FQDN
I'm sure this must be a FAQ, but I can't find the answer anywhere. I have a simple standalone tomcat install that works just fine, but as soon as I change the Engine defaultHost and Host name fields from "localhost" to "myhost.com", everything stops working. As well as changing the entries in server.xml I also renamed the localhost directory in the Catalina directory to "myhost.com", but although the server starts OK and I get no errors in the log files, any attempt to access the application gets a 404 - including the standard tomcat manager app. I notice there are localhost lines in logging.properties - do I need to change them as well? I find the logging.properties documentation to be pretty much impenetrable, to be frank. Here's my server.xml. In case anyone wonders, the port=80 isn't the problem, the tomcat user has been given permissions to access that port, and it worked fine on port 80 before I changed the hostname from localhost. Any and all suggestions (including RTFMs) gratefully received - I'm at my wits end with this! -- -- -- Alan Burlison -- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing defaultHost from localhost to a FQDN
I just tried the same change, and it all works fine - assuming you have made an entry for myhost.com in your hosts file, restarted Tomcat, and cleared your browser's cache. That occured to me just after I sent mail ;-) I've just tried that and it didn't help, unfortunately :-( > I realize the protocol attribute is supposed to default to "HTTP/1.1", but just for grins, you might try setting it. The odd thing is that it does appear to be serving *html* from under the web application directory, just not JSPs. If I put an index.html under webapps/ROOT I see the content. -- Alan Burlison -- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing defaultHost from localhost to a FQDN
On 27/10/06, Pid <[EMAIL PROTECTED]> wrote: And try adding myhost.com, instead of changing the host name. The latter changes expected dir locations too, which is probably why your app is broken. I suspect you are right - I renamed the directories under Catalina from localhost to the FQDN when I made the change, but it still doesn't work. And if I try invoking a JSP by its full path, I get a classNotFoundException. The really annoying thing is the Tomcat documentation shows FQDN names being used, yet it doesn't actually work unless you use 'localhost' - if you need to make other changes when you change the host name, they should really be called out in the docs. -- Alan Burlison -- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing defaultHost from localhost to a FQDN
If your host entry is pointing to the same IP as the host= in server.xml then that will work e.g. localhost is same as myhost.com If your host entry points to a different IP then change the host specification in server.xml to the new host name in your situation myhost.com Be sure to put the correct port number as in http://host:Port I have. It doesn't work. Alan are you by chance related to Don? Not as far as I know... -- Alan Burlison -- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing defaultHost from localhost to a FQDN
I've just tried it again with both 5.5.20 and 6.0.0, changing "localhost" to "myhost.com" in two places in server.xml ( and ) and in the Windows hosts file. Everything works, including JSPs and servlets. For 5.5.20, my server.xml is the default one with the two changes noted above. You might want to go back to a fresh download, change only those two items, and try it again. It's possible you've accidentally taken out something critical for JSP compilations. I have it working - well, kinda. If I deploy the application as ROOT, and with ROOT as the docBase it works fine. If I move it to "meshcms" (the WAR file name) and modify docRoot to match, it doesn't. It serves the JSP but all the links in the page (e.g. to the stylesheets) are wrong. Looks like there is something wrong with the webapp. -- Alan Burlison -- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Running tomcat on port 80 on Solaris 10 or above
On 27/10/06, Asensio, Rodrigo <[EMAIL PROTECTED]> wrote: Yes sir! This simple solution worked in the first try!!! Thanks man! iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080 iptables -A INPUT -p tcp --dport 8080 -j ACCEPT For anyone who is running on Solaris 10 or above, there's an even better way - use SMF to start tomcat, and in the SMF manifest, add this to the start service definition: Adjust as appropriate for the user & group you are running tomcat under, of course. This allows the tomcat user to open low-numbered ports for the duration of startup.sh. I'm mentioning this here because I haven't seen it documented anywhere - hopefully people will be able to find it in the archives in future ;-) -- Alan Burlison -- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing defaultHost from localhost to a FQDN
The above is confusing to me. Where is the app deployed? webapps/ROOT (works) or webapps/meshcms (doesn't) Where is the element for this app located? conf/server.xml What are the attributes specified for this ? With Tomcat 5 and above, elements should not go in server.xml, the path attribute must not be used, and docBase can be used only when the element is in conf/[engine]/[host]/[appname].xml AND the app is not deployed in the 's appBase directory. Ah, and I'm using 5.5. I've checked the 5.5 docs and I can't find *any* of those restrictions mentioned, other than a recommendation that elements aren't placed in server.xml, but I got the impression that this was advisory, not mandatory. So how *should* I do what I want, i.e. deploy the app in a directory called meshcms under webapps, or am I forced to name it ROOT if I want it to be the default application? Thanks, -- Alan Burlison -- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing defaultHost from localhost to a FQDN
On 27/10/06, Caldarale, Charles R <[EMAIL PROTECTED]> wrote: The 5.0 and 5.5 docs are mild upgrades of the 4.1 versions, and some areas did not get revised as much as they should have. 5.5 especially seems to be stricter on use of unnecessary attributes when the element is not in server.xml; what I posted has been gleaned from experience. Thanks ;-) For compatibility, you can still place elements in server.xml, but it's strongly discouraged, since it requires a Tomcat restart to make any changes. > So how *should* I do what I want, i.e. deploy the app in a directory > called meshcms under webapps, or am I forced to name it ROOT if I want > it to be the default application? The current philosophy is that the default app must be named ROOT. Ah, that's not entirely clear from the docs. I can live with that, my initianl assumption (wrong) was that the name didn't actually matter. There are three ways to achieve this: 1) Deploy the app in the ROOT subdirectory of the 's appBase directory, removing any ROOT.war file if it exists. 2) Deploy the packaged app as ROOT.war in the 's appBase directory, removing the ROOT subdirectory if it exists. 3) Deploy the app outside of the 's appBase directory, and place a ROOT.xml file in conf/[engine]/[host]. The ROOT.xml file must contain a element with a docBase attribute pointing to the location of the app. Note that in the first two cases, you often do not need any element for the app. If you do require one (e.g., to configure the app as privileged), place the element and attributes in META-INF/context.xml inside the app directory structure. Alternatively, you may place the element in conf/[engine]/[host]/[appname].xml, but without the docBase attribute. If you place a element with a docBase attribute in conf/[engine]/[host]/[somefile].xml and put the app under the 's appBase directory using a name other than [somefile], you will get the app deployed twice - once as the .xml file name, once as the subdirectory or .war file name under appBase. That's an excellent, clear, summary - I haven't been able to find anything else that explains the three cases you outline above. Hopefully it might make its way into the official documentation at some point ;-) Many thanks! -- Alan Burlison -- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Deploying war files to subdir contexts through web Manager
Hi, I would like to deploy war files through the Manager application but I am having difficulty setting a COntext path that is not in the root folder. E.g., I have a war file called monitoring.war - I can deploy this as "http://servername.com/monitoring"; no problem, but as I'm using Tomcat behind apache using JkMounts, I really want to deploy to /ejava/monitoring/ as everything under /ejava os mounted. Can I do this only using the war deployer or am I back to manually configuring context paths through server.xml? web.xml I'm currently using that isn't doing what I want it to.. 2.2//EN " "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd";> Lumison Monitoring App This is a simple web application containing a single servlet of the "Hello, World" variety. Monitoring Monitoring Monitoring /ejava/monitoring - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Replace SSLServerSocketFactory?
Hello All, I know that there used to be (in tomcat 4) a way to replace the SSLServerSocketFactory that got used to create the listener. I'm using 5.5 and want to put in a custom socket factory with a custom TrustManager that uses external configuration to make client authentication decisions. We're using tomcat embedded (writing code around the org.apache.catalina.startup.Embedded class) to try and setup the server. I looked at the Catalina source code and found in Http11BaseProtocol.java: private void checkSocketFactory() throws Exception { if (secure) { try { // The SSL setup code has been moved into // SSLImplementation since SocketFactory doesn't // provide a wide enough interface sslImplementation = SSLImplementation.getInstance(sslImplementationName); socketFactory = sslImplementation.getServerSocketFactory(); ep.setServerSocketFactory(socketFactory); } catch (ClassNotFoundException e){ throw e; } } else if (socketFactoryName != null) { try { socketFactory = string2SocketFactory(socketFactoryName); ep.setServerSocketFactory(socketFactory); } catch(Exception sfex) { throw sfex; } } } Which leads me to believe that directly overriding the factory is no longer doable (also noticing that the element is gone from the XML server configuration file. Does anyone know a way to provide a custom SSL implementation in 5.5 without rebuilding / rewriting the actual Catalina code? TIA, Alan
Tomcat not reading context path directive
HI there, I'm running Tomcat 5.5.12 (Red Hat Enterprise Linux stock packages). I am trying to set a Context path directive for /ejava/appname Tomcat is ignoring the Context path and instead taking the context from the xml file name (so it's reading the file and the docBase directive). The servlet is served, just not from the desired context. I am setting the context up in /etc/tomcat5/Catalina/localhost/bield.xml. My xml file looks like: override="true" privileged="true" antiResourceLocking="false" antiJARLocking="false"> Any ideas where I'm going wrong? - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
File permission problem not understood
I have just upgraded my Debian Etch system from tomcat5 to tomcat5.5 Now when I start my applications I am getting the following javax.servlet.ServletException: Unable to initialize application servlet: access denied (java.io.FilePermission /var/lib/tomcat5.5/webapps/blog/WEB-INF/classes/META-INF/hivemodule.xml read) the root cause of this is ... java.security.AccessControlException: access denied (java.io.FilePermission /var/lib/tomcat5.5/webapps/blog/WEB-INF/classes/META-INF/hivemodule.xml read) The file refered to exists and is accessable by tomcat ls -l /var/lib/tomcat5.5/webapps/blog/WEB-INF/classes/META-INF/hivemodule.xml gives -rw-r--r-- 1 tomcat55 nogroup 1035 2006-01-26 19:13 hivemodule.xml so I puzzled as what I need to do to fix it. Can anyone help please -- Alan Chandler http://www.chandlerfamily.org.uk
Re: File permission problem not understood
On Tuesday 06 February 2007 09:57, Pid wrote: > Do you have a SecurityManager running? > > Alan Chandler wrote: > > I have just upgraded my Debian Etch system from tomcat5 to > > tomcat5.5 Yes - that was the issue - I had turned it off on tomcat5 Thanks -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
context placement
I am trying to use tomcat 5.5 for the first time - having just moved from tomcat5. I am getting symptoms (I think) of my JDNI resource having not been set up properly In particular, I have NO contexts in my $CATALINA_HOME/conf/server.xml, since I want to bring these in in my webapps .war file. So in the .war file for my app I have a META-INF/context.xml file with the following in (apart from the password which I have changed) and my application attempts to connect to the JDNI resource java:/comp/env/jdbc/usermgr But when I run it, I get the following in the error message Cause: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' I am interpreting this as the JDNI resource has not been recognised. Do I have the right interpretation? Have I misunderstood how tomcat can find the contexts? -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: context placement
On Tuesday 06 February 2007 20:03, Alan Chandler wrote: > > I am getting symptoms (I think) of my JDNI resource having not been > set up properly I forgot to say that I have this working under eclipse on a development system, but it seems (as part of the Web App plugin) to copy the contents of context.xml into server.xml My reading of the docs of tomcat5.5 is that I don't need to do this (nor to Catalina/ENGINE_NAME/HOST_NAME/usermgr.xml) -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: context placement
On Tuesday 06 February 2007 20:34, Pid wrote: > Alan Chandler wrote: > > On Tuesday 06 February 2007 20:03, Alan Chandler wrote: > >> I am getting symptoms (I think) of my JDNI resource having not > >> been set up properly > Context first: Yeh just took that out as per suggestion further up thread > > you don't need to specify the /path. > the path to the webapp is determined from the name of the deployed > .war or the name of the context.xml file. > > for: > %tomcat_home%/webapps/appname1.war > > the context xml file should deploy to: > %tomcat_home%/conf/Catalina/localhost/appname1.xml When you say this, are you saying that tomcat automatically copies from the the META-INF/context.xml file in the .war file to that location (in my case that would be /var/lib/tomcat5.5/conf/Catalina/appserv.home/usermgr.xml because my host is appserv.home) BUT I only have an EMPTY localhost directory in the /var/lib/tomcat5.5/conf/Catalina directory and no appserv.home directory at all. -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[SOLVED] Re: context placement
On Tuesday 06 February 2007 20:46, Alan Chandler wrote: > On Tuesday 06 February 2007 20:34, Pid wrote: > > Alan Chandler wrote: > > > On Tuesday 06 February 2007 20:03, Alan Chandler wrote: > > >> I am getting symptoms (I think) of my JDNI resource having not > > >> been set up properly ... > > for: > > %tomcat_home%/webapps/appname1.war > > > > the context xml file should deploy to: > > %tomcat_home%/conf/Catalina/localhost/appname1.xml > > When you say this, are you saying that tomcat automatically copies > from the the META-INF/context.xml file in the .war file to that > location > Answer yes - but only if it has permissions. I think this is a debian problem in that Catalina directory is owned by root with 755 access rights. -- Alan Chandler http://www.chandlerfamily.org.uk - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Programmatically detecting login or logout events
Martin the problem is that even when you invalidat the session... the browser itself still knows that the user is cool... So TC will send it a new session ID and it will return the info without even asking the user to logon as such... Please indicate the part of the Tomcat code which makes the above behavior happen. I quote from the Servlet 2.4 spec. "If the user is authenticated using form login and has created an HTTP session, the timeout or invalidation of that sessions leads to the user being logged out in the sense that subsequent requests must be re-authenticated." (SRV.12.5.3.1 Login Form Notes) so I don't think what you say is correct. Even when a user opens a new page in the browser... it knows they "still" cool Until the browser is closed they logged on ;) And there is no direct "the browser is gone event"... browsers are stateless yada yada This isn't actually correct. Invalidating the session on the server means that the browser's record of the session is as though the session never existed. Tomcat will no longer 'associate' session state with the session Id provided by the browser and all the state in the session is lost (unless persisted by an application.) request.getRemoteUser() will return null because the browser and server can no longer agree on a sessionID, this is as other contributors have said the 'logged out' state. The standard servlet authentication mechanisms will redirect any furtheraccess to protected pages to the selected login mechanism as soon as the session is invalidated. if request.getRemoteUser() has the users name... they on... you dont know when they off but you can track the user... either you have that in every page and if you get a name you record time page url... or you can stick that in a filter... which sits in front of all your pages, so you dont have to doctor every page on a site... You know when they in... you dont know when they gone.. It is true that unless you have some javascript code which specifically generates an event to say that the browser is logged out AND the network connection is still valid, you don't actually know that the browser has 'gone'. However, you can easily generate a session timeout event. I have actually implemented user state logging (detect log in event, detect navigation events and detect either manual logout or session timeout and it works fine. It is driven entirely from looking at the state of 'getRemoteUser' and the session timeout event. Regards Alan Chaney - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Committing sendRedirect()
Tore Your code below is written as though the 'out' was like writing data to a console. The processing in a servlet is part of a request/response cycle, where the 'request' tells it what to do and the response is the reply. Because of the nature of the request/response cycle you only get one chance at the reply. The javadocs for HttpServletResponse.sendRedirect make this clear. "If the response has already been committed, this method throws an IllegalStateException. After using this method the response should be considered to be committed and should not be written to." In other words, in one servlet request/response cycle you get exactly one chance to issue a 'sendRedirect'. If you think this through you'll see that this is how it has to be: Browser sends request to servlet Servlet process request and sendsRedirect Browser display response. Your problem is that you are trying to generate a second response without a correspondng request. The first response is for the 'top 25' and the second is for 'all the rest', but by then you've already committed the response. To achieve what I think you are trying to achieve would require you to create some mechanism where the lucene query results are processed in a separate thread and your application makes TWO requests - one for the first set of results and then one for the final set of results. There are far too many different ways to do this to detail here - I hope this helps Regards Alan Chaney Tore Eriksson wrote: Hi everybody, I have a problem with redirects in Tomcat 5.5.25. I am doing a Lucene search and would like to send a redirect after finding the top 25 hits, commit this response, and then continue processing the remaining hits. The relevant parts of the doPost() code are as below: final int PARTIAL_HITS = 25; for (int i = 0; i < hits.length(); i++) { Document doc = hits.doc(i); String citation = doc.get("citation"); /** Insert into table */ try { insertId.setInt(1, java.lang.Integer.parseInt(citation)); insertId.executeUpdate(); } catch (SQLException e) { out.sendError(500, "Bad SQL insert: " + e); } catch (Exception e) {} if (i == PARTIAL_HITS) { // Intermittant redirect out.sendRedirect(resultUrl); } } insertId.close(); if (!out.isCommitted()) { // Final redirect out.sendRedirect(resultUrl); } My problem is that the intermittant redirect is not committed until the function returns, which will take quite some time for some queries. I have tried HttpServletResponse.flushBuffer() and other possible variations. Any pointers would be most appreciated. Tore ___ Tore Eriksson [tore.eriksson ad po.rd.taisho.co.jp] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] !DSPAM:488e7ade203691909011899! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Intgrate Tomcat and PHP in winxp
Radhakrishna The main issue here is that it is probably not worth doing. You would probably be better off investigating tuning apache and php. I assume that your existing installation uses mod_php? If so, the php and apache lists may be of help. httpd can be extensively tuned for memory footprint and performance. Tomcat is a java application server. The cgi access method is a convenience for working with other types of application (non-java). If you use the cgi approach you will: 1. create an entirely new process for each request (very time consuming in both memory and cpu cycles) 2. be open to more security vulnerabilities. See http://www.php.net/manual/en/security.cgi-bin.php Unless your server is serving predominantly java applications with a few PHP apps your proposed approach will be slower, not faster, and more difficult to maintain. As far as doing it 'step by step', IMHO this is an 'advanced' task and you should not be undertaking it until you fully understand all the implications for performance and security. As Tommy suggests, read and understand the documentation first. Regards Alan Chaney Radhakrishnavangara wrote: Hi Tommy, That was really informative. But let me explain you the actual scenario. I am using an application called phpESP ( a survey tool developed in PHP) and running on Apache httpd. The application is running fine, but it is consuming lot of memory space in the server. So we have decided to move the application and deploy on a lighter application server. That's the reason we have decided to deploy on Tomcat. So could you please let me know your opinion on the same. Also i am a beginner to PHP and Tomcat. Also i have spend lot of time on this and now i have to some how finish this task. Offline i will take your guidance on understanding this technology. For now could you please explain us with the step by step instruction on how to finish the same task. Regards, Radhakrishna Tommy Pham wrote: Hi Radhakrishna, --- On Sun, 8/17/08, Radhakrishnavangara <[EMAIL PROTECTED]> wrote: From: Radhakrishnavangara <[EMAIL PROTECTED]> Subject: Intgrate Tomcat and PHP in winxp To: users@tomcat.apache.org Date: Sunday, August 17, 2008, 3:24 PM Hi, Could you please let me know the step by step instructions for integrating Tomcat with PHP on Win XP. I have tried implementing various methodologies to integrate the same , but i could not achieve any breakthrough on the same. Below are some of the links to the articles which i have referred. Could you please go through the same and clarify me on this issue. http://www.windowscomputer.com/node/3814 http://www.theasolutions.com/tutorials/tomcatphp.jsp http://the-double-0-project.net/blog/?tag=tomcat http://209.85.175.104/search?q=cache:szlV41sb9qwJ:uranus.im.chu.edu.tw/~dtchang/phpexplorer/html/download.php%3Ffn%3D..%252F..%252Fpub%252F.%252Fdownload%252Fapache_tomcat%252FRunning%2Bphp%2B5.x%2Bon%2Bwindows%2Busing%2Btomcat%2B4.x%2Bor%2B5.x%2B-%2BSimple%2BThoughts%2B-%2BJava%2Band%2BWeb%2BSoftware.pdf+angusman+tomcat&hl=en&ct=clnk&cd=7&gl=in http://www.duminy.fr/blog/?p=22&language=en Thanks and Regards, Radhakrishna -- View this message in context: http://www.nabble.com/Intgrate-Tomcat-and-PHP-in-winxp-tp19022523p19022523.html Sent from the Tomcat - User mailing list archive at Nabble.com. IMO if you want to use PHP with Tomcat, it's best you read the documentation for both products and their technology as it will help you secure the server/platform and troubleshoot any problems that may arise including application crashes and security breaches. For PHP5: http://www.php.net/manual/en/ For Tomcat6: http://tomcat.apache.org/tomcat-6.0-doc/index.html For Tomcat5.5: http://tomcat.apache.org/tomcat-5.5-doc/index.html You can just go through the installation steps w/o doing the actual installation to see what you have available. Though I haven't tried this method, I think you can run PHP as CGI in Tomcat. You'll just have to edit the web.xml in $CATALINA_HOME/conf folder and follow PHP's instruction of installing as CGI. The method I prefer and have tested to work (in Unix environment although on Windows should be similar) is running Apache HTTPD server with PHP as a mod and use the connector to connect to Tomcat. If this method is used, it's easier to implement other technologies later such Perl, Python and Mono (for .Net) inside Apache HTTPD as mod-*. But you may want to evaluate your needs and goals before choosing ;) Regards, Tommy - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]