Facing Memory leak - 64 bit Tomcat 6.0.35 with windows 2008 R2(64 bit JVM 1.6.0_33)
Hi, We are using 64 bit Tomcat 6.0.35 with windows 2008 R2 (64 bit JVM 1.6.0_33) and facing memory leak issues(OutOfMemoryError ) after a short interval of time( ~30 minutes). We deploy a web application on this version of tomcat and while working with the GUI part of the application we face memory leak, but same application works fine on this windows server for 32 bit JVM. Please help us if this is an issue with 64 bit Tomcat version or with 64bit JVM or with its combination. kindly let us know a solution or any work around or for this. Thanks and Regards, Shailendra Singh
Re: How to resolve:Recreate aclocal.m4 with macros from libtool during make of tomcat connector
On 04.09.2012 05:37, Ferdie Romero wrote: On Sep 4, 2012 11:25 AM, Ferdie Romero ferdierom...@gmail.com wrote: On Sep 3, 2012 10:43 PM, Ferdie Romero ferdierom...@gmail.com wrote: On Mon, Sep 3, 2012 at 10:07 PM, Rainer Jung rainer.j...@kippdata.de wrote: On 03.09.2012 15:46, Ferdie Romero wrote: The exact step is make and the error is I guess you are running configure first? yes, we use ./configure --with-apache=prefix How does your configure command look like? Does it automatically find your apxs or apxs2 or do you give the path to it as a configure flag? --» we don't have apxs or apxs2, is this really required? Yes. It comes with the web server. Some distribution packs it into a seperate dev package. Whoever provided you with the web server should also be able to give you the right apxs. Without apxs configure will fail with an error. What does apxs -q LIBTOOL (or apxs2 -q LIBTOOL) return? Maybe you need to add the path to apxs before calling it. --we don't have apxs or apxs2, is this really required? When being inside the native directory of the mod_jk sources: What is the result of grep -i libtool config.log after running configure? --result is connectors-1.2.37-src/native # grep -i libtool config.log configure:9934: checking if libtool supports shared libraries configure:10096: creating libtool configure:19290: result: LIBTOOL=$(SHELL) $(top_builddir)/libtool LIBTOOL='$(SHELL) $(top_builddir)/libtool' OK, that's normal. It is looking for libtool in the native directory inside the sources. The same for grep LIBTOOL Makefile? --we don't have Makefile in the src.directory of the connector Are you looking in the native directory, where you issue the make command? If it is not there, then configure did not run successfully. The same for grep macro_version= libtool? -- we don't have libtool in the src.directory of the connector Correct directory? The one where you run configure and make? version mismatch error. This libtool 2.4.2 but the definition of this LT_INIT comes from an older release. You should recreate aclocal.m4 with macros from libtool 2.4.2 and run autoconf again. It seems it tries to use your own libtool instead of the one we provide. We'll see after you respond to the above questions. Based on the guide that we are using we need to perform ./configure, make and make install for the tomcat connector. If you have all the needed auto tools installed you could run ./buildconf.sh before running configure. This will recreate configure from your own auto tools including libtool. But this is not recommended. configure should work without running buildconf and no installed libtool needed. -- we already tried using buildconf but we got the same error during make. Find the right apxs for your platform and try running configure and make again. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Facing Memory leak - 64 bit Tomcat 6.0.35 with windows 2008 R2(64 bit JVM 1.6.0_33)
On 04.09.2012 08:35, Shailendra Singh wrote: Hi, We are using 64 bit Tomcat 6.0.35 with windows 2008 R2 (64 bit JVM 1.6.0_33) and facing memory leak issues(OutOfMemoryError ) after a short interval of time( ~30 minutes). We deploy a web application on this version of tomcat and while working with the GUI part of the application we face memory leak, but same application works fine on this windows server for 32 bit JVM. Please help us if this is an issue with 64 bit Tomcat version or with 64bit JVM or with its combination. kindly let us know a solution or any work around or for this. 64 Bit JVM needs more memory than 32 Bits. The pointers are double the size. Rule of thumb says 30% additional memory, but it can vary a lot depending on the application. Try larger JVM memory settings. It is unlikely that you experience a memory leak with 64 Bit JVM but not 32 Bits running the same application. Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Atmosphere Chat sample throws exception upon page reload in IE 9
Hi, I would like to use the Atmosphere framework which supports websockets and long-polling. On their page they have a little chat application exampIe that is based on Guice (see atmosphere.java.net). I run it on Tomcat 7. Loading the chat page in IE 9 works fine. However, upon reloading the page there is a tomcat exception (see stacktrace). This problem only occurs in IE9. Using Firefox, the page can be reloaded without server side exceptions. Sep 04, 2012 8:49:28 AM org.apache.catalina.core.AprLifecycleListener init Information: Loaded APR based Apache Tomcat Native library 1.1.24 using APR version 1.4.6. Sep 04, 2012 8:49:28 AM org.apache.catalina.core.AprLifecycleListener init Information: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. Sep 04, 2012 8:49:30 AM org.apache.catalina.core.AprLifecycleListener initializeSSL Information: OpenSSL successfully initialized (OpenSSL 1.0.1c 10 May 2012) Sep 04, 2012 8:49:30 AM org.apache.coyote.AbstractProtocol init Information: Initializing ProtocolHandler [http-apr-8080] Sep 04, 2012 8:49:30 AM org.apache.coyote.AbstractProtocol init Information: Initializing ProtocolHandler [ajp-apr-8009] Sep 04, 2012 8:49:30 AM org.apache.catalina.startup.Catalina load Information: Initialization processed in 1930 ms Sep 04, 2012 8:49:30 AM org.apache.catalina.core.StandardService startInternal Information: Starting service Catalina Sep 04, 2012 8:49:30 AM org.apache.catalina.core.StandardEngine startInternal Information: Starting Servlet Engine: Apache Tomcat/7.0.29 Sep 04, 2012 8:49:30 AM org.apache.catalina.startup.HostConfig deployDescriptor Information: Deploying configuration descriptor C:\Users\Anna Fohlmeister\.IntelliJIdea11\system\tomcat\Unnamed_atmosphere-guice-chat\conf\Catalina\localhost\ROOT.xml SLF4J: Failed to load class org.slf4j.impl.StaticLoggerBinder. SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Sep 04, 2012 8:49:33 AM com.sun.jersey.api.core.PackagesResourceConfig init Information: Scanning for root resource and provider classes in the packages: org.atmosphere.samples.guice Sep 04, 2012 8:49:33 AM com.sun.jersey.api.core.ScanningResourceConfig logClasses Information: Root resource classes found: class org.atmosphere.samples.guice.ResourceChat Sep 04, 2012 8:49:33 AM com.sun.jersey.api.core.ScanningResourceConfig init Information: No provider classes found. Sep 04, 2012 8:49:33 AM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory register Information: Registering org.atmosphere.samples.guice.ResourceChat as a root resource class Sep 04, 2012 8:49:33 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate Information: Initiating Jersey application, version 'Jersey: 1.13 06/29/2012 05:14 PM' Sep 04, 2012 8:49:33 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate Information: Adding the following classes declared in META-INF/services/jersey-server-components to the resource configuration: class org.atmosphere.jersey.AtmosphereResourceConfigurator Sep 04, 2012 8:49:34 AM com.sun.jersey.guice.spi.container.GuiceComponentProviderFactory getComponentProvider Information: Binding org.atmosphere.samples.guice.ResourceChat to GuiceManagedComponentProvider with the scope PerRequest Sep 04, 2012 8:49:34 AM org.apache.coyote.AbstractProtocol start Information: Starting ProtocolHandler [http-apr-8080] Sep 04, 2012 8:49:34 AM org.apache.coyote.AbstractProtocol start Information: Starting ProtocolHandler [ajp-apr-8009] Sep 04, 2012 8:49:34 AM org.apache.catalina.startup.Catalina start Information: Server startup in 4422 ms Sep 04, 2012 8:50:39 AM org.apache.catalina.connector.CoyoteAdapter event Schwerwiegend: null org.apache.tomcat.jni.Error: 620015: APR does not understand this error code at org.apache.tomcat.jni.Socket.recvbb(Native Method) at org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:575) at org.apache.coyote.http11.InternalAprInputBuffer$SocketInputBuffer.doRead(InternalAprInputBuffer.java:642) at org.apache.coyote.http11.InternalAprInputBuffer.doRead(InternalAprInputBuffer.java:532) at org.apache.coyote.Request.doRead(Request.java:422) at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:290) at org.apache.catalina.connector.Request.read(Request.java:555) at org.apache.catalina.connector.CoyoteAdapter.event(CoyoteAdapter.java:166) at org.apache.coyote.http11.Http11AprProcessor.event(Http11AprProcessor.java:133) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:581) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1770) at
Re: Tomcat Maven Plugin - Executable jar context loading and shutdown
2012/9/3 Sérgio Areias juger.on.n...@gmail.com: Hi. On 31 August 2012 21:24, Olivier Lamy ol...@apache.org wrote: 2012/8/27 Sérgio juger.on.n...@gmail.com: Hi. I am trying to use the Tomcat Maven Plugin to create an executable jar file with an embedded Tomcat7, but I am having two issues when trying to do so. The first one, is that I am not getting how I can stop my executable jar. I want to run it in from a script (like the shutdown.sh/bat from tomcat). I was not able to find any documentation about that particular issue. nope not supported. Can you give me some pointers of where I should look at if I decide to implement it? I could kill the process but that does not look a solution but a workaround instead. The second issue, is that when I run my executable jar it loads my webapp context twice (it tries because it will not be able to do it as I use a derby db, and it will give an error when trying to have the lock again). It creates a folder .extract, and the webapp works fine, but I do not want my context to be loaded twice. I am using the configurations I have found here http://tomcat.apache.org/maven-plugin-2/executable-war-jar.html . What am I missing here? Do you have a sample project as I cannot reproduce. What is the content of .extract/webapps Did you try java- jar pathtoyourjar -resetExtract (or cleanup .extract directory before) ? After taking a look to the plugin source code, I understood that I cannot use / as context, and that is why I was having the context loaded twice (ROOT and .war). Is it supported by the plugin to have a webapp running with no context when trying to have an executable jar? I ask this question because when I try to use ROOT (path/ROOT/path), I do not have the / context but /ROOT instead. (Also after studying the lines 264-272 from http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java?view=markup ) Did you simply try: path/path :-) Info about the project: - Maven project; - pom.xml with packaging war using the build found here http://tomcat.apache.org/maven-plugin-2/executable-war-jar.html ; - Running in Ubuntu 11.04; - Using: groupIdorg.apache.tomcat.maven/groupId artifactIdtomcat7-maven-plugin/artifactId version2.0-beta-1/version Thanks in advance. Best regards, Sérgio Areias -- Olivier Lamy Talend: http://coders.talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Thanks for you reply and your attention. Best regards, Sérgio Areias -- Olivier Lamy Talend: http://coders.talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Atmosphere Chat sample throws exception upon page reload in IE 9
2012/9/4 Christof Doll christof.d...@fortis-it.de: There are two different issues: Sep 04, 2012 8:50:39 AM org.apache.catalina.connector.CoyoteAdapter event Schwerwiegend: null org.apache.tomcat.jni.Error: 620015: APR does not understand this error code at org.apache.tomcat.jni.Socket.recvbb(Native Method) 1) Issue in Tomcat-Native (1.1.24) or in APR library it uses (1.4.6) I do not know what it actually is. I guess it does not understand some error code from OS. It would be nice to know what that code actually means. at org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:575) at org.apache.coyote.http11.InternalAprInputBuffer$SocketInputBuffer.doRead(InternalAprInputBuffer.java:642) at org.apache.coyote.http11.InternalAprInputBuffer.doRead(InternalAprInputBuffer.java:532) at org.apache.coyote.Request.doRead(Request.java:422) at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:290) at org.apache.catalina.connector.Request.read(Request.java:555) at org.apache.catalina.connector.CoyoteAdapter.event(CoyoteAdapter.java:166) at org.apache.coyote.http11.Http11AprProcessor.event(Http11AprProcessor.java:133) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:581) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1770) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) Sep 04, 2012 8:50:39 AM org.apache.coyote.http11.Http11AprProcessor event Schwerwiegend: Error processing request java.lang.NullPointerException at org.apache.coyote.http11.Http11AprProcessor.actionInternal(Http11AprProcessor.java:277) at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:846) at org.apache.coyote.Request.action(Request.java:346) at org.apache.catalina.connector.Request.getRemoteAddr(Request.java:1281) at org.apache.catalina.connector.Request.getRemoteHost(Request.java:1296) at org.apache.catalina.valves.AccessLogValve$HostElement.addElement(AccessLogValve.java:1327) 2) An NPE when trying to get remote host address to write it into the access log file. Tomcat has to ask the address on the socket. It fails probably because the socket is already closed. at org.apache.catalina.valves.AccessLogValve.log(AccessLogValve.java:953) at org.apache.catalina.core.AccessLogAdapter.log(AccessLogAdapter.java:51) at org.apache.catalina.core.ContainerBase.logAccess(ContainerBase.java:1263) at org.apache.catalina.core.ContainerBase.logAccess(ContainerBase.java:1270) at org.apache.catalina.connector.CoyoteAdapter.event(CoyoteAdapter.java:250) at org.apache.coyote.http11.Http11AprProcessor.event(Http11AprProcessor.java:133) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:581) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1770) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) (...) Do you have any ideas how to solve this bug? 3) Looking into bugzilla, there is known issue in 7.0.29 https://issues.apache.org/bugzilla/show_bug.cgi?id=53697 Can you re-test this with 7.0.30? There is download link in the VOTE thread on the dev mailing list. If the problem persists, you may file an issue. Please provide configuration and steps to reproduce it. 4). You may want to try running with Nio connector implementation instead of APR one. Maybe that one will behave better / differently. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Root context switching
I am new to Tomcat. What I like to do is to deploy different versions of my application, for example: hostname\myappv1 hostname\myappv2 Now I want the ROOT context to be set dynamicly to one of the available deployed versions. Is this possible? Is there a way to implement this? Dennie, This question is asked regularly. The regularly posted answer is that you must call the root war ROOT.war, such that it is unpacked as CATALINA_HOME\webapps\ROOT. There may be ways around this, but it really is much, much simpler to do this in all cases I have seen discussed. Having said that, you say that you wish to change the ROOT dynamically. Why? What is your use case? If you explain, perhaps we might be able to describe a suitable alternative Chris
Re: Root context switching
Hello, If my idea was only as simple as renaming it to ROOT.war (this one I know of):) Basic what I want is the same functionality which google apps provides. So I want to be able to have multiple versions of my application online, let people try the new environment and eventually switch the root context to the new running version. This enables my clients to try out the new version and options before they switch over to the new environment and enables me to fix bugs found in the new release. I think I need a tunnelfilter or something for this, but maybe there's something available already. I've looked at parallel deployment, but this is mostly to serve the current users the version they are currently using. Cheers, Dennie 2012/9/4 chris derham ch...@derham.me.uk I am new to Tomcat. What I like to do is to deploy different versions of my application, for example: hostname\myappv1 hostname\myappv2 Now I want the ROOT context to be set dynamicly to one of the available deployed versions. Is this possible? Is there a way to implement this? Dennie, This question is asked regularly. The regularly posted answer is that you must call the root war ROOT.war, such that it is unpacked as CATALINA_HOME\webapps\ROOT. There may be ways around this, but it really is much, much simpler to do this in all cases I have seen discussed. Having said that, you say that you wish to change the ROOT dynamically. Why? What is your use case? If you explain, perhaps we might be able to describe a suitable alternative Chris
Re: Root context switching
Basic what I want is the same functionality which google apps provides. So I want to be able to have multiple versions of my application online, let people try the new environment and eventually switch the root context to the new running version. This enables my clients to try out the new version and options before they switch over to the new environment and enables me to fix bugs found in the new release. Two options spring to mind. First is to have multiple tomcat instances running. One is production with accepted versions of wars. Then a second instance could run on a different port allowing you to test the new wars. When they are accepted, you deploy on the production instance. Second option is a slight variation - you could run a single instance, but have two hosts specified. In one host you specify your production wars, and in the second you specify your UAT wars. Every company that I have worked in always runs separate a production and UAT machines. If you don't want multiple machines, then I'd go for option 1. HTH Chris
Re: Root context switching
On 04.09.2012 13:26, Dennie.nl wrote: Basic what I want is the same functionality which google apps provides. So I want to be able to have multiple versions of my application online, let people try the new environment and eventually switch the root context to the new running version. This enables my clients to try out the new version and options before they switch over to the new environment and enables me to fix bugs found in the new release. I don't know google apps. But for sure you can deploy many different wars on the same Tomcat instance. So you can have let's say host/app1, host/app2 URLs, or with virtual hosts: host1/app, host2/app, etc. With virtual hosts you can have multiple ROOT contexts as well. Does it answer your question? -- Mikolaj Rydzewski m...@ceti.pl - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Root context switching
Sounds to me like you are looking for the parallel deployment capabilities built into Tomcat 7. See: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html Jeff -Original Message- From: Dennie.nl [mailto:dennie...@gmail.com] Sent: Tuesday, September 04, 2012 6:26 AM To: Tomcat Users List Subject: Re: Root context switching Hello, If my idea was only as simple as renaming it to ROOT.war (this one I know of):) Basic what I want is the same functionality which google apps provides. So I want to be able to have multiple versions of my application online, let people try the new environment and eventually switch the root context to the new running version. This enables my clients to try out the new version and options before they switch over to the new environment and enables me to fix bugs found in the new release. I think I need a tunnelfilter or something for this, but maybe there's something available already. I've looked at parallel deployment, but this is mostly to serve the current users the version they are currently using. Cheers, Dennie 2012/9/4 chris derham ch...@derham.me.uk I am new to Tomcat. What I like to do is to deploy different versions of my application, for example: hostname\myappv1 hostname\myappv2 Now I want the ROOT context to be set dynamicly to one of the available deployed versions. Is this possible? Is there a way to implement this? Dennie, This question is asked regularly. The regularly posted answer is that you must call the root war ROOT.war, such that it is unpacked as CATALINA_HOME\webapps\ROOT. There may be ways around this, but it really is much, much simpler to do this in all cases I have seen discussed. Having said that, you say that you wish to change the ROOT dynamically. Why? What is your use case? If you explain, perhaps we might be able to describe a suitable alternative Chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Maven Plugin - Executable jar context loading and shutdown
On 4 September 2012 09:26, Olivier Lamy ol...@apache.org wrote: 2012/9/3 Sérgio Areias juger.on.n...@gmail.com: Hi. On 31 August 2012 21:24, Olivier Lamy ol...@apache.org wrote: 2012/8/27 Sérgio juger.on.n...@gmail.com: Hi. I am trying to use the Tomcat Maven Plugin to create an executable jar file with an embedded Tomcat7, but I am having two issues when trying to do so. The first one, is that I am not getting how I can stop my executable jar. I want to run it in from a script (like the shutdown.sh/bat from tomcat). I was not able to find any documentation about that particular issue. nope not supported. Can you give me some pointers of where I should look at if I decide to implement it? I could kill the process but that does not look a solution but a workaround instead. The second issue, is that when I run my executable jar it loads my webapp context twice (it tries because it will not be able to do it as I use a derby db, and it will give an error when trying to have the lock again). It creates a folder .extract, and the webapp works fine, but I do not want my context to be loaded twice. I am using the configurations I have found here http://tomcat.apache.org/maven-plugin-2/executable-war-jar.html . What am I missing here? Do you have a sample project as I cannot reproduce. What is the content of .extract/webapps Did you try java- jar pathtoyourjar -resetExtract (or cleanup .extract directory before) ? After taking a look to the plugin source code, I understood that I cannot use / as context, and that is why I was having the context loaded twice (ROOT and .war). Is it supported by the plugin to have a webapp running with no context when trying to have an executable jar? I ask this question because when I try to use ROOT (path/ROOT/path), I do not have the / context but /ROOT instead. (Also after studying the lines 264-272 from http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java?view=markup ) Did you simply try: path/path :-) I have tried now, and the context was set to the artifact id. I also took a look to the source code and I think that it is the expected behaviour (defaultValue = ${project.artifactId}). Well, after a few more tests I found new info about my problem. I was trying to use my server.xml file, when I remove it everything works fine (except one thing but I will address it later on this mail), even with / as context (does not seem valid following line 107 of the AbstractExecWarMojo class but it is working). When I try to use the server.xml it loads the context twice. Why that happens, I do not know yet. I really do not need my custom server.xml, but when I do not use it the configuration port50001/port in my pom.xml is not reflected when I try to run the jar. It runs always in the port 8080 without my server.xml. NOTE: I have attached my server.xml. Thanks for your attention and sorry for the taken time. Best regards, Sérgio Areias Info about the project: - Maven project; - pom.xml with packaging war using the build found here http://tomcat.apache.org/maven-plugin-2/executable-war-jar.html ; - Running in Ubuntu 11.04; - Using: groupIdorg.apache.tomcat.maven/groupId artifactIdtomcat7-maven-plugin/artifactId version2.0-beta-1/version Thanks in advance. Best regards, Sérgio Areias -- Olivier Lamy Talend: http://coders.talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Thanks for you reply and your attention. Best regards, Sérgio Areias -- Olivier Lamy Talend: http://coders.talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org ?xml version='1.0' encoding='utf-8'? !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
Re: Tomcat Maven Plugin - Executable jar context loading and shutdown
A bit weird. Can you have a look at this project which works fine with empty path https://github.com/olamy/tomcat-foo-artifact 2012/9/4 Sérgio Areias juger.on.n...@gmail.com: On 4 September 2012 09:26, Olivier Lamy ol...@apache.org wrote: 2012/9/3 Sérgio Areias juger.on.n...@gmail.com: Hi. On 31 August 2012 21:24, Olivier Lamy ol...@apache.org wrote: 2012/8/27 Sérgio juger.on.n...@gmail.com: Hi. I am trying to use the Tomcat Maven Plugin to create an executable jar file with an embedded Tomcat7, but I am having two issues when trying to do so. The first one, is that I am not getting how I can stop my executable jar. I want to run it in from a script (like the shutdown.sh/bat from tomcat). I was not able to find any documentation about that particular issue. nope not supported. Can you give me some pointers of where I should look at if I decide to implement it? I could kill the process but that does not look a solution but a workaround instead. The second issue, is that when I run my executable jar it loads my webapp context twice (it tries because it will not be able to do it as I use a derby db, and it will give an error when trying to have the lock again). It creates a folder .extract, and the webapp works fine, but I do not want my context to be loaded twice. I am using the configurations I have found here http://tomcat.apache.org/maven-plugin-2/executable-war-jar.html . What am I missing here? Do you have a sample project as I cannot reproduce. What is the content of .extract/webapps Did you try java- jar pathtoyourjar -resetExtract (or cleanup .extract directory before) ? After taking a look to the plugin source code, I understood that I cannot use / as context, and that is why I was having the context loaded twice (ROOT and .war). Is it supported by the plugin to have a webapp running with no context when trying to have an executable jar? I ask this question because when I try to use ROOT (path/ROOT/path), I do not have the / context but /ROOT instead. (Also after studying the lines 264-272 from http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java?view=markup ) Did you simply try: path/path :-) I have tried now, and the context was set to the artifact id. I also took a look to the source code and I think that it is the expected behaviour (defaultValue = ${project.artifactId}). Well, after a few more tests I found new info about my problem. I was trying to use my server.xml file, when I remove it everything works fine (except one thing but I will address it later on this mail), even with / as context (does not seem valid following line 107 of the AbstractExecWarMojo class but it is working). When I try to use the server.xml it loads the context twice. Why that happens, I do not know yet. I really do not need my custom server.xml, but when I do not use it the configuration port50001/port in my pom.xml is not reflected when I try to run the jar. It runs always in the port 8080 without my server.xml. NOTE: I have attached my server.xml. Thanks for your attention and sorry for the taken time. Best regards, Sérgio Areias Info about the project: - Maven project; - pom.xml with packaging war using the build found here http://tomcat.apache.org/maven-plugin-2/executable-war-jar.html ; - Running in Ubuntu 11.04; - Using: groupIdorg.apache.tomcat.maven/groupId artifactIdtomcat7-maven-plugin/artifactId version2.0-beta-1/version Thanks in advance. Best regards, Sérgio Areias -- Olivier Lamy Talend: http://coders.talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Thanks for you reply and your attention. Best regards, Sérgio Areias -- Olivier Lamy Talend: http://coders.talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - 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 -- Olivier Lamy Talend: http://coders.talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Login Delay
Well, drat. I swapped the application over to using a DataSourceRealm (instead of JDBCRealm) to support the JDBC connection that Tomcat's using for authentication, but it doesn't seem to have helped. Seems to have made it a bit worse. Originally when using a JDBCRealm, after some time of inactivity (no one logging in for 90 minutes or more) a cold login would always take about 20 seconds and then succeed. Subsequent warm logins were very fast. Now, with DataSourceRealm, a cold login (no other logins over the past 90 minutes or more) takes 20 seconds to FAIL. Subsequent login (same username/password) succeeds. David On 2012-08-31 08:50, David A. Rush wrote: Felix: Aha, you're suggesting a firewall issue, which I've been speculating on. Thanks for confirmation about the persistent connection that JDBCRealm tries to keep. I'll look into the DataSourceRealm. Thanks for the tip. David On 2012-08-31 03:16, Felix Schumacher wrote: Am 31.08.2012 04:01, schrieb David A. Rush: We've got two different machines (both Windows Server something) running Tomcat 7.0.22, and each running a webapp that uses user authentication. We're using a couple of different schemes (LDAP and database using JDBCRealm with hashed pwords, just database with hashed pwords). When no one has logged in for a while (90 minutes seems to do the trick), the next login takes almost exactly 40 seconds on one host and almost exactly 20 seconds on the other one. You might want to check for a firewall between tomcat and your database. It could drop packets of a database session after a certain period of inactivity. JDBCRealm keeps its (one and only) connection open and closes it only in case of an exception (which might be a timeout). You should really consider using DataSourceRealm (http://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#DataSourceRealm) instead. It will close connections (give it back to a pool) after usage and can be configured to check the connection before it is used for authentication/authorization. Hitting a page in one of the webapps that hits the database for application data, without requiring login, works fast even if it's been idle for hours. But then try to login and I get a 40 second delay after whacking the Log in button on the login form. Looking at it in more detail, the host and app with a 40-second delay has two JDBCRealms configured, both inside of a combined realm. You haven't told us, how you configured your application database connections, so we can only guess. If you are using standard tomcat connection pooling, you can transfer that configuration to a pool, that can be used by the mentioned DataSourceRealm. Regards Felix Are we seeing a 20-second delay in getting authentication via JDBCRealm? Suggestions on troubleshooting this? David - 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
tomcat 6 virtual hosting vs apache virtual hosting
Hi, I've started a new job where the last sysadmin has the virtual hosting configured in Tomcat (and Apache). I'm used to only doing virtual hosting with Apache. What are the pros and cons of each method? I'm trying to understand why that would be needed. Thanks, Charles
Re: Login Delay
Am 04.09.2012 19:13, schrieb David A. Rush: Well, drat. I swapped the application over to using a DataSourceRealm (instead of JDBCRealm) to support the JDBC connection that Tomcat's using for authentication, but it doesn't seem to have helped. Seems to have made it a bit worse. Originally when using a JDBCRealm, after some time of inactivity (no one logging in for 90 minutes or more) a cold login would always take about 20 seconds and then succeed. Subsequent warm logins were very fast. Now, with DataSourceRealm, a cold login (no other logins over the past 90 minutes or more) takes 20 seconds to FAIL. Subsequent login (same username/password) succeeds. Actually it is a good thing, that you can produce it that fast :) Now you can * do stack traces in that 20 seconds interval (http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F) * enable logging for the realms and you could give more information about your setup. Tomcat version, DataSource and Realm setup (without passwords). Regards Felix David On 2012-08-31 08:50, David A. Rush wrote: Felix: Aha, you're suggesting a firewall issue, which I've been speculating on. Thanks for confirmation about the persistent connection that JDBCRealm tries to keep. I'll look into the DataSourceRealm. Thanks for the tip. David On 2012-08-31 03:16, Felix Schumacher wrote: Am 31.08.2012 04:01, schrieb David A. Rush: We've got two different machines (both Windows Server something) running Tomcat 7.0.22, and each running a webapp that uses user authentication. We're using a couple of different schemes (LDAP and database using JDBCRealm with hashed pwords, just database with hashed pwords). When no one has logged in for a while (90 minutes seems to do the trick), the next login takes almost exactly 40 seconds on one host and almost exactly 20 seconds on the other one. You might want to check for a firewall between tomcat and your database. It could drop packets of a database session after a certain period of inactivity. JDBCRealm keeps its (one and only) connection open and closes it only in case of an exception (which might be a timeout). You should really consider using DataSourceRealm (http://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#DataSourceRealm) instead. It will close connections (give it back to a pool) after usage and can be configured to check the connection before it is used for authentication/authorization. Hitting a page in one of the webapps that hits the database for application data, without requiring login, works fast even if it's been idle for hours. But then try to login and I get a 40 second delay after whacking the Log in button on the login form. Looking at it in more detail, the host and app with a 40-second delay has two JDBCRealms configured, both inside of a combined realm. You haven't told us, how you configured your application database connections, so we can only guess. If you are using standard tomcat connection pooling, you can transfer that configuration to a pool, that can be used by the mentioned DataSourceRealm. Regards Felix Are we seeing a 20-second delay in getting authentication via JDBCRealm? Suggestions on troubleshooting this? David - 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: Login Delay
Felix: Well, it still takes over an hour of cold time (no logins) before I can reproduce the problem. More info in logging.2012-09.04.log I found: Sep 4, 2012 12:03:57 PM org.apache.catalina.realm.DataSourceRealm getPassword SEVERE: Exception retrieving password for david Sep 4, 2012 12:03:57 PM org.apache.catalina.realm.DataSourceRealm close SEVERE: Exception closing database connection java.sql.SQLException: Already closed. at org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(PoolableConnection.java:114) Looks like this exception may be causing the authentication process to fail, even when the username and password are good. I'll see if I can get a thread dump David On 2012-09-04 14:25, Felix Schumacher wrote: Am 04.09.2012 19:13, schrieb David A. Rush: Well, drat. I swapped the application over to using a DataSourceRealm (instead of JDBCRealm) to support the JDBC connection that Tomcat's using for authentication, but it doesn't seem to have helped. Seems to have made it a bit worse. Originally when using a JDBCRealm, after some time of inactivity (no one logging in for 90 minutes or more) a cold login would always take about 20 seconds and then succeed. Subsequent warm logins were very fast. Now, with DataSourceRealm, a cold login (no other logins over the past 90 minutes or more) takes 20 seconds to FAIL. Subsequent login (same username/password) succeeds. Actually it is a good thing, that you can produce it that fast :) Now you can * do stack traces in that 20 seconds interval (http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F) * enable logging for the realms and you could give more information about your setup. Tomcat version, DataSource and Realm setup (without passwords). Regards Felix David On 2012-08-31 08:50, David A. Rush wrote: Felix: Aha, you're suggesting a firewall issue, which I've been speculating on. Thanks for confirmation about the persistent connection that JDBCRealm tries to keep. I'll look into the DataSourceRealm. Thanks for the tip. David On 2012-08-31 03:16, Felix Schumacher wrote: Am 31.08.2012 04:01, schrieb David A. Rush: We've got two different machines (both Windows Server something) running Tomcat 7.0.22, and each running a webapp that uses user authentication. We're using a couple of different schemes (LDAP and database using JDBCRealm with hashed pwords, just database with hashed pwords). When no one has logged in for a while (90 minutes seems to do the trick), the next login takes almost exactly 40 seconds on one host and almost exactly 20 seconds on the other one. You might want to check for a firewall between tomcat and your database. It could drop packets of a database session after a certain period of inactivity. JDBCRealm keeps its (one and only) connection open and closes it only in case of an exception (which might be a timeout). You should really consider using DataSourceRealm (http://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#DataSourceRealm) instead. It will close connections (give it back to a pool) after usage and can be configured to check the connection before it is used for authentication/authorization. Hitting a page in one of the webapps that hits the database for application data, without requiring login, works fast even if it's been idle for hours. But then try to login and I get a 40 second delay after whacking the Log in button on the login form. Looking at it in more detail, the host and app with a 40-second delay has two JDBCRealms configured, both inside of a combined realm. You haven't told us, how you configured your application database connections, so we can only guess. If you are using standard tomcat connection pooling, you can transfer that configuration to a pool, that can be used by the mentioned DataSourceRealm. Regards Felix Are we seeing a 20-second delay in getting authentication via JDBCRealm? Suggestions on troubleshooting this? David - 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: Login Delay
Am 04.09.2012 20:30, schrieb David A. Rush: Felix: Well, it still takes over an hour of cold time (no logins) before I can reproduce the problem. Ok, I misread it. More info in logging.2012-09.04.log I found: Sep 4, 2012 12:03:57 PM org.apache.catalina.realm.DataSourceRealm getPassword SEVERE: Exception retrieving password for david Sep 4, 2012 12:03:57 PM org.apache.catalina.realm.DataSourceRealm close SEVERE: Exception closing database connection java.sql.SQLException: Already closed. at org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(PoolableConnection.java:114) Looks like this exception may be causing the authentication process to fail, even when the username and password are good. You still haven't shown us your configuration. You could try to setup the datasource close all connections. Felix I'll see if I can get a thread dump David On 2012-09-04 14:25, Felix Schumacher wrote: Am 04.09.2012 19:13, schrieb David A. Rush: Well, drat. I swapped the application over to using a DataSourceRealm (instead of JDBCRealm) to support the JDBC connection that Tomcat's using for authentication, but it doesn't seem to have helped. Seems to have made it a bit worse. Originally when using a JDBCRealm, after some time of inactivity (no one logging in for 90 minutes or more) a cold login would always take about 20 seconds and then succeed. Subsequent warm logins were very fast. Now, with DataSourceRealm, a cold login (no other logins over the past 90 minutes or more) takes 20 seconds to FAIL. Subsequent login (same username/password) succeeds. Actually it is a good thing, that you can produce it that fast :) Now you can * do stack traces in that 20 seconds interval (http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F) * enable logging for the realms and you could give more information about your setup. Tomcat version, DataSource and Realm setup (without passwords). Regards Felix David On 2012-08-31 08:50, David A. Rush wrote: Felix: Aha, you're suggesting a firewall issue, which I've been speculating on. Thanks for confirmation about the persistent connection that JDBCRealm tries to keep. I'll look into the DataSourceRealm. Thanks for the tip. David On 2012-08-31 03:16, Felix Schumacher wrote: Am 31.08.2012 04:01, schrieb David A. Rush: We've got two different machines (both Windows Server something) running Tomcat 7.0.22, and each running a webapp that uses user authentication. We're using a couple of different schemes (LDAP and database using JDBCRealm with hashed pwords, just database with hashed pwords). When no one has logged in for a while (90 minutes seems to do the trick), the next login takes almost exactly 40 seconds on one host and almost exactly 20 seconds on the other one. You might want to check for a firewall between tomcat and your database. It could drop packets of a database session after a certain period of inactivity. JDBCRealm keeps its (one and only) connection open and closes it only in case of an exception (which might be a timeout). You should really consider using DataSourceRealm (http://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#DataSourceRealm) instead. It will close connections (give it back to a pool) after usage and can be configured to check the connection before it is used for authentication/authorization. Hitting a page in one of the webapps that hits the database for application data, without requiring login, works fast even if it's been idle for hours. But then try to login and I get a 40 second delay after whacking the Log in button on the login form. Looking at it in more detail, the host and app with a 40-second delay has two JDBCRealms configured, both inside of a combined realm. You haven't told us, how you configured your application database connections, so we can only guess. If you are using standard tomcat connection pooling, you can transfer that configuration to a pool, that can be used by the mentioned DataSourceRealm. Regards Felix Are we seeing a 20-second delay in getting authentication via JDBCRealm? Suggestions on troubleshooting this? David - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat HeapMemoryUsage MBean question
Greetings, I would like to graph Tomcat's HeapMemoryUsage - used mbean value for trending. I have installed Tomcat's manager application with a user belonging only to the manager-jmx role. I would like to use curl to get the data. I have a couple of questions: (1) I don't seem to be able to assign an empty password or otherwise no password to a user in tomcat-users.xml. Or could I? (2) How do I get just the used value from the composite HeapMemoryUsage mbean? I guess I could subsequently search for pattern used=. But just curious if I could get the value directly. None of the following queries worked: https://localhost:8453/manager/jmxproxy?qry=java.lang:type=Memory/HeapMemoryUsage https://localhost:8453/manager/jmxproxy?qry=java.lang:type=Memory/HeapMemoryUsage:used https://localhost:8453/manager/jmxproxy?qry=java.lang:type=Memory/HeapMemoryUsage.used Thanks! -Shanti
Re: Tomcat Maven Plugin - Executable jar context loading and shutdown
I have downloaded the project and tested it. Replicated a bit of the structure on my project and seems that now I am able to do it with the empty value on path. Why I can do it with the / anyway? Even with your project, I was not able to change the running port defining it in the pom.xml. Only when I use -httpPort 9090, for example, I am able to do it. The port tag needs some extra configuration, or its purpose it is not to define the running port, and being so I am using it in the wrong way. About the shutdown feature (my jar is running as a service so I cannot just hit Ctrl+C to stop it), can you give me some pointers of where I should begin if I want to do it (any class for that purpose, etc.)? Thanks for the quick answer Olivier Lamy, and thanks for your attention. I am really enjoying this learning process :) Best regards, Sérgio Areias On 4 September 2012 16:43, Olivier Lamy ol...@apache.org wrote: A bit weird. Can you have a look at this project which works fine with empty path https://github.com/olamy/tomcat-foo-artifact 2012/9/4 Sérgio Areias juger.on.n...@gmail.com: On 4 September 2012 09:26, Olivier Lamy ol...@apache.org wrote: 2012/9/3 Sérgio Areias juger.on.n...@gmail.com: Hi. On 31 August 2012 21:24, Olivier Lamy ol...@apache.org wrote: 2012/8/27 Sérgio juger.on.n...@gmail.com: Hi. I am trying to use the Tomcat Maven Plugin to create an executable jar file with an embedded Tomcat7, but I am having two issues when trying to do so. The first one, is that I am not getting how I can stop my executable jar. I want to run it in from a script (like the shutdown.sh/bat from tomcat). I was not able to find any documentation about that particular issue. nope not supported. Can you give me some pointers of where I should look at if I decide to implement it? I could kill the process but that does not look a solution but a workaround instead. The second issue, is that when I run my executable jar it loads my webapp context twice (it tries because it will not be able to do it as I use a derby db, and it will give an error when trying to have the lock again). It creates a folder .extract, and the webapp works fine, but I do not want my context to be loaded twice. I am using the configurations I have found here http://tomcat.apache.org/maven-plugin-2/executable-war-jar.html . What am I missing here? Do you have a sample project as I cannot reproduce. What is the content of .extract/webapps Did you try java- jar pathtoyourjar -resetExtract (or cleanup .extract directory before) ? After taking a look to the plugin source code, I understood that I cannot use / as context, and that is why I was having the context loaded twice (ROOT and .war). Is it supported by the plugin to have a webapp running with no context when trying to have an executable jar? I ask this question because when I try to use ROOT (path/ROOT/path), I do not have the / context but /ROOT instead. (Also after studying the lines 264-272 from http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractExecWarMojo.java?view=markup ) Did you simply try: path/path :-) I have tried now, and the context was set to the artifact id. I also took a look to the source code and I think that it is the expected behaviour (defaultValue = ${project.artifactId}). Well, after a few more tests I found new info about my problem. I was trying to use my server.xml file, when I remove it everything works fine (except one thing but I will address it later on this mail), even with / as context (does not seem valid following line 107 of the AbstractExecWarMojo class but it is working). When I try to use the server.xml it loads the context twice. Why that happens, I do not know yet. I really do not need my custom server.xml, but when I do not use it the configuration port50001/port in my pom.xml is not reflected when I try to run the jar. It runs always in the port 8080 without my server.xml. NOTE: I have attached my server.xml. Thanks for your attention and sorry for the taken time. Best regards, Sérgio Areias Info about the project: - Maven project; - pom.xml with packaging war using the build found here http://tomcat.apache.org/maven-plugin-2/executable-war-jar.html ; - Running in Ubuntu 11.04; - Using: groupIdorg.apache.tomcat.maven/groupId artifactIdtomcat7-maven-plugin/artifactId version2.0-beta-1/version Thanks in advance. Best regards, Sérgio Areias -- Olivier Lamy Talend: http://coders.talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail:
Re: Login Delay
Felix: Windows seems to be conspiring against my efforts to get a thread dump. For configuration, in my webapp's context config file: Under Context: Resource name=jdbc/myoracle auth=Container type=javax.sql.DataSource description=Connection to the database driverClassName=oracle.jdbc.OracleDriver url=[DB_URL] username=[DB_USERNAME] password=[DB_PASS] maxActive=20 maxIdle=10 maxWait=-1 / Under a CombinedRealm (that's under Context): Realm className=org.apache.catalina.realm.DataSourceRealm dataSourceName=jdbc/myoracle localDataSource=true digest=SHA-384 digestEncoding=UTF-8 userTable=[USERS_TABLE] userNameCol=USER_NAME userCredCol=PASSWORD_HASHED userRoleTable=[USERS_ROLES_TABLE] roleNameCol=ROLE_NAME / When doing a deployment, I have an ant task that replaces the [THINGS_IN_BRACKETS] with real values. We're using a CombinedRealm for historical reasons, but there's no other Realm inside it that isn't commented out. David On 2012-09-04 15:12, Felix Schumacher wrote: Am 04.09.2012 20:30, schrieb David A. Rush: Felix: Well, it still takes over an hour of cold time (no logins) before I can reproduce the problem. Ok, I misread it. More info in logging.2012-09.04.log I found: Sep 4, 2012 12:03:57 PM org.apache.catalina.realm.DataSourceRealm getPassword SEVERE: Exception retrieving password for david Sep 4, 2012 12:03:57 PM org.apache.catalina.realm.DataSourceRealm close SEVERE: Exception closing database connection java.sql.SQLException: Already closed. at org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(PoolableConnection.java:114) Looks like this exception may be causing the authentication process to fail, even when the username and password are good. You still haven't shown us your configuration. You could try to setup the datasource close all connections. Felix I'll see if I can get a thread dump David On 2012-09-04 14:25, Felix Schumacher wrote: Am 04.09.2012 19:13, schrieb David A. Rush: Well, drat. I swapped the application over to using a DataSourceRealm (instead of JDBCRealm) to support the JDBC connection that Tomcat's using for authentication, but it doesn't seem to have helped. Seems to have made it a bit worse. Originally when using a JDBCRealm, after some time of inactivity (no one logging in for 90 minutes or more) a cold login would always take about 20 seconds and then succeed. Subsequent warm logins were very fast. Now, with DataSourceRealm, a cold login (no other logins over the past 90 minutes or more) takes 20 seconds to FAIL. Subsequent login (same username/password) succeeds. Actually it is a good thing, that you can produce it that fast :) Now you can * do stack traces in that 20 seconds interval (http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F) * enable logging for the realms and you could give more information about your setup. Tomcat version, DataSource and Realm setup (without passwords). Regards Felix David On 2012-08-31 08:50, David A. Rush wrote: Felix: Aha, you're suggesting a firewall issue, which I've been speculating on. Thanks for confirmation about the persistent connection that JDBCRealm tries to keep. I'll look into the DataSourceRealm. Thanks for the tip. David On 2012-08-31 03:16, Felix Schumacher wrote: Am 31.08.2012 04:01, schrieb David A. Rush: We've got two different machines (both Windows Server something) running Tomcat 7.0.22, and each running a webapp that uses user authentication. We're using a couple of different schemes (LDAP and database using JDBCRealm with hashed pwords, just database with hashed pwords). When no one has logged in for a while (90 minutes seems to do the trick), the next login takes almost exactly 40 seconds on one host and almost exactly 20 seconds on the other one. You might want to check for a firewall between tomcat and your database. It could drop packets of a database session after a certain period of inactivity. JDBCRealm keeps its (one and only) connection open and closes it only in case of an exception (which might be a timeout). You should really consider using DataSourceRealm (http://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#DataSourceRealm) instead. It will close connections (give it back to a pool) after usage and can be configured to check the connection before it is used for authentication/authorization. Hitting a page in one of the webapps that hits the database for application data, without requiring login, works fast even if it's been idle for hours. But then try to login and I get a 40 second delay after whacking the Log in button on the login form. Looking at it in more detail, the host and app with a 40-second delay has two JDBCRealms configured, both inside of a combined realm. You haven't told us,
Re: tomcat 6 virtual hosting vs apache virtual hosting
Charles Richard wrote: Hi, I've started a new job where the last sysadmin has the virtual hosting configured in Tomcat (and Apache). I'm used to only doing virtual hosting with Apache. What are the pros and cons of each method? I'm trying to understand why that would be needed. To answer about your case in particular is very difficult, as we do not know anything about the applications which you are running under Tomcat. We also don't know if your Apache is a front-end for your Tomcat, or if both receive requests independently from eachother. The prudent thing to do would be to assume that the previous guy probably knew what he was doing, and that there is a reason for such a setup. If Apache is a front-end for Tomcat, and requests for one Apache virtual host are being forwarded to a corresponding virtual host under Tomcat, it could be because : - there are several virtual hosts under Tomcat, and the applications which run under each virtual host are somehow different - and/or the Tomcat application needs to know via which virtual host it was accessed, maybe to react differently in each case (may be linked to user authentication e.g.) The only con I can think of, at the Tomcat level, is additional configuration complexity, if the virtual hosts are not really necessary at the Tomcat level. It will not have any significant impact on performance (other than using perhaps additional memory). On the other hand, if each virtual host corresponds to a separate group of users, then a pro would be that having several Hosts would allow you to stop/start/update their applications independently of eachother (even if they are basically the same apps). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Login Delay
do you think that maxwait should be tuned? and you can also monitor live session in oracle by query db,what does it tell you (both before 20s and after 20s)? and by using oracle 11g driver(use ojdbcXX_g.jar with log enabled), you can turn on logging for driver and have a look when does the request of opening connection and closing connection happened ? is that opening and closing after 20s ? or right after hit of login button ? if right after hitting button,then the problem might be configuration of pool and db session handling,if after 20s,then put Thread.getcurrentthread.printstack (something like this) in code befor code hitting db,so that you know what is the code doing at that time. here is the link for how to turn on logging fo ojdbc http://docs.oracle.com/cd/B28359_01/java.111/b31224/diagnose.htm#CIAIDFIC On Wed, Sep 5, 2012 at 8:03 AM, David A. Rush da...@rushtone.com wrote: Felix: Windows seems to be conspiring against my efforts to get a thread dump. For configuration, in my webapp's context config file: Under Context: Resource name=jdbc/myoracle auth=Container type=javax.sql.DataSource description=Connection to the database driverClassName=oracle.jdbc.**OracleDriver url=[DB_URL] username=[DB_USERNAME] password=[DB_PASS] maxActive=20 maxIdle=10 maxWait=-1 / Under a CombinedRealm (that's under Context): Realm className=org.apache.**catalina.realm.**DataSourceRealm dataSourceName=jdbc/myoracle localDataSource=true digest=SHA-384 digestEncoding=UTF-8 userTable=[USERS_TABLE] userNameCol=USER_NAME userCredCol=PASSWORD_HASHED userRoleTable=[USERS_ROLES_**TABLE] roleNameCol=ROLE_NAME / When doing a deployment, I have an ant task that replaces the [THINGS_IN_BRACKETS] with real values. We're using a CombinedRealm for historical reasons, but there's no other Realm inside it that isn't commented out. David On 2012-09-04 15:12, Felix Schumacher wrote: Am 04.09.2012 20:30, schrieb David A. Rush: Felix: Well, it still takes over an hour of cold time (no logins) before I can reproduce the problem. Ok, I misread it. More info in logging.2012-09.04.log I found: Sep 4, 2012 12:03:57 PM org.apache.catalina.realm.**DataSourceRealm getPassword SEVERE: Exception retrieving password for david Sep 4, 2012 12:03:57 PM org.apache.catalina.realm.**DataSourceRealm close SEVERE: Exception closing database connection java.sql.SQLException: Already closed. at org.apache.tomcat.dbcp.dbcp.**PoolableConnection.close(** PoolableConnection.java:114) Looks like this exception may be causing the authentication process to fail, even when the username and password are good. You still haven't shown us your configuration. You could try to setup the datasource close all connections. Felix I'll see if I can get a thread dump David On 2012-09-04 14:25, Felix Schumacher wrote: Am 04.09.2012 19:13, schrieb David A. Rush: Well, drat. I swapped the application over to using a DataSourceRealm (instead of JDBCRealm) to support the JDBC connection that Tomcat's using for authentication, but it doesn't seem to have helped. Seems to have made it a bit worse. Originally when using a JDBCRealm, after some time of inactivity (no one logging in for 90 minutes or more) a cold login would always take about 20 seconds and then succeed. Subsequent warm logins were very fast. Now, with DataSourceRealm, a cold login (no other logins over the past 90 minutes or more) takes 20 seconds to FAIL. Subsequent login (same username/password) succeeds. Actually it is a good thing, that you can produce it that fast :) Now you can * do stack traces in that 20 seconds interval (http://wiki.apache.org/ **tomcat/HowTo#How_do_I_obtain_**a_thread_dump_of_my_running_** webapp_.3Fhttp://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F ) * enable logging for the realms and you could give more information about your setup. Tomcat version, DataSource and Realm setup (without passwords). Regards Felix David On 2012-08-31 08:50, David A. Rush wrote: Felix: Aha, you're suggesting a firewall issue, which I've been speculating on. Thanks for confirmation about the persistent connection that JDBCRealm tries to keep. I'll look into the DataSourceRealm. Thanks for the tip. David On 2012-08-31 03:16, Felix Schumacher wrote: Am 31.08.2012 04:01, schrieb David A. Rush: We've got two different machines (both Windows Server something) running Tomcat 7.0.22, and each running a webapp that uses user authentication. We're using a couple of different schemes (LDAP and database using JDBCRealm with hashed pwords, just database with hashed pwords). When no one has logged in for a while (90 minutes seems to do the trick), the next login takes
Re: Starting tomcat with catalina.sh run -security
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ragini, On 8/31/12 6:44 AM, Ragini wrote: I have added following things to setenv.sh to make tomacat profile. #!/bin/sh export CATALINA_OPTS=-Djava.security.auth.login.config=$(TOMCAT_HOME)/conf/jaas.config export CATALINA_OPTS=-javaagent:lib/jborat-agent.jar \ [...] You have clobbered your CATALINA_OPTS variable by setting it twice and not including $CATALINA_OPTS in the second value. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlBGtvAACgkQ9CaO5/Lv0PCnqgCeNTF9Zqz9EIi+OElwt7MDHwTg X0IAoKLGh271caI2+vbfottOk6Conw53 =hm8l -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org