Configuring Comet application
I am using Tomcat7 on Linux and was wondering, is there any way to increase the number of comet threads? Is there a max number of CometEvents that can be queued? I have a feeling either certain connections are not logging themselves, or they are being dropped due to an overload caused by my stress tester. The stress tester launches 20 threads that all connect to an initial servlet i use for logging in, and then to the comet servlet. The login servlet is logging about 19-20 connections consistently, though Im not sure why one is missing on occasion.
Re: Configuring Comet application
Hey, I actually answered my own question. Turns out config was not on comet page but on connectors page for NIO connectors. I do have another problem though. Stress tester connects and works fine when I lower number of connections from 20 to 10, however, when the program exits and everything disconnects, tomcat either crashes or hangs with no exception or error being printed in the log. Im pretty sure its tomcat and not just the web app because tomcat manager is inaccessible as well. Any suggestions on trouble shooting this? On Tue, Sep 16, 2014 at 8:59 AM, Elias Kopsiaftis yemi...@gmail.com wrote: I am using Tomcat7 on Linux and was wondering, is there any way to increase the number of comet threads? Is there a max number of CometEvents that can be queued? I have a feeling either certain connections are not logging themselves, or they are being dropped due to an overload caused by my stress tester. The stress tester launches 20 threads that all connect to an initial servlet i use for logging in, and then to the comet servlet. The login servlet is logging about 19-20 connections consistently, though Im not sure why one is missing on occasion.
Re: Configuring Comet application
I managed to solve the problem, nothing to do with Tomcat actually. Turns out that I didnt configure c3p0 right so the application was being starved for db resources, causing it to look like it was hanging or crashing. Thats why there was no error in the tomcat logs, nothing went wrong with Tomcat On Tue, Sep 16, 2014 at 12:05 PM, Elias Kopsiaftis yemi...@gmail.com wrote: Hey, I actually answered my own question. Turns out config was not on comet page but on connectors page for NIO connectors. I do have another problem though. Stress tester connects and works fine when I lower number of connections from 20 to 10, however, when the program exits and everything disconnects, tomcat either crashes or hangs with no exception or error being printed in the log. Im pretty sure its tomcat and not just the web app because tomcat manager is inaccessible as well. Any suggestions on trouble shooting this? On Tue, Sep 16, 2014 at 8:59 AM, Elias Kopsiaftis yemi...@gmail.com wrote: I am using Tomcat7 on Linux and was wondering, is there any way to increase the number of comet threads? Is there a max number of CometEvents that can be queued? I have a feeling either certain connections are not logging themselves, or they are being dropped due to an overload caused by my stress tester. The stress tester launches 20 threads that all connect to an initial servlet i use for logging in, and then to the comet servlet. The login servlet is logging about 19-20 connections consistently, though Im not sure why one is missing on occasion.
Re: Configuring Comet application
Well to be honest I didnt know any better :-) A friend of mine who is a better developer than I am recommended it. I have no real reason. On Tue, Sep 16, 2014 at 6:18 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Elias, On 9/16/14 4:55 PM, Elias Kopsiaftis wrote: I managed to solve the problem, nothing to do with Tomcat actually. Turns out that I didnt configure c3p0 right so the application was being starved for db resources, causing it to look like it was hanging or crashing. Thats why there was no error in the tomcat logs, nothing went wrong with Tomcat I'm interested in why you are using c3p0. I often ask people who they are using it and they say because commons-dbcp is crap but a) they have been looking at decade-old complaints of DBCP and b) c3p0 doesn't have any production-quality released, yet. So I'm wondering why you are using c3p0 instead of either Tomcat's default DBCP or tomcat-pool which should be higher-performance if you feel like you need that. - -chris On Tue, Sep 16, 2014 at 12:05 PM, Elias Kopsiaftis yemi...@gmail.com wrote: Hey, I actually answered my own question. Turns out config was not on comet page but on connectors page for NIO connectors. I do have another problem though. Stress tester connects and works fine when I lower number of connections from 20 to 10, however, when the program exits and everything disconnects, tomcat either crashes or hangs with no exception or error being printed in the log. Im pretty sure its tomcat and not just the web app because tomcat manager is inaccessible as well. Any suggestions on trouble shooting this? On Tue, Sep 16, 2014 at 8:59 AM, Elias Kopsiaftis yemi...@gmail.com wrote: I am using Tomcat7 on Linux and was wondering, is there any way to increase the number of comet threads? Is there a max number of CometEvents that can be queued? I have a feeling either certain connections are not logging themselves, or they are being dropped due to an overload caused by my stress tester. The stress tester launches 20 threads that all connect to an initial servlet i use for logging in, and then to the comet servlet. The login servlet is logging about 19-20 connections consistently, though Im not sure why one is missing on occasion. -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJUGLdCAAoJEBzwKT+lPKRY1IIP/RHhfuszrF3wmzltiSjY6KYP afxXJTAoCFXLB66lQABdFp/1wCEroUZuQBhJ19TnAIzOvCjNhtoSSGGDnC6ExqnL Ubt4PQrwu/8Ghzzf12qlnW175l/gFJMKR7WogjDOw9kkwWue/S2zhxmIAryhUYzC +p72cGzHqyL3PVMiNRlycqfQzDMaTNnvOOMrU4GkpSefurySCQcwevCyTNtZcqpa P5fXibdfHdCAl92fMMoOl6Dqk2sbbmRRd77mV8wL82Hox4dzaGSAkKeBjaRDw0y4 Ngk9BRpwcMw5QedKnHCX4f3QEUS323rDj/mOysyaai00nA3IlW8H3XcXPP/1DOfM /bMwXUC3D7ZwvTz+1/XbOreLMcVIJmh17z2fMk8KHgRjAE9eFIC/QhIV+cHDGi7l gU7NezjP7p3yamMi2XCRiw2By4aCIjWnMnBfjoz5D8nmISpl1u/DE+Ez/HKE7qtN SfyQdSVZeeLOXgQLywLjd4xot5J6vO1miIlFP5nDCtIjHMNbebNbdtpbn8dY6lw0 0kWEaHEfih4BZLVmCjjrxI6AYfAK1H0YAH4Hornd32+8+J7iEeKmdMzwFKrL9VCu 9uYUyiyy0AGd9DIbEfir2qOF/ZrXwyXtYlsSFkEDMLcN1rQUpGgA/RmBHj/+GvVL Kc0NwvOs99aFZtVMDGzk =esd6 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: stress testing tomcat applications
Konstantin, I apologize for my lack of information, but for an inexperienced user this can be difficult, Tomcat version and OS are easy enough, but configuration bits can be difficult, especially since a configuration can exist that is causing your problem, that you dont even know it exists. Anyways, I believe my stress tester is working fine. I think the real problem I faced was since multiple threads are sharing the same resource(System.out), they are not all getting to print to it and some essages are getting lost. Also, I am not using an authenticator, or even a web page, I wrote a java application to connect to the tomcat server. As for the original problem, sessions were not getting lost, it was a concurrency issue within my stress tester. Thank you all for your responses On Fri, Sep 12, 2014 at 10:15 AM, Konstantin Kolinko knst.koli...@gmail.com wrote: 2014-09-11 17:07 GMT+04:00 Elias Kopsiaftis yemi...@gmail.com: ok Thanks, I am using Tomcat7. I dont know much about Tomcat application development, so I will research these options you gave me before responding again. Thanks again As written here: http://tomcat.apache.org/lists.html#tomcat-users Important: 1. When asking questions on the list, please state your exact Tomcat version (which is three numbers, 7.0.x or 6.0.x), your operating system, and essential bits of your configuration. (...) 6. When replying, please write your text below the quoted one. Sessionid is usually changed when authentication succeeds. For FORM authentication and up-to-date Tomcat 7 the change happens twice (once login form is displayed and once authentication succeeds). At that time the old sessionid becomes invalid. The session may also expire or be explicitly invalidated (e.g. during logout). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: stress testing tomcat applications
Thanks! I will look into JMEter On Fri, Sep 12, 2014 at 10:55 AM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Elias, On 9/12/14 10:24 AM, Elias Kopsiaftis wrote: I apologize for my lack of information, but for an inexperienced user this can be difficult, Tomcat version and OS are easy enough, but configuration bits can be difficult, especially since a configuration can exist that is causing your problem, that you dont even know it exists. Anyways, I believe my stress tester is working fine. I think the real problem I faced was since multiple threads are sharing the same resource(System.out), they are not all getting to print to it and some essages are getting lost. Unlikely: these streams are threadsafe, so you shouldn't be losing anything. You may have un-flushed data, though, but that should all be flushed if the process exits. Also, I am not using an authenticator, or even a web page, I wrote a java application to connect to the tomcat server. As for the original problem, sessions were not getting lost, it was a concurrency issue within my stress tester. Sounds likely. You may want to consider using JMeter. It's already got pretty much everything you need, and it works properly. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJUEwl0AAoJEBzwKT+lPKRYzeQQALIpa26Cc1/6QWUtDf3fQiVQ h/+yR0qn2zwoG9PhEQP2aGuwJ7E+6CYEuOphpH4Almkrvm4VIjcPNgLYQjLF8iD4 eXFI87REuUsjTchW+eHl80dMPzppIwCXXtbG+A82mxM/Fz8DVFs/ZC/2uXi1Akri sqkS4x9VAuU2gJOpS8tlgEJq/+1o+zPrRVVqYiNdrH4I1QBz2wKu9UIssro3idcd lEpptUydIXINgl4dmSloINA37l3XZcuwWuQ6RF29P3BewYoioyiP1/5UyHZnaGg5 Dm2at7fmKG9XNFsDbLY5FVTpklEw8G1E2iOMzwNUoEja/Km/zpPJ+2vGbp0v27X1 yfUUCoeqLftYKzZ+/XuTlmQ1sBEkM6JqIZqgZ+FSC3DnEyJJp9wEJnPjiHltIPEw IhaZmh84DXGzez4Icikr1neoPpXNfOcJucVPXTUmoA++Ceg4TB3QOPJYqbhowVVM Xe7vfT22gXu0sD8ZzPJY2ayzCaFVDY1bA7DGrQNQQ7GStPk7lc3If56q+ilQUyQv vC96/uDAQDdIS2zFZNlou9gNJ1wJ6bNOOpHVFN0mnEvXeoa3ZwrekdIkrhRQtLFm BSybbo9LH5Q1VTb7piDxZ/gw60LnPTb+uVyGGWeuefnPfU13SPA7rC1ppzf6Byvg IWIac1nuUTXI8B5p08tC =zaZe -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: stress testing tomcat applications
ok Thanks, I am using Tomcat7. I dont know much about Tomcat application development, so I will research these options you gave me before responding again. Thanks again On Thu, Sep 11, 2014 at 4:07 AM, Ognjen Blagojevic ognjen.d.blagoje...@gmail.com wrote: Elias, On 11.9.2014 2:03, Elias Kopsiaftis wrote: My best guess is that tomcat doesnt like to accept requests coming for two different logins from the same IP and same program. Is that accurate? Is anything else that could be going wrong here? Tomcat should allow multiple sessions from same IP without problems. Please state which exact version of Tomcat do you use. There are plenty of them. What is the number of active sessions when you start experiencing errors? Do you have Manager element in your context.xml or server.xml defined? Does that element have maxActiveSessions attribute? I recommend to implement HttpSessionListener in your application and log session creation and destruction to understand at which point in time the sessions are destroyed. -Ognjen - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
stress testing tomcat applications
Hi, I am working on a stress tester for my application, however, from within the stress tester, sometimes it loses the sessionid An overview of the process is 1. login to application and get sessionid 2. send subsequent requests to server that sessionid 3. Repeat steps 1 and 2 for multiple users The problem is that in my server logs, I occasionally get a message saying a client connected with an unrecognized sessionid, ie one that has no logged in yet My best guess is that tomcat doesnt like to accept requests coming for two different logins from the same IP and same program. Is that accurate? Is anything else that could be going wrong here?
COMET End event subtype= null
I am developing a COMET application that is primarily based on the example given on the documentation of the chat server. My problem is that when two users connect, the connection held open by the comet servlet is closed. I know this because I am getting END events in my log. The confusing part is, it will randomly fail, and when it does, subtype is null. When I say randomly fail, I mean get the END event when you are not supposed to. Does subtype being null point to anything? This is so frustrating because it fails randomly. I am on Tomcat7 on linux. I can provide more info if its needed
Re: COMET End event subtype= null
ok looks like i have the configuration of org.apache.catalina.valves.CometConnectionManagerValve wrong. sorry about that. Still have the random disconnect error though On Fri, Aug 1, 2014 at 10:46 AM, Elias Kopsiaftis yemi...@gmail.com wrote: I am developing a COMET application that is primarily based on the example given on the documentation of the chat server. My problem is that when two users connect, the connection held open by the comet servlet is closed. I know this because I am getting END events in my log. The confusing part is, it will randomly fail, and when it does, subtype is null. When I say randomly fail, I mean get the END event when you are not supposed to. Does subtype being null point to anything? This is so frustrating because it fails randomly. I am on Tomcat7 on linux. I can provide more info if its needed
Re: COMET End event subtype= null
ok now it is properly configured(I was missing the slash at the end of the tag), but Im still getting null for event subtypes. Any thoughts? On Fri, Aug 1, 2014 at 11:18 AM, Elias Kopsiaftis yemi...@gmail.com wrote: ok looks like i have the configuration of org.apache.catalina.valves.CometConnectionManagerValve wrong. sorry about that. Still have the random disconnect error though On Fri, Aug 1, 2014 at 10:46 AM, Elias Kopsiaftis yemi...@gmail.com wrote: I am developing a COMET application that is primarily based on the example given on the documentation of the chat server. My problem is that when two users connect, the connection held open by the comet servlet is closed. I know this because I am getting END events in my log. The confusing part is, it will randomly fail, and when it does, subtype is null. When I say randomly fail, I mean get the END event when you are not supposed to. Does subtype being null point to anything? This is so frustrating because it fails randomly. I am on Tomcat7 on linux. I can provide more info if its needed
comet question
Hey guys, I found this on the web, and it really alarms me because my web app which is in development depends on Comet technology to work. http://bighow.net/4294974-Comet_under_Tomcat_6_0_33_sends_data_to_a_wrong_user.html Before I start digging into the tomcat7 source code, can anyone verify or contest the issue on that site? If Comet is not 100% dependable, how about WebSockets as an alternative?
Re: comet question
oh yea, im on tomcat 7 btw On Thu, May 29, 2014 at 2:13 PM, Elias Kopsiaftis yemi...@gmail.com wrote: Hey guys, I found this on the web, and it really alarms me because my web app which is in development depends on Comet technology to work. http://bighow.net/4294974-Comet_under_Tomcat_6_0_33_sends_data_to_a_wrong_user.html Before I start digging into the tomcat7 source code, can anyone verify or contest the issue on that site? If Comet is not 100% dependable, how about WebSockets as an alternative?
Re: comet question
To make sure it doesnt exist in Tomcat7. Thats why. Ive never looked into the tomcat source code and theres no point for my current project unless this bug still exists. Just trying to save myself the work. Also, I couldnt find a page of known tomcat7 comet issues. If such a page existed it would be helpful On Thu, May 29, 2014 at 2:45 PM, David kerber dcker...@verizon.net wrote: On 5/29/2014 2:21 PM, Elias Kopsiaftis wrote: oh yea, im on tomcat 7 btw Then why are you asking about a problem in a very old version of Tomcat 6? On Thu, May 29, 2014 at 2:13 PM, Elias Kopsiaftis yemi...@gmail.com wrote: Hey guys, I found this on the web, and it really alarms me because my web app which is in development depends on Comet technology to work. http://bighow.net/4294974-Comet_under_Tomcat_6_0_33_ sends_data_to_a_wrong_user.html Before I start digging into the tomcat7 source code, can anyone verify or contest the issue on that site? If Comet is not 100% dependable, how about WebSockets as an alternative? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: comet question
ok thanks guys, I just got freaked out when I saw that post. On Thu, May 29, 2014 at 3:10 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 David, On 5/29/14, 2:45 PM, David kerber wrote: On 5/29/2014 2:21 PM, Elias Kopsiaftis wrote: oh yea, im on tomcat 7 btw Then why are you asking about a problem in a very old version of Tomcat 6? +1 Also, that web site looks like a scraping site that steals content from some other site like StackOverflow, Nabble, etc. The question isn't even complete it cuts off in the middle. Errors of this kind are usually due to a problem in the application, but there have been some edge cases found over the last few years and patched. You should make sure you are using the most up-to-date patch version of Tomcat in your release line. If you are using Tomcat 7, you want to make sure you are using Tomcat 7.0.54 which was just recently released and includes a few security updates. As for a technology for the future, you should dump Comet: the world is standardizing on Websocket. Java EE now includes a Websocket API, so you'll be able to deploy Websocket-based web applications on any compliant container instead of tying yourself to the Tomcat-specific Comet implementation. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTh4YUAAoJEBzwKT+lPKRYGG4QAMta8eJb8vCRFz/+JKLxLmja Ufeklv7CL1W+UDcljU/0t9YuWk1pfGiXRn2ORgLDuZUee69Eb2c959z4owpMaEiX ctqWTre1qA7sYCuQkBHehsOP4ohGYnhvndFeqJEMHedoQvj1y5WsNydXMwCYhCx3 czWYbrL3tb8h6VjOMfEEOi1LFyV7hNIvaKt4I4WRw+8HMC6kLRTvoJf0JB8Ikj0s JZ9whO481K6H6WhxNYSx+/VrOUsX986LNXqnsEbhGhrEq3OJsBgF5Tmfy068PqbX OlzVDJP8wNpriauFpKDLrB/KKvQKnFEbEEcJ9rXJs799+3URkOZ7e63Cw9wN1Ie4 30kaGCt+qNQswV2WAKaJz9wJQATO2TVb+Cf/fA2XKzGpCDCR1wC3dJo2Tk4RW7q8 QJJ72TpZEGr/b4V67MSbKZhN28MQnzIIeKp+0105n2Bvjwomof6Lz7c2RMD9+YJQ K8RYyBD5K6eQqoOn3+9aWTjPPYLy6zquoQV5bWiVmasBs9VdiuhSpdlNbKL8D9Ot rkYuz9QhlSTxftQPbSVkIV8xxhQJlhHkXYCd+pXhSCPJ7VeqhPHmz8gnDj4v6RAJ oBDvxLpaNySoh970rf5yIQhJATTCMwZyxEZlQ2rI+HUg9VrnVUlT/hRnPMFwYZml fFIxarosofRPMdiBIVta =tRxc -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: comet question
I am having random errors, but we are still looking into them because right now we think they are probably from our end. The current one is that the connection from the client to the comet servlet will randomly repeatedly receive NULL. Still looking into this to see what the server is doing On Thu, May 29, 2014 at 3:13 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Elias, On 5/29/14, 3:08 PM, Elias Kopsiaftis wrote: To make sure it doesnt exist in Tomcat7. Thats why. Ive never looked into the tomcat source code and theres no point for my current project unless this bug still exists. Just trying to save myself the work. Also, I couldnt find a page of known tomcat7 comet issues. If such a page existed it would be helpful Check Bugzilla. Anything logged and not fixed is known, I suppose. Also check the changelogs. Feel free to check everything between Tomat 6.0.33 and Tomcat 7.0.54, but that's a lot of reading. Are you actually having a problem, or are you just scared of what might be out there? To my knowledge, there are no proofs that Tomcat has zero flaws. Therefore, it could potentially serve every response to the wrong client. Experience says that does not happen. Common sense also tells you that, because nobody would use Tomcat if it was so horribly broken. There have been related bugs in the past that have been fixed when found. If you think you have found one, please report it with as much information as you can. But if you are just asking if there is a known problem with Tomcat where responses go to the wrong client, the answer is no: if we knew about a problem, we'd fix it and roll a new release. - -chris On Thu, May 29, 2014 at 2:45 PM, David kerber dcker...@verizon.net wrote: On 5/29/2014 2:21 PM, Elias Kopsiaftis wrote: oh yea, im on tomcat 7 btw Then why are you asking about a problem in a very old version of Tomcat 6? On Thu, May 29, 2014 at 2:13 PM, Elias Kopsiaftis yemi...@gmail.com wrote: Hey guys, I found this on the web, and it really alarms me because my web app which is in development depends on Comet technology to work. http://bighow.net/4294974-Comet_under_Tomcat_6_0_33_ sends_data_to_a_wrong_user.html Before I start digging into the tomcat7 source code, can anyone verify or contest the issue on that site? If Comet is not 100% dependable, how about WebSockets as an alternative? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTh4btAAoJEBzwKT+lPKRYhvgQAMO2/TysR56uWeAo3nDRiJZP 2R9Q26t0UmAVqbUfujs0VtCGTySv6LKCHgbG6I/XQotSbdeaWY9jIZphqpLxylLV T24WqIFAv2J4ZLsx/W09pXMqvErVnp0kuesaFnEj4ooOfqATRTG0oscgQxy6Qrtb kzoOHYxG8c0/T/RnvNF+97F3ybRdwpW4U2TwLvtMYCw6H9MSzUPRJLdSIbnA4oS2 Bf7OcVoHCJ/53ODDuUfTpFXZgEucNmq58HHRaV0TYBQjIv1GwMMe889MWrfIQzuO rmHbXqORb/tRTZeV2DxPZ2t3AS0qU6K1qz4SDX91jngMJg9Uclvh8iW5pSi8K5y9 a9ZGoB4nVX9vZlkLwazfHfvUXwFVfzqZL9yYaSc7cT8EGf/47KV/xjRombdKyw18 /M4pNEBrD+hOqKKB24J3u6v1aGuz6ffUZ8io94bAGNm+Nq86+cL45PxQ49pkyVIk T7FQbM/NDgNJVRdByHalPlPyFtvC4d6mpU+yG9ryyESy1yCyMx9ojNTA/gt0IJ40 CZdqnPkEAsrzIadRYi/2n3eTQFrABHmH+jfh1ShzxLsd96mxz7GC1DM26yoJq/ok ckiEY0zY058Csp1NafRoSKbDSQ48pkvBvF0eccym3fCZwknA22a9iuZ9eRkLXbdO NxKin3hu9RQlMzCC1jmI =yrsV -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Comet Servlet with a reverse proxy in front of it
Hey, I actually got this working so far with nginx(and by so far I mean the random connection errors I was getting with apache2 have not surfaced yet). Ill post the nginx config setup later today when I get home for the benefit of anyone else who wants to do this. On Mon, May 12, 2014 at 3:34 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Elias, On 5/12/14, 11:20 AM, Elias Kopsiaftis wrote: Is there any way to put a reverse proxy in front of a Comet servlet? I don't believe so. There is work being done on supporting Websocket through mod_proxy but it will likely never support Comet. I tried apache but thats a no go because it uses a single thread per connection, which is not scaleable Only some Apache httpd MPMs are one-thread-per-connection. then I tried nginx, which perhaps I did something wrong in my setup but in the client code, the call to getInputStream never returns, indicating something is wrong. I apologize for not providing too many details and just proposing a general question, but Im hoping there is a general solution to this problem. If you guys needs server specific details I can provide later today when I get home from work. I think that httpd + Tomcat is not going to work, here. I'm not sure about Nginx. If you find something that works, please post back with your findings. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTcSJSAAoJEBzwKT+lPKRYFL8P/jryAJ8epDKL8nioPLV2PAWF 2z2rmNLEtYq4Do+lraq0ttoIhYKkJ0pLyV7/evNDEkjTrtrM2uNEY/BrsVgWelp9 q6RqjYKdFhc/rPmTL+Uu2JHMFfpUfNrVGqAmPwqVU6qwzVrlfujF/z/EHxq13Rib IXQgMJcB2yFx7Boeg2BJWLUhbTeod0aR8RjNKQG6EhiQghnATb6FpKEjHvYkJXCt SGr0NptEM2xVlqTfbsuBDf/ZJQS+bh9h89c0nqZPkuYWkH5ZGbq02am8e4nJOVhl tU3lUQCT5+3wNlXeGVuFdoOlFxl9IJGRU7sx+Sjku2eIXRDTXYvQ3sH4wgjxIomV qwrcN5aBnW/l5slPaXcxA6NNcxcjfOyoCBs+oLzWDA8B1ijh4JY2SsMVrUSSXDVr F4JIVrR+19nXJnFiBVKboU5nN54mzIo3OtKNeI3/dnITXdRX1gft5jmWaI4n59Ci yodCN5l35R9uFurSYWmVPyYv8Bk+aOFgYjqLPJU6d7So3g/fVx8cWubAqzj9Ft8V IYRBUCn/rsDW2nRXJX/vlmgKwsgrDI2rlorIdcRYmj+PCOBykuBsHpVk29Te1Cxy eOh7V05X7VOXzqWnOm2zO43PwCPc98g0eDlB4/l/VDyE/VZ4IXcQifa1f6vZutOH 8mzvN7jAkrMBvsGk48kr =+J8x -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Comet Servlet with a reverse proxy in front of it
Here is my config for using nginx as a reverse proxy in front of tomcat. Seems to work so far. Just replace the question marks with your configuration server { listen 80; server_name ??; root /var/lib/tomcat7/webapps/?. location / { proxy_http_version 1.1; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://127.0.0.1:8085/; } On Thu, May 15, 2014 at 1:04 PM, Elias Kopsiaftis yemi...@gmail.com wrote: Hey, I actually got this working so far with nginx(and by so far I mean the random connection errors I was getting with apache2 have not surfaced yet). Ill post the nginx config setup later today when I get home for the benefit of anyone else who wants to do this. On Mon, May 12, 2014 at 3:34 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Elias, On 5/12/14, 11:20 AM, Elias Kopsiaftis wrote: Is there any way to put a reverse proxy in front of a Comet servlet? I don't believe so. There is work being done on supporting Websocket through mod_proxy but it will likely never support Comet. I tried apache but thats a no go because it uses a single thread per connection, which is not scaleable Only some Apache httpd MPMs are one-thread-per-connection. then I tried nginx, which perhaps I did something wrong in my setup but in the client code, the call to getInputStream never returns, indicating something is wrong. I apologize for not providing too many details and just proposing a general question, but Im hoping there is a general solution to this problem. If you guys needs server specific details I can provide later today when I get home from work. I think that httpd + Tomcat is not going to work, here. I'm not sure about Nginx. If you find something that works, please post back with your findings. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTcSJSAAoJEBzwKT+lPKRYFL8P/jryAJ8epDKL8nioPLV2PAWF 2z2rmNLEtYq4Do+lraq0ttoIhYKkJ0pLyV7/evNDEkjTrtrM2uNEY/BrsVgWelp9 q6RqjYKdFhc/rPmTL+Uu2JHMFfpUfNrVGqAmPwqVU6qwzVrlfujF/z/EHxq13Rib IXQgMJcB2yFx7Boeg2BJWLUhbTeod0aR8RjNKQG6EhiQghnATb6FpKEjHvYkJXCt SGr0NptEM2xVlqTfbsuBDf/ZJQS+bh9h89c0nqZPkuYWkH5ZGbq02am8e4nJOVhl tU3lUQCT5+3wNlXeGVuFdoOlFxl9IJGRU7sx+Sjku2eIXRDTXYvQ3sH4wgjxIomV qwrcN5aBnW/l5slPaXcxA6NNcxcjfOyoCBs+oLzWDA8B1ijh4JY2SsMVrUSSXDVr F4JIVrR+19nXJnFiBVKboU5nN54mzIo3OtKNeI3/dnITXdRX1gft5jmWaI4n59Ci yodCN5l35R9uFurSYWmVPyYv8Bk+aOFgYjqLPJU6d7So3g/fVx8cWubAqzj9Ft8V IYRBUCn/rsDW2nRXJX/vlmgKwsgrDI2rlorIdcRYmj+PCOBykuBsHpVk29Te1Cxy eOh7V05X7VOXzqWnOm2zO43PwCPc98g0eDlB4/l/VDyE/VZ4IXcQifa1f6vZutOH 8mzvN7jAkrMBvsGk48kr =+J8x -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Comet Servlet with a reverse proxy in front of it
Is there any way to put a reverse proxy in front of a Comet servlet? I tried apache but thats a no go because it uses a single thread per connection, which is not scaleable, then I tried nginx, which perhaps I did something wrong in my setup but in the client code, the call to getInputStream never returns, indicating something is wrong. I apologize for not providing too many details and just proposing a general question, but Im hoping there is a general solution to this problem. If you guys needs server specific details I can provide later today when I get home from work.
comet servlet gets connected to inadvertantly
Im using tomcat7 on 64 bit ubuntu linux and java 7. I have a client software that connects to the server. For some reason, when a user logs in, in the access log, i see 3 connections, one to the version check servlet, one to the output servlet, and one to the login servlet. the output servlet should not be accessed by the client until it gets a return value from the login servlet, and im sure it happens in this order in the code. My best guess is that the request is somehow going to two servlets somehow, but i dont know if this is even possible, but I dont know what else could happen. If you are running a comet servlet next to traditional servlets, its there any chance both will get the same request?
Re: comet servlet gets connected to inadvertantly
Oh, what I meant was version information is that server sends version and tells you to upgrade if you dont have the right version. i see these connections in the access log On Fri, Apr 18, 2014 at 2:46 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Elias, On 4/18/14, 2:17 PM, Elias Kopsiaftis wrote: Im using tomcat7 on 64 bit ubuntu linux and java 7. I have a client software that connects to the server. For some reason, when a user logs in, in the access log, i see 3 connections, one to the version check servlet, one to the output servlet, and one to the login servlet. Do you mean you see 3 connections, or 3 requests. How do you see them? Access log? tcpdump? the output servlet should not be accessed by the client until it gets a return value from the login servlet, and im sure it happens in this order in the code. My best guess is that the request is somehow going to two servlets somehow, but i dont know if this is even possible, but I dont know what else could happen. If you are running a comet servlet next to traditional servlets, its there any chance both will get the same request? Version information? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTUXMBAAoJEBzwKT+lPKRYteoP/3B5984tExGxPfLii33gMT7C 7l9YkD7jmseCVr/hORfNqAfce8dk4Jb0VZ0/2Ft7EE+RU+S8Itu/Epf6O9rYlhdA jJ9IYltZl/TzZUDLTb3fPeuv669UM2Ccg7E+KKKkyG2omWIwptp8BzK9Q8+K1uez 8lMlz2Z8UNwF46PlmDP8ngtO0spr+QjNlorBzP5GN/ifAQ7Wqsw6qju+0CDTT+BO FM6AmWEYtdCq/IUD7gxqG8Wi8NxBZXn72F4YYO0LrUkPsSYIY+Ks3BT6MtCrF5Xk 8dqu8ALkH0A7E9bYf77d3GqtrmeByBSQeGtlzz8Wwx/KvPKy9IDBlg069njySZoH DtxOVURwwbiRuMj2PFDiHz5g4vECALsNDzWfXYi1+YYkfvU7qRs05YRzpszOfzqD zbL60IGHnlerRnPsBR1HhwoW7LcewMt5nasKC+yiEa6zfmYjwEhYAq2rTEXw3z8V sfq3R2ySqvoQfiIrgjohzVSjwECIa4DVv4L8VH5vOdWLLrTwFEOg/HpjYsSLnMSg dEhM17odRiGkvAdCxSzWhyyQsxrCeupb9AIZU48Ew0I802wIvhIlaRK9v4k0hZ0p NuOpNqUCMMZw+V/oKUgl+xfeWYdr4NLbKTbv5orJ3LuUU4s3OL7kPtOhSR7rdxev pnAnkn76mxL5EIHDiyT6 =kVaV -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat randomly undeploys and redeploys the applications
Ive done some more research into this problem with my co developer, and we have a question. Is it possible that memory leaks would cause tomcat to crash? Silly question I know, but heres technically what the situation is. We did not add code to shut down all threads when application is undeployed through tomcat manager. When undeploying and redeploying we cause memory leaks due to our application. Now, I guess the real question is, we seem to always deploy it fine, but randomly at some point during the night it will crash, and we only know that from checking next morning. We have nothing logged that indicates why. Would memory leaks cause it to crash randomly even though nothing is trying to connect to it, yet it would seem to deploy fine? Could that be the issue we are seeing? Is there any specific class to debug in logging.properties that might indicate whats going on? I added that line you guys mentioned about setting log level to DEBUG from that class loader class, but it hasnt crashed since then On Thu, Apr 3, 2014 at 12:06 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mark, On 4/2/14, 5:20 PM, Mark Eggers wrote: Chris, On 4/2/2014 1:54 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mark, On 4/2/14, 4:30 PM, Mark Eggers wrote: Chris, On 4/2/2014 1:05 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Chuck, On 4/2/14, 8:21 AM, Caldarale, Charles R wrote: From: Elias Kopsiaftis [mailto:yemi...@gmail.com] Subject: tomcat randomly undeploys and redeploys the applications I deploy the application, then in the log file catalina.out i get many messages from WebappClassLoader clearReferencesThreads saying threads appear to have started but have failed to stop This is an indication that your webapp is not managing its threads properly. then finally, Ill get a message from HostConfig checkResources that says its undeploying the context, and then it redeploys. This is sometimes caused by incorrect timestamps on the bits of the webapp that Tomcat monitors, or an incorrect clock setting on the system Tomcat is running on. The mismatch makes it appear that the webapp is being updated continuously. I've found that in development, a single update can cause Tomcat to go into a loop of redeployments, re-deploying my web application every few seconds or so. If I let it go, it does finally stop reloading and settle down. Can you describe your development environment a little bit, and any thoughts as to what might trigger this loop of redeployments? I use Eclipse for development, but our real build process is ant-based. We have some watched resources configured outside the default (stuff like Struts config files, etc.). Ah, makes sense. When I do a build while Tomcat is running, usually I get one webapp reload, but sometimes I get a series of reloads. It usually gets so irritating (our webapp takes about 10 seconds to reload) that I just kill Tomcat and immediately restart it. It starts up once and all is well after that. Yep, and in the process more files are copied about, and that triggers another reload. Fun, fun. No, the deployment update takes like one or two seconds. It's usually something like copying less than 10 class files or whatever. It's nearly instantaneous. Whatever happens, it's not because I'm updating files during the reload. I could understand that situation. What I observe is that I update my application, I wait maybe 10 seconds, and then Tomcat reloads my application multiple times before I just kill it. I've not seen this, but it could explain some issues some the developers I support are seeing. It definitely happens, and I never remember to enable the DEBUG logging to find out what resource it thinks has been updated until after it happens, at which point I just don't care. Perhaps I should enable it right now :) - -chris I've managed to make this happen in my environment now (NetBeans 7.4, Maven 3.2.1, Tomcat 7.0.42 - all will be upgraded soon). I just needed an application that takes a bit longer to load. I only managed to trigger two reloads, so it's not much of an issue. Maybe look at adding the backgroundProcessorDelay attribute to the context? I don't know what would happen if the context got a string of reload requests within the delay interval. Would it queue them up one after the other, or would it just execute one? I think it's more important to see what file(s) Tomcat thinks is(are) being updated. I wonder if it's the same file, or if there's some weird timestamp issue happening. Perhaps there is even some kind of edge case where a resource's last-modified date isn't being updated properly. In most cases, Tomcat reloads my application a single time, as expected
Re: tomcat randomly undeploys and redeploys the applications
Im sorry about that. The reason I did not post same day was that through the messages in this thread someone suggested adding a debug statement to debug WebappClassLoader, and I wanted to wait to see if it happened again so I could see the debug output, then I came up with the idea in my last message. yes we are on Linux and we are using java 7 and tomcat 7 and we are on linux 3.11.6 on a 64 bit build for x86. When I say crash, I mean that when we use the client application to connect to the web app it wont connect and we have to go into tomcat manager and start it back up. We use an executor with 20 threads in it to process things on the server, and that was never shut down, so that would explain the memory leak and the extra threads. We need them to run for the duration of the application life cycle, but they should be cleaned up on undeployment. Thanks for the reference to the presentation. I will go through it now. I think I may have my answer and hopefully this wont happen again after we fix our web app to shut down those threads. On Fri, Apr 4, 2014 at 11:17 AM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Elias, On 4/4/14, 11:03 AM, Elias Kopsiaftis wrote: Ive done some more research into this problem with my co developer, and we have a question. Is it possible that memory leaks would cause tomcat to crash? Yes, but you'll likely get an OutOfMemoryError in your log, and then everything will go crazy. Some requests will work, others will not. Things will get slow. For us, the background thread often quits and sessions never expire, exacerbating the problem. But it won't happen silently (you may have to look for it) and it won't spontaneously undeploy and redeploy your web application. Silly question I know, but heres technically what the situation is. We did not add code to shut down all threads when application is undeployed through tomcat manager. Tomcat will do this itself: you don't need to add any code. Or did you mean that you have Threads created by your application that continue to tun after your web app has been shut down? When undeploying and redeploying we cause memory leaks due to our application. Yes, this can happen. The Threads cause the WebappClassLoader to stay in memory, which means that all Class objects for the previous deployment are still hanging around. It can be several tens of MiB per reload. You should read this excellent presentation which explains the problem(s) and the solution(s): http://people.apache.org/~markt/presentations/2010-11-04-Memory-Leaks-60mins.pdf Now, I guess the real question is, we seem to always deploy it fine, but randomly at some point during the night it will crash, and we only know that from checking next morning. What do you mean when you say crash? Exception? Spontaneous re-deployment? OutOfMemory? JVM crash (process exits)? We have nothing logged that indicates why. If the process is gone without any indication of why (no shutdown message, no nothing), my only guess is Linux OOM-killer. You never actually came back to describe the environment you are in after saying you'd post that information later today. If you're not on Linux I'm not sure. Would memory leaks cause it to crash randomly even though nothing is trying to connect to it, yet it would seem to deploy fine? I've never seen an OOME actually cause a JVM to quit. It just slogs onward, often not able to accomplish any useful work, but the process stays running. Could that be the issue we are seeing? Is there any specific class to debug in logging.properties that might indicate whats going on? I added that line you guys mentioned about setting log level to DEBUG from that class loader class, but it hasnt crashed since then Describe what you mean by crash, including as much details about it, and definitely read the presentation referenced above. Also definitely fix your web application to shut down its Threads. Whatever component launches them (e.g. ServletContextListener, Servlet.init, etc.) should stop them in the appropriate callback method (ServletContextListener.contextDestroyed, Servlet.destroy, etc.). - -chris On Thu, Apr 3, 2014 at 12:06 PM, Christopher Schultz ch...@christopherschultz.net wrote: Mark, On 4/2/14, 5:20 PM, Mark Eggers wrote: Chris, On 4/2/2014 1:54 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mark, On 4/2/14, 4:30 PM, Mark Eggers wrote: Chris, On 4/2/2014 1:05 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Chuck, On 4/2/14, 8:21 AM, Caldarale, Charles R wrote: From: Elias Kopsiaftis [mailto:yemi...@gmail.com] Subject: tomcat randomly undeploys and redeploys the applications I deploy the application, then in the log file catalina.out i get many messages from WebappClassLoader
tomcat randomly undeploys and redeploys the applications
Im having a strange problem and I have googled it for a while but have found nothing. I deploy the application, then in the log file catalina.out i get many messages from WebappClassLoader clearReferencesThreads saying threads appear to have started but have failed to stop, then finally, Ill get a message from HostConfig checkResources that says its undeploying the context, and then it redeploys. I have no idea why this is happening or how to trouble shoot it. Any suggestions would be greatly appreciated
Re: tomcat randomly undeploys and redeploys the applications
Chuck, Thanks for your response. I will get you all the information you asked for later tonight when I get out of work. In the meantime, the only threads our application creates are those created by a ScheduledThreadPoolExecutor, and in fact, when I do a thread dump to analyze what is going on, there are 30 threads associated with this executor that are in a BLOCKED state. We have had trouble with executors in the past, but these threads are supposed to be running for the lifecycle of the application. Is there a problem using an executor in a tomcat application? I will provide you with the following later today: Tomcat version, JRE version, platform, server.xml (with comments removed), context.xml for the webapp, etc. Would you like me to also attach the thread dump? On Wed, Apr 2, 2014 at 8:21 AM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: Elias Kopsiaftis [mailto:yemi...@gmail.com] Subject: tomcat randomly undeploys and redeploys the applications I deploy the application, then in the log file catalina.out i get many messages from WebappClassLoader clearReferencesThreads saying threads appear to have started but have failed to stop This is an indication that your webapp is not managing its threads properly. then finally, Ill get a message from HostConfig checkResources that says its undeploying the context, and then it redeploys. This is sometimes caused by incorrect timestamps on the bits of the webapp that Tomcat monitors, or an incorrect clock setting on the system Tomcat is running on. The mismatch makes it appear that the webapp is being updated continuously. If you want anything more than speculation, you'll need to provide real information: Tomcat version, JRE version, platform, server.xml (with comments removed), context.xml for the webapp, etc. - 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: tomcat randomly undeploys and redeploys the applications
Thats very interesting. When you say update, what do you mean technically? On Wed, Apr 2, 2014 at 4:05 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Chuck, On 4/2/14, 8:21 AM, Caldarale, Charles R wrote: From: Elias Kopsiaftis [mailto:yemi...@gmail.com] Subject: tomcat randomly undeploys and redeploys the applications I deploy the application, then in the log file catalina.out i get many messages from WebappClassLoader clearReferencesThreads saying threads appear to have started but have failed to stop This is an indication that your webapp is not managing its threads properly. then finally, Ill get a message from HostConfig checkResources that says its undeploying the context, and then it redeploys. This is sometimes caused by incorrect timestamps on the bits of the webapp that Tomcat monitors, or an incorrect clock setting on the system Tomcat is running on. The mismatch makes it appear that the webapp is being updated continuously. I've found that in development, a single update can cause Tomcat to go into a loop of redeployments, re-deploying my web application every few seconds or so. If I let it go, it does finally stop reloading and settle down. I believe Tomcat will emit a log message informing the administrator which file has triggered the reload, but I think it's at the DEBUG log level. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTPG2nAAoJEBzwKT+lPKRY9oIQAIFI0aUQ33he8KqNQgwBaigY otTiL3Cr6dvVfYi2pLP9YK/2BqOkjtmCXAZ99gOhV0h3QntMWrBbYmkcu6BuibPH gnm2vME/B8XdNhGatPQgs1dW3OWa/OTra6req0CcLX3IucGERJWrMotOSLrsylUH lVkVWoRXZ3m6NikExKCmB/DUzy9dsecHGZM3hETEloye6p7EVez+RHFg/7VWDU42 GyPZqiGFVRDELobbc4FVAy2R0OLPVSXzbsnuM3ZFS/TRqX+PKItfsnYczzrck3rK ozeYjmgG5IKD4eL/Nl0iUcZ/CjmHxTJCSlVwRhnQ7InFoNjR0TYur2dyw/+mqdlj U0u61XYJiUqHUnk5LUh5pFvxfKOyRSy34YlHAHTOBg6Nl/TZoAMtGBXQ5gsLssHC uf1U/oTl1hfhgIynQ3ijn10TXXXskEux5GHegUGVv8HqZNEcPVtuPw+3fEhGsXEu vgHmXUJIbLBDwIVD9WGC7iYHR4zNwHetlFwUE+sxAxP/zLwPd+Ps4TcoKabUh0nG sE7oj/qZxBHRxGIXg6BnGuzerHJPJT8dcaAo+U1zSmQdlAy1mCdvUrFpA7i63RdT XU8mwimmr93WBBOkhnWg4iJjTIl2LKEo1GmV0JiB/eqZaWIFNFy8oBnW56KnEhLV coHAGbSi2o7XZUdVpn0v =kMSx -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat randomly undeploys and redeploys the applications
Thanks Chris! I will look into this and let you guys know what I find On Wed, Apr 2, 2014 at 4:19 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Elias, On 4/2/14, 4:05 PM, Christopher Schultz wrote: Chuck, On 4/2/14, 8:21 AM, Caldarale, Charles R wrote: From: Elias Kopsiaftis [mailto:yemi...@gmail.com] Subject: tomcat randomly undeploys and redeploys the applications I deploy the application, then in the log file catalina.out i get many messages from WebappClassLoader clearReferencesThreads saying threads appear to have started but have failed to stop This is an indication that your webapp is not managing its threads properly. then finally, Ill get a message from HostConfig checkResources that says its undeploying the context, and then it redeploys. This is sometimes caused by incorrect timestamps on the bits of the webapp that Tomcat monitors, or an incorrect clock setting on the system Tomcat is running on. The mismatch makes it appear that the webapp is being updated continuously. I've found that in development, a single update can cause Tomcat to go into a loop of redeployments, re-deploying my web application every few seconds or so. If I let it go, it does finally stop reloading and settle down. I believe Tomcat will emit a log message informing the administrator which file has triggered the reload, but I think it's at the DEBUG log level. It's WebappClassLoader. You'll want to add this to your logging.properties in order to emit those messages: org.apache.catalina.loader.WebappClassLoader.level=DEBUG - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTPHDjAAoJEBzwKT+lPKRYr4wP/3AzjqhtU8MKyuEoHSwyrwTt 3z0GaYZEolH+kW46+QOOnFUOXvWaK8MHjy5VgRU1rZP9DK/dwGYGbKrA7sMd9iuG nvjo7v/hLrPxtvvt8LKiH+vQslhyMU86uNReXu90QUWD0shj3twfC78IEWJKp0rl NR2/+mIardJv4KeZ06HQVgD/+xWpWVSxeDOeJJ3i1/alxhh7P7ybs8M3v9QTmaHC XFQEKSdb4MEn1tgEl88ucbhaibKLJKizOYRBfG2k0J3CcVsRtfsefmh0KDXSSBT+ C6cOKULYCf4JimHdLAo8Ap0C4d6dBIu2MwIXRR+voV0rEtsn2uf43VaJmp9XsQie 9Gb6PQz7LUHUBAMb4FNrTRAWqfAb0LSq9Q1wXVOa9Ai6HMkYKnIZaO9pHfnAaQKK 34Zc5JMahtsbPtRj2jKSWiss92N5EDcKZHPLnhz1Z0q+zKRfCiBxDC3aS/bb4vIY HuYLc1MZq9+2PXjj6Mp9TP/eYOLkGgmT9OLsN+sdNSEmwpFQd/p5zQ9He7OW05O9 q0wMjNmx0SRfjV5BrtG2k4eSvVaJpUP0FNKWWhaBAkreIyLs3P5C2QMjZ36NnJkA zO6jDsCJjwc7QOroSFyB++qm3FISDxGTuestkv0UAi92I+ePgjxooOPqSLmaVv5i 7UiJvtiB6XzAMxpn8wny =cKnh -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat wont allow me to create files
Hi Ben, I didnt mention that but I did check that write permissions were on. Currently I dont have a log4j configuration. I am just trying to get it to work. On Mon, Feb 25, 2013 at 8:39 PM, Ben Stringer b...@burbong.com wrote: On 26/02/2013, at 12:14 PM, Elias Kopsiaftis yemi...@gmail.com wrote: I am running a webapp on Tomcat 7 and I am using log4j for logging. However, log4j cannot create a log file and Im getting a permission denied error in the catalina.out file. I am runnning on linux, and made sure that the current working directory(which I got by printing it from within the application), /var/lib/tomcat7, and all its subdirectories were in the tomcat7 group, which should give the web app permissions to create files, but its not working. any suggestions? Hi Elias, That directory will also need group write permission set. Best way to work through this problem is to sudo to the userid that will be running tomcat, then try and create a file in that directory from the shell. If it is the group write that is missing, this command will add it: chmod g+w /var/lib/tomcat7 But that is not where you should be writing logs. /var/log is a conventional place to keep logs. What is your log4j configuration? Cheers, Ben - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Context root query
did you reload tomcat after changing the file? On Tue, Nov 20, 2012 at 7:51 AM, vicky007aggar...@yahoo.co.in wrote: Hello Guys, I am trying to define the context root in my application using context.xml. I defined the following in application context.xml under meta-inf directory Context path=/app1 privileged=true/ But still tomcat is referring the application name as my context. The value which i defined in context.xml is not getting referenced by tomcat. Can some one please help me in defining the context root for an application . I don't want to use the application name as context root for my app. Thanks for your help, Vicky - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
tomcat sessions
I dont think my tomcat is configured correctly to use sessions. I send jsessionid with each request, but it opens a new session each time. I found this site: http://tomcat.apache.org/tomcat-4.1-doc/config/manager.html, but it doesnt give any actual sample files. can someone send me a sample file that has sessions configured to use jessionid as the session?
is this idea even possible in tomcat?
I posted about this a bit earlier, and I was told WebSockets were a better approach, but I am wondering is what I am trying to do even possible? My idea is to create a program that allows two users to connect through the server, and send images and text to each other. for the server, i have two servlets, one that uses comet, and one that does not. the regular servlet listens for requests, and broadcasts them to all the available connections. the comet servlet listens for connections, and once a connection is made, stores the response in a singleton that both the regular servlet and comet servlet have access to. the way its supposed to work is that the comet servlet stores the response to all connected, the regular servlet listens for messages, and once it receives one, gets a reference to the singleton, goes through all its responses, and sends the message to each connection. i can get my client to connect to the comet servlet just fine, via the tomcat logs, but i cant get it to connect at all to the regular servlet and i dont know why. when i print out the url used to connect to the regular servlet and use the browser, i am not getting any server errors, so it looks like it connects just fine, but none of my print statements in the inputservlet ever get executed, meaning it never processes. now i am wondering, is this idea even possible with the technology available in comet?
comet and standard servlet
I have two servlets, one is comet. i am using an nio connector. i have an application that connects to both servlets at once, however, the standard servlet does not process any requests. i am able to connect to it, because i dont get an exception from the client when connecting. i can also write to it with no exception. however, it never processes the request. i know this because my print statement doesnt appear in the log file, but it does from the comet servlet. is what im trying to do possible?
configuring tomcat to use nio
My friend told me that my comet implementation wasnt working because i need to configure tomcat to use nio rather than standard java io. what happens is when i try to connect to the comet servlet from my client, im getting a reponse that says get request is not supported even though im using a post request. how do i configure this if this is the right solution?
Re: configuring tomcat to use nio
thank you for your quick response. i actually found that document and shouldve specified that. what i really meant was, what is the name of the file you modify? On Mon, Jul 30, 2012 at 2:15 PM, Mark Thomas ma...@apache.org wrote: On 30/07/2012 18:45, Elias Kopsiaftis wrote: My friend told me that my comet implementation wasnt working because i need to configure tomcat to use nio rather than standard java io. what happens is when i try to connect to the comet servlet from my client, im getting a reponse that says get request is not supported even though im using a post request. how do i configure this if this is the right solution? http://tomcat.apache.org/tomcat-7.0-doc/config/http.html Look for protocol. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: configuring tomcat to use nio
thank you again On Mon, Jul 30, 2012 at 2:33 PM, Mark Thomas ma...@apache.org wrote: On 30/07/2012 19:26, Elias Kopsiaftis wrote: thank you for your quick response. i actually found that document and shouldve specified that. what i really meant was, what is the name of the file you modify? http://tomcat.apache.org/tomcat-7.0-doc/config/index.html Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat session id
ok i appreciate the input, but for now i will stick with the comet approach because i read that websocket for tomcat 7 is still experimental and i already built a lot of logic around the comet approach. does anyone know the answer to my original question? On Sat, Jul 14, 2012 at 1:07 PM, Christopher Schultz ch...@christopherschultz.net wrote: André, On Jul 14, 2012, at 6:03, André Warnier a...@ice-sa.com wrote: Elias Kopsiaftis wrote: Well basically, For the output servlet, I am using comet to keep the connection alive and push things out to the client when they are available. This program is a chat program with a drawing capability, so two people can draw on the same canvas and chat with each other. Isn't this just the kind of thing that websocket(s) is supposed to be made for ? Comet is basically a precursor to Websocket: the ideas are vaguely the same and the use cases are nearly identical. Elias, if I were you, I would focus on Websocket moving forward... Comet is going to see less and less action (globally, not just in Tomcat) a time goes on. -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat session id
thank you, and it wasnt working thats why i asked. there must be something else wrong in my code On Sun, Jul 15, 2012 at 3:50 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Elias, On 7/15/12 1:37 PM, Elias Kopsiaftis wrote: ok i appreciate the input, but for now i will stick with the comet approach because i read that websocket for tomcat 7 is still experimental and i already built a lot of logic around the comet approach. does anyone know the answer to my original question? As long as one servlet was called long-enough before the second one that the session could be created and its id returned to the client *and* sessions are supported, then yes, both servlets should have access to the same session data. It should have been easy to test this on your own ... - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlADHvsACgkQ9CaO5/Lv0PCwaACfej2clhjZIZ+UpF2CpNCoOtIX HvUAniuzrjEf7AakeL6ONaIN736TImlr =1ZqX -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat session id
Well basically, For the output servlet, I am using comet to keep the connection alive and push things out to the client when they are available. This program is a chat program with a drawing capability, so two people can draw on the same canvas and chat with each other. On Fri, Jul 13, 2012 at 10:02 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Elias, On 7/13/12 9:39 AM, Elias Kopsiaftis wrote: I am working on a program that uses two servlets, one for input from the client, and one for output to the client. Good so far. My question is, from the client side, I will have two connections open to the server, one for input, and one for output Okay, you've lost me: what you've described is not how HTTP works. A client makes one (or more) connection(s), sends a request (on each connection) and receives a response over the same connection. so, when both connect, will both connections have the same sessionid even though they are accessing two different servlets? both servlets will be on the same tomcat Well, if you are using cookies and your client manages them globally, then all connections should be associated with the same session. This is the case with most web browsers in their default configuration. If you are using URL re-writing to maintain session affinity, then you'll have to make sure that all of the URLs that you issue from the client to the server have the URL properly encoded. If you have written your webapp correctly, most of this should be taken care of by the container. Your client also has to be willing to include path parameters in the URLs that it passes-back to the server. This is also the case with most web browsers in their default configuration. But back to your plan to make separate input (to the server) and output (from the server) connections does not make any sense unless you have some justification for making things that complicated. I'm available for enlightenment, though I suspect your requirements are actually a lot simpler than what you describe. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlAA00MACgkQ9CaO5/Lv0PDz5ACePY07/LBELtlspcvC2U+k0hoF oSgAnieuXC7721SMfwUzD0gWfZHaFwaB =T9FG -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org