Re: Tomcat Warning about existing attribute for Host
On 08/09/2010 06:37, Caldarale, Charles R wrote: From: Anthony J. Biacco [mailto:abia...@formatdynamics.com] Subject: RE: Tomcat Warning about existing attribute for Host I think those flags are only valid in the Context blocks now. There are getters and setters in the 7.0 catalina.startup.HostConfig class for the xmlNamespaceAware and xmlValidation attributes (along with everything else in Host), but that class is only used by the host-manager webapp for dynamically created hosts, not statically defined ones. Not any more. I just removed those from the 7.0.x code base. Thanks for the heads up. The OP should just remove the attributes. +1 And not copying server.xml from one major version to another would help too. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Warning about existing attribute for Host
On 08/09/2010 01:52, Mohammad M. AbuZer wrote: I'm using tomcat 7.0.2 BETA -- Forwarded message -- From: Mohammad M. AbuZer m.abuze...@gmail.com Date: Wed, Sep 8, 2010 at 3:51 AM Subject: Tomcat Warning about existing attribute for Host To: Tomcat Users List users@tomcat.apache.org Hi All,,, I get these in tomcat console: Sep 7, 2010 11:56:26 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'xmlNamespaceAware' to 'false' did not find a matching property. Sep 7, 2010 11:56:26 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'xmlValidation' to 'false' did not find a matching property. so I checked server.xml and host was like following: Host appBase=webapps autoDeploy=true name=localhost unpackWARs=true xmlNamespaceAware=false xmlValidation=false it doesn't make sense, how to solve it? Don't set the two xml attributes then. p * Best Regards * * Mohammad M. AbuZer* Junior Java Developer Mobile: +962-78-5416416 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
Re: 2 second delays in mod_jk while maintaining workers
Hello We've just noticed that the maintenance mode operates on all workers, so having one worker run maintenance for the rest is making tracing the problem difficult. Reading down the logs, we can see it finds a worker and iterates through workers perforing maintenance. Is this correct? Moving on, consider the following debug: [Wed Sep 08 10:36:16.907 2010] [2205:47701852022112] [trace] ajp_abort_endpoint::jk_ajp_common.c (739): enter [Wed Sep 08 10:36:16.907 2010] [2205:47701852022112] [trace] jk_shutdown_socket::jk_connect.c (713): enter [Wed Sep 08 10:36:16.907 2010] [2205:47701852022112] [debug] jk_shutdown_socket::jk_connect.c (722): About to shutdown socket The next entry in the log with [2205:47701852022112] is the following: [Wed Sep 08 10:36:18.907 2010] [2205:47701852022112] [trace] jk_close_socket::jk_connect.c (650): enter [Wed Sep 08 10:36:18.908 2010] [2205:47701852022112] [trace] jk_close_socket::jk_connect.c (665): exit [Wed Sep 08 10:36:18.908 2010] [2205:47701852022112] [debug] jk_shutdown_socket::jk_connect.c (813): Shutdown socket 156 and read 0 lingering bytes in 2 sec. [Wed Sep 08 10:36:18.908 2010] [2205:47701852022112] [trace] jk_shutdown_socket::jk_connect.c (817): exit Looking at the code in jk_connect.c: int jk_shutdown_socket(jk_sock_t sd, jk_logger_t *l) { ... if (JK_IS_DEBUG_LEVEL(l)) jk_log(l, JK_LOG_DEBUG, About to shutdown socket %d, sd); /* Shut down the socket for write, which will send a FIN * to the peer. */ if (shutdown(sd, SHUT_WR)) { rc = jk_close_socket(sd, l); And the jk_close_socket function: int jk_close_socket(jk_sock_t sd, jk_logger_t *l) { int rc; int save_errno; JK_TRACE_ENTER(l); Tieing up with the logs suggests the shutdown(sd, SHUT_WR) method is blocking. Any thoughts, John - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Apache AJP to 4 TCs
With 2 workers, the system has been working well for months. I now wanted to add an extra two workers, i.e. a total of 4 tomcats, and load balance across all 4. Is this possible? With respect to the worker names, a number works well. I have set the jvmRoute to be numbers too, and my app directs users to the respective worker using the MITM jsession followed by a dot followed by worker name discussed in forum a few months ago. i.e. https://app.somedomain.com/login.do;jsessionid=w.2 - forces it to use tomcat jvmRoute=2 e.g. Service name=Catalina Connector port=8019 protocol=AJP/1.3 redirectPort=443 address=206.188.29.148 / !-- You should set jvmRoute to support load-balancing redirect via AJP -- Engine name=Catalina defaultHost=localhost jvmRoute=1 Host name=localhost unpackWARs=false autoDeploy=false xmlValidation=false xmlNamespaceAware=false Also, what do mean by This can't work, since the loadbalancer has no idea what you mean by worker 3 and 4 .. worker.loadbalancer.balance_workers=1,2,3,4 1,2 works. 2,4 work, but if I add one more, e.g.1,2,4 apache fails to start. I defined all 4 workers. Does anyone have any hints or links, samples on how I can get Apache talking to more than 2 tomcat workers? It is possible, right? Regards Andrew On Tue, Sep 7, 2010 at 6:15 PM, Rainer Jung rainer.j...@kippdata.de wrote: See remarks inline. On 07.09.2010 10:01, Andrew Bruno wrote: Fair enough Pid, here it is: Windows 2008 R2 64 Bit Java(TM) SE Runtime Environment (build 1.6.0_17-b04) / Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode) Tomcat 6.0.28 Apache 2.2.15 mod_jk-1.2.30-httpd-2.2.3.so AB On Tue, Sep 7, 2010 at 5:52 PM, Pidp...@pidster.com wrote: On 07/09/2010 08:44, Andrew Bruno wrote: Hello, I am trying to add two extra workers, totaling 4 workers, but Apache fails to restart. This worker file works: # List the workers name worker.list=1,2,loadbalancer If you only want to use workers 1 and 2 via the loadbalancer, you can remove them from worker.list and only keep the loadbalancer there. # # First worker # worker.1.host=206.xx.xxx.xxx worker.1.port=8019 worker.1.type=ajp13 worker.1.lbfactor=4 # # Second worker # worker.2.host=206.xx.xxx.xxx worker.2.port=8029 worker.2.type=ajp13 worker.2.lbfactor=5 Strange lbfactors ... # -- # Load Balancer worker # -- worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=1,2,3,4 This can't work, since the loadbalancer has no idea what you mean by worker 3 and 4 ... BUT WHEN I change to: worker.list=1,2,3,4,loadbalancer Same comment as above concerning worker.list worker.1.host=206.xx..xx.xx worker.1.port=8019 worker.1.type=ajp13 worker.1.lbfactor=4 worker.2.host=206.xx..xx.xx worker.2.port=8029 worker.2.type=ajp13 worker.2.lbfactor=5 worker.3.host=206.xx..xx.xx worker.3.port=8039 worker.3.type=ajp13 worker.3.lbfactor=1 worker.4.host=206.xx.xx.xx worker.4.port=8049 worker.4.type=ajp13 worker.4.lbfactor=2 And there are connectors in the Tomcat configuration listening on those ports 8019, ..., 8049, right? worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=1,2,3,4 I get these kind of errors, and Apache fails to start [Tue Sep 07 00:36:37 2010] [18324:16360] [error] jk_lb_worker.c (1536): allocating lb sub worker record from shared memory There's a problem creating the workers when trying to access shared memory. Could you please show us your complete mod_jk configuration, especially the Jk* directives for Apache? Do you have an JkShmSize set? Are there any info, warn or error messages during startup and before this failure? [Tue Sep 07 00:36:37 2010] [18324:16360] [error] jk_worker.c (163): validate failed for loadbalancer [Tue Sep 07 00:36:37 2010] [18324:16360] [error] jk_worker.c (262): failed to create worker loadbalancer [Tue Sep 07 00:38:03 2010] [16864:7456] [error] jk_ajp_common.c (2929): allocating ajp worker record from shared memory [Tue Sep 07 00:38:03 2010] [16864:7456] [error] jk_worker.c (151): factory for ajp13 failed for 2 [Tue Sep 07 00:38:03 2010] [16864:7456] [error] jk_lb_worker.c (1603): Failed creating worker 2 [Tue Sep 07 00:38:03 2010] [16864:7456] [error] jk_lb_worker.c (1651): NULL parameters [Tue Sep 07 00:38:03 2010] [16864:7456] [error] jk_worker.c (163): validate failed for loadbalancer [Tue Sep 07 00:38:03 2010] [16864:7456] [error] jk_worker.c (262): failed to create worker loadbalancer [Tue Sep 07 00:38:39 2010] [7272:16728] [error] jk_ajp_common.c (2929): allocating ajp worker record from shared memory [Tue Sep 07 00:38:39 2010] [7272:16728] [error] jk_worker.c (151): factory for ajp13 failed for 1 [Tue Sep 07 00:38:39 2010] [7272:16728] [error] jk_lb_worker.c (1603):
Re: Apache AJP to 4 TCs
And here is my JK info JkWorkersFile E:/products/thirdparty/apache-2.2.15-01/conf/workers.properties JkShmFile E:/products/thirdparty/apache-2.2.15-01/logs/mod_jk.shm JkLogFile E:/products/thirdparty/apache-2.2.15-01/logs/mod_jk.log JkLogLevelerror JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkMount /* loadbalancer AB On Wed, Sep 8, 2010 at 11:06 PM, Andrew Bruno andrew.br...@gmail.com wrote: With 2 workers, the system has been working well for months. I now wanted to add an extra two workers, i.e. a total of 4 tomcats, and load balance across all 4. Is this possible? With respect to the worker names, a number works well. I have set the jvmRoute to be numbers too, and my app directs users to the respective worker using the MITM jsession followed by a dot followed by worker name discussed in forum a few months ago. i.e. https://app.somedomain.com/login.do;jsessionid=w.2 - forces it to use tomcat jvmRoute=2 e.g. Service name=Catalina Connector port=8019 protocol=AJP/1.3 redirectPort=443 address=206.188.29.148 / !-- You should set jvmRoute to support load-balancing redirect via AJP -- Engine name=Catalina defaultHost=localhost jvmRoute=1 Host name=localhost unpackWARs=false autoDeploy=false xmlValidation=false xmlNamespaceAware=false Also, what do mean by This can't work, since the loadbalancer has no idea what you mean by worker 3 and 4 .. worker.loadbalancer.balance_workers=1,2,3,4 1,2 works. 2,4 work, but if I add one more, e.g.1,2,4 apache fails to start. I defined all 4 workers. Does anyone have any hints or links, samples on how I can get Apache talking to more than 2 tomcat workers? It is possible, right? Regards Andrew On Tue, Sep 7, 2010 at 6:15 PM, Rainer Jung rainer.j...@kippdata.de wrote: See remarks inline. On 07.09.2010 10:01, Andrew Bruno wrote: Fair enough Pid, here it is: Windows 2008 R2 64 Bit Java(TM) SE Runtime Environment (build 1.6.0_17-b04) / Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode) Tomcat 6.0.28 Apache 2.2.15 mod_jk-1.2.30-httpd-2.2.3.so AB On Tue, Sep 7, 2010 at 5:52 PM, Pidp...@pidster.com wrote: On 07/09/2010 08:44, Andrew Bruno wrote: Hello, I am trying to add two extra workers, totaling 4 workers, but Apache fails to restart. This worker file works: # List the workers name worker.list=1,2,loadbalancer If you only want to use workers 1 and 2 via the loadbalancer, you can remove them from worker.list and only keep the loadbalancer there. # # First worker # worker.1.host=206.xx.xxx.xxx worker.1.port=8019 worker.1.type=ajp13 worker.1.lbfactor=4 # # Second worker # worker.2.host=206.xx.xxx.xxx worker.2.port=8029 worker.2.type=ajp13 worker.2.lbfactor=5 Strange lbfactors ... # -- # Load Balancer worker # -- worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=1,2,3,4 This can't work, since the loadbalancer has no idea what you mean by worker 3 and 4 ... BUT WHEN I change to: worker.list=1,2,3,4,loadbalancer Same comment as above concerning worker.list worker.1.host=206.xx..xx.xx worker.1.port=8019 worker.1.type=ajp13 worker.1.lbfactor=4 worker.2.host=206.xx..xx.xx worker.2.port=8029 worker.2.type=ajp13 worker.2.lbfactor=5 worker.3.host=206.xx..xx.xx worker.3.port=8039 worker.3.type=ajp13 worker.3.lbfactor=1 worker.4.host=206.xx.xx.xx worker.4.port=8049 worker.4.type=ajp13 worker.4.lbfactor=2 And there are connectors in the Tomcat configuration listening on those ports 8019, ..., 8049, right? worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=1,2,3,4 I get these kind of errors, and Apache fails to start [Tue Sep 07 00:36:37 2010] [18324:16360] [error] jk_lb_worker.c (1536): allocating lb sub worker record from shared memory There's a problem creating the workers when trying to access shared memory. Could you please show us your complete mod_jk configuration, especially the Jk* directives for Apache? Do you have an JkShmSize set? Are there any info, warn or error messages during startup and before this failure? [Tue Sep 07 00:36:37 2010] [18324:16360] [error] jk_worker.c (163): validate failed for loadbalancer [Tue Sep 07 00:36:37 2010] [18324:16360] [error] jk_worker.c (262): failed to create worker loadbalancer [Tue Sep 07 00:38:03 2010] [16864:7456] [error] jk_ajp_common.c (2929): allocating ajp worker record from shared memory [Tue Sep 07 00:38:03 2010] [16864:7456] [error] jk_worker.c (151): factory for ajp13 failed for 2 [Tue Sep 07 00:38:03 2010] [16864:7456] [error] jk_lb_worker.c (1603): Failed creating worker 2 [Tue Sep 07 00:38:03 2010] [16864:7456] [error] jk_lb_worker.c (1651): NULL parameters [Tue Sep 07 00:38:03 2010] [16864:7456] [error] jk_worker.c (163): validate failed for
Re: Apache AJP to 4 TCs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrew, On 9/8/2010 9:10 AM, Andrew Bruno wrote: And here is my JK info Thanks. JkWorkersFile E:/products/thirdparty/apache-2.2.15-01/conf/workers.properties JkShmFile E:/products/thirdparty/apache-2.2.15-01/logs/mod_jk.shm JkLogFile E:/products/thirdparty/apache-2.2.15-01/logs/mod_jk.log JkLogLevelerror Try setting the above JkLogLevel to debug and sending the new (complete) mod_jk.log file that covers httpd startup. JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkMount /* loadbalancer Since you're using httpd for load balancing, you might consider using it to serve static content rather than doing a (potentially) needless proxy operation for those files. Just a thought. I now wanted to add an extra two workers, i.e. a total of 4 tomcats, and load balance across all 4. Is this possible? Yes. With respect to the worker names, a number works well. I have set the jvmRoute to be numbers too, and my app directs users to the respective worker using the MITM jsession followed by a dot followed by worker name discussed in forum a few months ago. i.e. https://app.somedomain.com/login.do;jsessionid=w.2 - forces it to use tomcat jvmRoute=2 Good. Please send an updated log file, and we'll take a look. Thanks, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyHlX4ACgkQ9CaO5/Lv0PCQZwCcClTydhrc7vwozVrsrYfd0D9d 5u4AoKCOYPpaX0CoCxEI4vHK3SgEh/n9 =9R0Z -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat http connectors
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tom, On 9/7/2010 11:49 AM, Tom Jones wrote: I'm trying to figure out which http connector is best suited for my needs. I was looking around for some info on anything that compares them all but I really did no find much. Out of the three connectors listed can someone please help me understand which I should be using. I'm running Tomcat 6.0.26 on Mac OS X 10.5.8 64bit with Java 1.6.x. I'm using SSL directly to Tomcat. I read that it was faster than using Apache as the front-end. Oh yea, almost all of my content is dynamic, almost no static content at all. Http11Protocol Http11AprProtocol Http11NioProtocol Maybe I should also ask, should I even be messing around with changing the connector type? Most people get started using the Http11Protocol connector because it's configured by default and usually works fine without any tinkering with configuration. The APR connector requires a native library which can be tricky to configure before the rest of your configuration is working (particularly for those new to Java, Tomcat, or web applications). Fortunately, the Http11AprProtocol falls-back on Http11Protocol if the APR native library isn't available. The NIO connector requires no native library or anything like that, but it does have a whole slew of settings that can be used to squeeze every last drop of performance out of the connector. I'm not sure exactly how the TC devs feel about it, but it still seems a bit young though lots of folks appear to be using it in production quite successfully. For more information, start here: http://tomcat.apache.org/tomcat-6.0-doc/connectors.html Unfortunately, that document has no information on the NIO connector. It's probably because that page was just carried-forward from an older version of Tomcat and not updated. For the real meat, you have to go to the configuration section of the site and look at the Connectors. http://tomcat.apache.org/tomcat-6.0-doc/config/http.html This covers the blocking I/O connector as well as the NIO and APR connectors, and, at the very bottom, gives a nice summary of the differences between BIO, NIO, and APR. If you're using AJP (which it doesn't sound like you are), it looks like APR is an option, but not NIO. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyHl2AACgkQ9CaO5/Lv0PCpgwCgiWeCHST5fXhEU/CVMjrD7Ntx yvMAnRpVMHPU8y4rwLPo9FFYAWV2LZbh =Sjwd -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: 2 second delays in mod_jk while maintaining workers
Hello, I don't thikn the shutdown call is to blame - I think it's the large pile of code below. i.e. everything below the if (shutdown(..)) below. The question is, what does it all do and does it actually work? It appears to be the 'drain' code, but given it often results in this message: Shutdown socket .. and read 0 lingering bytes in 2 sec. then it would suggest it doesn't work. The comments also suggest the 2 seconds is guess work. I've sent SECONDS_TO_LINGER and MAX_SECS_TO_LINGER to 0 and the problem goes away, and I've seen this discussed elsewhere on the forum. So, if this code isn't needed, why is it still there? And if it is needed, why does it seem not to work and what is the correct figure for SECONDS_TO_LINGER? If this is being performed inline then I'd suggest 2s is far too long - clients don't want to wait 2s for a request to complete (ideally, socket clean up should not be done in this thread if any linger is required). John .. MAX_SECS_TO_LINGER= 30 SECONDS_TO_LINGER= 2 ... int jk_shutdown_socket(jk_sock_t sd, jk_logger_t *l) { ... /* Shut down the socket for write, which will send a FIN * to the peer. */ if (shutdown(sd, SHUT_WR)) { rc = jk_close_socket(sd, l); if (JK_IS_DEBUG_LEVEL(l)) jk_log(l, JK_LOG_DEBUG, Failed sending SHUT_WR for socket %d, sd); errno = save_errno; JK_TRACE_EXIT(l); return rc; } do { #ifdef HAVE_POLL struct pollfd fds; fds.fd = sd; fds.events = POLLIN; #else fd_set rs; FD_ZERO(rs); /* Read all data from the peer until we reach end-of-file * (FIN from peer) or we've exceeded our overall timeout. If the * backend does not send us bytes within 2 seconds * (a value pulled from Apache 1.3 which seems to work well), * close the connection. */ FD_SET(sd, rs); tv.tv_sec = timeout / 1000; tv.tv_usec = (timeout % 1000) * 1000; #endif rp = 0; #ifdef HAVE_POLL if (poll(fds, 1, timeout) 0) #else if (select((int)sd + 1, rs, NULL, NULL, tv) 0) #endif { do { #if defined(WIN32) || (defined(NETWARE) defined(__NOVELL_LIBC__)) rc = recv(sd, dummy[0], sizeof(dummy), 0); if (JK_IS_SOCKET_ERROR(rc)) JK_GET_SOCKET_ERRNO(); #else rc = read(sd, dummy[0], sizeof(dummy)); #endif if (rc 0) rp += rc; } while (JK_IS_SOCKET_ERROR(rc) (errno == EINTR || errno == EAGAIN)); if (rc 0) break; } else break; rd += rp; if (rp sizeof(dummy)) { if (timeout SECONDS_TO_LINGER) { /* Try once again with 1000 times smaller timeout * In our case 2 msec. */ timeout = SECONDS_TO_LINGER; continue; } /* We have read less then size of buffer * It's a good chance there will be no more data * to read. */ if ((rc = sononblock(sd))) { rc = jk_close_socket(sd, l); if (JK_IS_DEBUG_LEVEL(l)) jk_log(l, JK_LOG_DEBUG, error setting socket %d to nonblocking, sd); errno = save_errno; JK_TRACE_EXIT(l); return rc; } if (JK_IS_DEBUG_LEVEL(l)) jk_log(l, JK_LOG_DEBUG, shutting down the read side of socket %d, sd); shutdown(sd, SHUT_RD); break; } timeout = SECONDS_TO_LINGER * 1000; } while (difftime(time(NULL), start) MAX_SECS_TO_LINGER); rc = jk_close_socket(sd, l); if (JK_IS_DEBUG_LEVEL(l)) jk_log(l, JK_LOG_DEBUG, Shutdown socket %d and read %d lingering bytes in %d sec., sd, rd, (int)difftime(time(NULL), start)); errno = save_errno; JK_TRACE_EXIT(l); return rc; } - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: 2 second delays in mod_jk while maintaining workers
On 09/08/2010 05:08 PM, John Baker wrote: Hello, I don't thikn the shutdown call is to blame - I think it's the large pile of code below. i.e. everything below the if (shutdown(..)) below. The question is, what does it all do and does it actually work? It appears to be the 'drain' code, but given it often results in this message: Shutdown socket .. and read 0 lingering bytes in 2 sec. then it would suggest it doesn't work. The comments also suggest the 2 seconds is guess work. I've sent SECONDS_TO_LINGER and MAX_SECS_TO_LINGER to 0 and the problem goes away, and I've seen this discussed elsewhere on the forum. So, if this code isn't needed, why is it still there? And if it is needed, why does it seem not to work and what is the correct figure for SECONDS_TO_LINGER? If this is being performed inline then I'd suggest 2s is far too long - clients don't want to wait 2s for a request to complete (ideally, socket clean up should not be done in this thread if any linger is required). The code *is* required. It is used when the client disconnects while the backend still has some data in the AJP buffer. Drain is needed to read that excess data. If you can compile mod_jk and test, try adding some debug messages inside the poll loop. Anyhow, seems to me there is some sort of network problem you are facing. Have you been able to see the traffic using Wireshark? Regards -- ^TM - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: 2 second delays in mod_jk while maintaining workers
please can you remove me off the mailing list many thanks On Wed, Sep 8, 2010 at 4:29 PM, Mladen Turk mt...@apache.org wrote: On 09/08/2010 05:08 PM, John Baker wrote: Hello, I don't thikn the shutdown call is to blame - I think it's the large pile of code below. i.e. everything below the if (shutdown(..)) below. The question is, what does it all do and does it actually work? It appears to be the 'drain' code, but given it often results in this message: Shutdown socket .. and read 0 lingering bytes in 2 sec. then it would suggest it doesn't work. The comments also suggest the 2 seconds is guess work. I've sent SECONDS_TO_LINGER and MAX_SECS_TO_LINGER to 0 and the problem goes away, and I've seen this discussed elsewhere on the forum. So, if this code isn't needed, why is it still there? And if it is needed, why does it seem not to work and what is the correct figure for SECONDS_TO_LINGER? If this is being performed inline then I'd suggest 2s is far too long - clients don't want to wait 2s for a request to complete (ideally, socket clean up should not be done in this thread if any linger is required). The code *is* required. It is used when the client disconnects while the backend still has some data in the AJP buffer. Drain is needed to read that excess data. If you can compile mod_jk and test, try adding some debug messages inside the poll loop. Anyhow, seems to me there is some sort of network problem you are facing. Have you been able to see the traffic using Wireshark? Regards -- ^TM - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: 2 second delays in mod_jk while maintaining workers
On 09/08/2010 05:08 PM, John Baker wrote: The code *is* required. It is used when the client disconnects while the backend still has some data in the AJP buffer. Drain is needed to read that excess data. Why does it always report 0 bytes read? If you can compile mod_jk and test, try adding some debug messages inside the poll loop. Anyhow, seems to me there is some sort of network problem you are facing. That's next on my list. Have you been able to see the traffic using Wireshark? Not yet. Regards -- ^TM - 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: 2 second delays in mod_jk while maintaining workers
I think it would be helpful if you could walk us through the code. The shutdown function provides three error codes - the jk function doesn't check them, and the most likely is 'socket closed' (ie jboss closed it?), hence I'm unsure what the drain code is doing. --Original Message-- From: John Baker To: Tomcat Users List ReplyTo: Tomcat Users List Subject: Re: 2 second delays in mod_jk while maintaining workers Sent: 8 Sep 2010 16:41 On 09/08/2010 05:08 PM, John Baker wrote: The code *is* required. It is used when the client disconnects while the backend still has some data in the AJP buffer. Drain is needed to read that excess data. Why does it always report 0 bytes read? If you can compile mod_jk and test, try adding some debug messages inside the poll loop. Anyhow, seems to me there is some sort of network problem you are facing. That's next on my list. Have you been able to see the traffic using Wireshark? Not yet. Regards -- ^TM - 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
Fwd: Tomcat 5.0 which gets stuck
Hi, We are using Apache Tomcat 5.0 which gets stuck sometimes and needs a stop and restart. We are using Microsoft Windows 2000 Service Pack 4. Below is the error from the log file, Kindly provide some solution. 2010-09-07 10:33:38 StandardWrapperValve[IFSCoreServlet]: Servlet.service() for servlet IFSCoreServlet threw exception java.lang.IllegalStateException at org.apache.coyote.tomcat5.CoyoteResponseFacade.sendError(CoyoteResponseFacade.java:324) at com.infodata.ifs.core.IFSCoreServlet.sendError(IFSCoreServlet.java:1159) at com.infodata.ifs.core.IFSCoreServlet.service(IFSCoreServlet.java:1057) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) -- Thanks Regards, Sumeet G. Chitte | Software Engineer, IBM,EGL 'A' Block, Off Indiranagar, Kormagala Intermediate Ring Road, Bangalore : 560071 Mail: suchi...@in.ibm.com
Re: Fwd: Tomcat 5.0 which gets stuck
Looks like your application took too long to respond and by the time it tried to write to the output stream, it had been closed. Have you set any connection/socket timeouts? -Original Message- From: Sumeet Chitte chittesum...@gmail.com Date: Wed, 8 Sep 2010 21:48:31 To: users@tomcat.apache.org Reply-To: Tomcat Users List users@tomcat.apache.org Subject: Fwd: Tomcat 5.0 which gets stuck Hi, We are using Apache Tomcat 5.0 which gets stuck sometimes and needs a stop and restart. We are using Microsoft Windows 2000 Service Pack 4. Below is the error from the log file, Kindly provide some solution. 2010-09-07 10:33:38 StandardWrapperValve[IFSCoreServlet]: Servlet.service() for servlet IFSCoreServlet threw exception java.lang.IllegalStateException at org.apache.coyote.tomcat5.CoyoteResponseFacade.sendError(CoyoteResponseFacade.java:324) at com.infodata.ifs.core.IFSCoreServlet.sendError(IFSCoreServlet.java:1159) at com.infodata.ifs.core.IFSCoreServlet.service(IFSCoreServlet.java:1057) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) -- Thanks Regards, Sumeet G. Chitte | Software Engineer, IBM,EGL 'A' Block, Off Indiranagar, Kormagala Intermediate Ring Road, Bangalore : 560071 Mail: suchi...@in.ibm.com
Re: 2 second delays in mod_jk while maintaining workers
On 09/08/2010 05:51 PM, John Baker wrote: I think it would be helpful if you could walk us through the code. It is very simple actually. 1. shutdown write end of our connection to Tomcat This should cause the soket.read() in Tomcat to throw exception which is used to close the socket 2. use poll with 2 second timeout for POLLIN event poll() will return immediately if either the socket is closed by Tomcat or there is a data to read in which case read to a dummy buffer (drain) and wait for more data until the poll returns error or read returns error 3. close the socket So the reason why the poll breaks after 2 seconds is the timeout which shouldn't happen because we informed the Tomcat the our side of connection is closed. So it should eventually (after some latency depending on the CPU throttle close his side). Now, since this works most of the times, it's either that poll loop is running but the read returns 0 A simple debug message after rc = read(sd, dummy[0], sizeof(dummy)); eg. jk_log(l, JK_LOG_DEBUG, readed %d bytes from socked %d, rc, sd); Would help eliminate that situation. The fix would be to add if (rc == 0) { rc = -1; break; } Also you can add jk_log(l, JK_LOG_DEBUG, socked %d shutdown write side, sd); just before that 'do {' so we can have the info how long the shutdown call took. It would be helpful if you can apply that code and recompile. Regards -- ^TM - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 5.0 which gets stuck
I don't know what you mean by We are using Apache Tomcat 5.0 which gets stuck sometimes and needs a stop and restart but the stack trace you posted is almost certainly evidence of a bug in your code. It's an illegal state exception to try and send an error if you have already sent normal content in some way. Which you almost certainly have. So the stack trace shows a bug in your code. But what do you mean that tomcat gets stuck? What exact symptoms does this display. As to the other poster I am not sure what sort of guess that was but there is nothing in that stack trace relating to broken pipes, timeouts, broken sockets etc. This is an HTTP protocol error (caused by poorly written code) not a TCP level error. -Original Message- From: Sumeet Chitte [mailto:chittesum...@gmail.com] Sent: Wednesday, September 08, 2010 12:19 PM To: users@tomcat.apache.org Subject: Fwd: Tomcat 5.0 which gets stuck Hi, We are using Apache Tomcat 5.0 which gets stuck sometimes and needs a stop and restart. We are using Microsoft Windows 2000 Service Pack 4. Below is the error from the log file, Kindly provide some solution. 2010-09-07 10:33:38 StandardWrapperValve[IFSCoreServlet]: Servlet.service() for servlet IFSCoreServlet threw exception java.lang.IllegalStateException at org.apache.coyote.tomcat5.CoyoteResponseFacade.sendError(CoyoteResponseFacade.java:324) at com.infodata.ifs.core.IFSCoreServlet.sendError(IFSCoreServlet.java:1159) at com.infodata.ifs.core.IFSCoreServlet.service(IFSCoreServlet.java:1057) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) -- Thanks Regards, Sumeet G. Chitte | Software Engineer, IBM,EGL 'A' Block, Off Indiranagar, Kormagala Intermediate Ring Road, Bangalore : 560071 Mail: suchi...@in.ibm.com - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 5.0 which gets stuck
I thought an illegal state exception would occur if an attempt was made to write to a socket that's now shut but you are right, it looks more like an attempt to perform an internal redirect after response has been committed (although that message should appear in the logs). -Original Message- From: Maximilian Stocker m...@talentoyster.com Date: Wed, 8 Sep 2010 12:43:01 To: 'Tomcat Users List'users@tomcat.apache.org Reply-To: Tomcat Users List users@tomcat.apache.org Subject: RE: Tomcat 5.0 which gets stuck I don't know what you mean by We are using Apache Tomcat 5.0 which gets stuck sometimes and needs a stop and restart but the stack trace you posted is almost certainly evidence of a bug in your code. It's an illegal state exception to try and send an error if you have already sent normal content in some way. Which you almost certainly have. So the stack trace shows a bug in your code. But what do you mean that tomcat gets stuck? What exact symptoms does this display. As to the other poster I am not sure what sort of guess that was but there is nothing in that stack trace relating to broken pipes, timeouts, broken sockets etc. This is an HTTP protocol error (caused by poorly written code) not a TCP level error. -Original Message- From: Sumeet Chitte [mailto:chittesum...@gmail.com] Sent: Wednesday, September 08, 2010 12:19 PM To: users@tomcat.apache.org Subject: Fwd: Tomcat 5.0 which gets stuck Hi, We are using Apache Tomcat 5.0 which gets stuck sometimes and needs a stop and restart. We are using Microsoft Windows 2000 Service Pack 4. Below is the error from the log file, Kindly provide some solution. 2010-09-07 10:33:38 StandardWrapperValve[IFSCoreServlet]: Servlet.service() for servlet IFSCoreServlet threw exception java.lang.IllegalStateException at org.apache.coyote.tomcat5.CoyoteResponseFacade.sendError(CoyoteResponseFacade.java:324) at com.infodata.ifs.core.IFSCoreServlet.sendError(IFSCoreServlet.java:1159) at com.infodata.ifs.core.IFSCoreServlet.service(IFSCoreServlet.java:1057) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) -- Thanks Regards, Sumeet G. Chitte | Software Engineer, IBM,EGL 'A' Block, Off Indiranagar, Kormagala Intermediate Ring Road, Bangalore : 560071 Mail: suchi...@in.ibm.com - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 5.0 which gets stuck
Thank you for your response. I will tell you some more details. We are using an Powerbuilder application which calls the documents from server. This server uses a third party tool, which uses Apache Tomcat 5.0. What happens is that this Tomcat service gets stuck sometimes and the Powerbuilder application gets frozens because of this. If we go to the services it shows that the Tomcat services is still running but if we stop and restart this service the issue is resolved. Hope it gives you some more idea about the problem. On Wed, Sep 8, 2010 at 10:20 PM, John Baker jba...@javasystemsolutions.comwrote: I thought an illegal state exception would occur if an attempt was made to write to a socket that's now shut but you are right, it looks more like an attempt to perform an internal redirect after response has been committed (although that message should appear in the logs). -Original Message- From: Maximilian Stocker m...@talentoyster.com Date: Wed, 8 Sep 2010 12:43:01 To: 'Tomcat Users List'users@tomcat.apache.org Reply-To: Tomcat Users List users@tomcat.apache.org Subject: RE: Tomcat 5.0 which gets stuck I don't know what you mean by We are using Apache Tomcat 5.0 which gets stuck sometimes and needs a stop and restart but the stack trace you posted is almost certainly evidence of a bug in your code. It's an illegal state exception to try and send an error if you have already sent normal content in some way. Which you almost certainly have. So the stack trace shows a bug in your code. But what do you mean that tomcat gets stuck? What exact symptoms does this display. As to the other poster I am not sure what sort of guess that was but there is nothing in that stack trace relating to broken pipes, timeouts, broken sockets etc. This is an HTTP protocol error (caused by poorly written code) not a TCP level error. -Original Message- From: Sumeet Chitte [mailto:chittesum...@gmail.com] Sent: Wednesday, September 08, 2010 12:19 PM To: users@tomcat.apache.org Subject: Fwd: Tomcat 5.0 which gets stuck Hi, We are using Apache Tomcat 5.0 which gets stuck sometimes and needs a stop and restart. We are using Microsoft Windows 2000 Service Pack 4. Below is the error from the log file, Kindly provide some solution. 2010-09-07 10:33:38 StandardWrapperValve[IFSCoreServlet]: Servlet.service() for servlet IFSCoreServlet threw exception java.lang.IllegalStateException at org.apache.coyote.tomcat5.CoyoteResponseFacade.sendError(CoyoteResponseFacade.java:324) at com.infodata.ifs.core.IFSCoreServlet.sendError(IFSCoreServlet.java:1159) at com.infodata.ifs.core.IFSCoreServlet.service(IFSCoreServlet.java:1057) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) -- Thanks Regards, Sumeet G. Chitte | Software Engineer, IBM,EGL 'A' Block, Off Indiranagar, Kormagala Intermediate Ring Road, Bangalore : 560071 Mail: suchi...@in.ibm.com - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Thanks Regards, Sumeet G. Chitte | Software Engineer,
RE: Tomcat 5.0 which gets stuck
Tomcat is *not* getting stuck. There is a bug in com.infodata.ifs.core.IFSCoreServlet which is attempting to send an HTTP error *after* content has already been sent. On the otherwise this powerbuilder or whatever client is waiting for data that is never going to come because the application itself has error-ed out. The reason that restarting tomcat is fixing the issue is that is closing the socket etc and the client app assumes the connection is dead and retries. In short this is 100% an application programming error and you are in the wrong place to get help with it. Go start with finding and fixing (or reporting or whatever it is you need to do) the bug in com.infodata.ifs.core.IFSCoreServlet -Original Message- From: Sumeet Chitte [mailto:chittesum...@gmail.com] Sent: Wednesday, September 08, 2010 2:03 PM To: Tomcat Users List; jba...@javasystemsolutions.com Subject: Re: Tomcat 5.0 which gets stuck Thank you for your response. I will tell you some more details. We are using an Powerbuilder application which calls the documents from server. This server uses a third party tool, which uses Apache Tomcat 5.0. What happens is that this Tomcat service gets stuck sometimes and the Powerbuilder application gets frozens because of this. If we go to the services it shows that the Tomcat services is still running but if we stop and restart this service the issue is resolved. Hope it gives you some more idea about the problem. On Wed, Sep 8, 2010 at 10:20 PM, John Baker jba...@javasystemsolutions.comwrote: I thought an illegal state exception would occur if an attempt was made to write to a socket that's now shut but you are right, it looks more like an attempt to perform an internal redirect after response has been committed (although that message should appear in the logs). -Original Message- From: Maximilian Stocker m...@talentoyster.com Date: Wed, 8 Sep 2010 12:43:01 To: 'Tomcat Users List'users@tomcat.apache.org Reply-To: Tomcat Users List users@tomcat.apache.org Subject: RE: Tomcat 5.0 which gets stuck I don't know what you mean by We are using Apache Tomcat 5.0 which gets stuck sometimes and needs a stop and restart but the stack trace you posted is almost certainly evidence of a bug in your code. It's an illegal state exception to try and send an error if you have already sent normal content in some way. Which you almost certainly have. So the stack trace shows a bug in your code. But what do you mean that tomcat gets stuck? What exact symptoms does this display. As to the other poster I am not sure what sort of guess that was but there is nothing in that stack trace relating to broken pipes, timeouts, broken sockets etc. This is an HTTP protocol error (caused by poorly written code) not a TCP level error. -Original Message- From: Sumeet Chitte [mailto:chittesum...@gmail.com] Sent: Wednesday, September 08, 2010 12:19 PM To: users@tomcat.apache.org Subject: Fwd: Tomcat 5.0 which gets stuck Hi, We are using Apache Tomcat 5.0 which gets stuck sometimes and needs a stop and restart. We are using Microsoft Windows 2000 Service Pack 4. Below is the error from the log file, Kindly provide some solution. 2010-09-07 10:33:38 StandardWrapperValve[IFSCoreServlet]: Servlet.service() for servlet IFSCoreServlet threw exception java.lang.IllegalStateException at org.apache.coyote.tomcat5.CoyoteResponseFacade.sendError(CoyoteResponseFacade.java:324) at com.infodata.ifs.core.IFSCoreServlet.sendError(IFSCoreServlet.java:1159) at com.infodata.ifs.core.IFSCoreServlet.service(IFSCoreServlet.java:1057) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at
RE: Tomcat 5.0 which gets stuck
From: Sumeet Chitte [mailto:chittesum...@gmail.com] Subject: Re: Tomcat 5.0 which gets stuck This server uses a third party tool, which uses Apache Tomcat 5.0. Please be aware that Tomcat 5.0 is deprecated. You are much more likely to get help if you are running on a current level. What happens is that this Tomcat service gets stuck sometimes and the Powerbuilder application gets frozens because of this. Take a thread dump and see what's going on. http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F - 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 5.0 which gets stuck
Thank you some much for your help in such a short time. Thank you for showing me the right direction to work on. On Wed, Sep 8, 2010 at 11:39 PM, Maximilian Stocker m...@talentoyster.comwrote: Tomcat is *not* getting stuck. There is a bug in com.infodata.ifs.core.IFSCoreServlet which is attempting to send an HTTP error *after* content has already been sent. On the otherwise this powerbuilder or whatever client is waiting for data that is never going to come because the application itself has error-ed out. The reason that restarting tomcat is fixing the issue is that is closing the socket etc and the client app assumes the connection is dead and retries. In short this is 100% an application programming error and you are in the wrong place to get help with it. Go start with finding and fixing (or reporting or whatever it is you need to do) the bug in com.infodata.ifs.core.IFSCoreServlet -Original Message- From: Sumeet Chitte [mailto:chittesum...@gmail.com] Sent: Wednesday, September 08, 2010 2:03 PM To: Tomcat Users List; jba...@javasystemsolutions.com Subject: Re: Tomcat 5.0 which gets stuck Thank you for your response. I will tell you some more details. We are using an Powerbuilder application which calls the documents from server. This server uses a third party tool, which uses Apache Tomcat 5.0. What happens is that this Tomcat service gets stuck sometimes and the Powerbuilder application gets frozens because of this. If we go to the services it shows that the Tomcat services is still running but if we stop and restart this service the issue is resolved. Hope it gives you some more idea about the problem. On Wed, Sep 8, 2010 at 10:20 PM, John Baker jba...@javasystemsolutions.comwrote: I thought an illegal state exception would occur if an attempt was made to write to a socket that's now shut but you are right, it looks more like an attempt to perform an internal redirect after response has been committed (although that message should appear in the logs). -Original Message- From: Maximilian Stocker m...@talentoyster.com Date: Wed, 8 Sep 2010 12:43:01 To: 'Tomcat Users List'users@tomcat.apache.org Reply-To: Tomcat Users List users@tomcat.apache.org Subject: RE: Tomcat 5.0 which gets stuck I don't know what you mean by We are using Apache Tomcat 5.0 which gets stuck sometimes and needs a stop and restart but the stack trace you posted is almost certainly evidence of a bug in your code. It's an illegal state exception to try and send an error if you have already sent normal content in some way. Which you almost certainly have. So the stack trace shows a bug in your code. But what do you mean that tomcat gets stuck? What exact symptoms does this display. As to the other poster I am not sure what sort of guess that was but there is nothing in that stack trace relating to broken pipes, timeouts, broken sockets etc. This is an HTTP protocol error (caused by poorly written code) not a TCP level error. -Original Message- From: Sumeet Chitte [mailto:chittesum...@gmail.com] Sent: Wednesday, September 08, 2010 12:19 PM To: users@tomcat.apache.org Subject: Fwd: Tomcat 5.0 which gets stuck Hi, We are using Apache Tomcat 5.0 which gets stuck sometimes and needs a stop and restart. We are using Microsoft Windows 2000 Service Pack 4. Below is the error from the log file, Kindly provide some solution. 2010-09-07 10:33:38 StandardWrapperValve[IFSCoreServlet]: Servlet.service() for servlet IFSCoreServlet threw exception java.lang.IllegalStateException at org.apache.coyote.tomcat5.CoyoteResponseFacade.sendError(CoyoteResponseFacade.java:324) at com.infodata.ifs.core.IFSCoreServlet.sendError(IFSCoreServlet.java:1159) at com.infodata.ifs.core.IFSCoreServlet.service(IFSCoreServlet.java:1057) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at
Custom message instead of HTTP error on LimitRequestBody
Apache 2: Is there a way to send custom message instead of just the Error Code when there is an upload limit set using LimitRequestBody? Something like You have exceeded the size - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Custom message instead of HTTP error on LimitRequestBody
Sorry wrong email group On Wed, Sep 8, 2010 at 1:37 PM, Mohit Anchlia mohitanch...@gmail.com wrote: Apache 2: Is there a way to send custom message instead of just the Error Code when there is an upload limit set using LimitRequestBody? Something like You have exceeded the size - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Best practice to upgrade (redeploy) .war files
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rainer, On 9/3/2010 2:53 AM, Rainer Frey wrote: And if you use cold deployment only, how do you avoid downtime for other apps? Do you really use one Tomcat instance per app? I use one Tomcat instance per webapp, and I use cold deployment only. I'd really like to hear some input / experiences about production use with several applications with independent release/deploy cycles. I haven't done it, but Tomcat should be able to do hot re-deployment by simply copying the new WAR file over the old one. Is that not an option for you? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyH9tAACgkQ9CaO5/Lv0PAGZACZAYxnXtSSmMZnrevu0yoBcb6f 268AoJngGzj8GqX3iHPD1vzawYVc1L+/ =1wq9 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Problems with SSI
I've tried following all of the advice in the previous threads, but I'm up against a wall here. I have added Context privileged=true to my context.xml In the same directory, i have uncommented the SSI Filter as well as the Filter mapping and the *.shtml mime mapping in web.xml. see below: filter filter-namessi/filter-name filter-class org.apache.catalina.ssi.SSIFilter /filter-class init-param param-namecontentType/param-name param-valuetext/x-server-parsed-html(;.*)?/param-value /init-param init-param param-namedebug/param-name param-value0/param-value /init-param init-param param-nameexpires/param-name param-value666/param-value /init-param init-param param-nameisVirtualWebappRelative/param-name param-value0/param-value /init-param /filter filter-mapping filter-namessi/filter-name url-pattern*.shtml/url-pattern /filter-mapping mime-mapping extensionshtml/extension mime-typetext/x-server-parsed-html/mime-type /mime-mapping Finally, i have a file called test.shtml that has the following code: !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titletester/title /head body hi there !-- #include file=/inc.html -- /body The inc.html file is in the same directory as the test.html file. when I run the file, i simply see the hi there and none of the contents of the inc.html file. 1. i don't have the invoker servlet un-commented. is this required? 2. i got totally lost on the reg -exp discussions. i am not in the IT world and it was simply beyond my skill set. Anybody have an idea where I've gone wrong? Much appreciated. jeff -- View this message in context: http://old.nabble.com/Problems-with-SSI-tp29645388p29645388.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Problems with SSI
I've tried following all of the advice in the previous threads, but I'm up against a wall here. I have added Context privileged=true to my context.xml In the same directory, i have uncommented the SSI Filter as well as the Filter mapping and the *.shtml mime mapping in web.xml. see below: filter filter-namessi/filter-name filter-class org.apache.catalina.ssi.SSIFilter /filter-class init-param param-namecontentType/param-name param-valuetext/x-server-parsed-html(;.*)?/param-value /init-param init-param param-namedebug/param-name param-value0/param-value /init-param init-param param-nameexpires/param-name param-value666/param-value /init-param init-param param-nameisVirtualWebappRelative/param-name param-value0/param-value /init-param /filter filter-mapping filter-namessi/filter-name url-pattern*.shtml/url-pattern /filter-mapping mime-mapping extensionshtml/extension mime-typetext/x-server-parsed-html/mime-type /mime-mapping Finally, i have a file called test.shtml that has the following code: !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titletester/title /head body hi there !-- #include file=/inc.html -- /body The inc.html file is in the same directory as the test.html file. when I run the file, i simply see the hi there and none of the contents of the inc.html file. 1. i don't have the invoker servlet un-commented. is this required? 2. i got totally lost on the reg -exp discussions. i am not in the IT world and it was simply beyond my skill set. Anybody have an idea where I've gone wrong? Much appreciated. jeff -- View this message in context: http://old.nabble.com/Problems-with-SSI-tp29645463p29645463.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Problems with SSI
I've tried following all of the advice in the previous threads, but I'm up against a wall here. I have added Context privileged=true to my context.xml In the same directory, i have uncommented the SSI Filter as well as the Filter mapping and the *.shtml mime mapping in web.xml. see below: filter filter-namessi/filter-name filter-class org.apache.catalina.ssi.SSIFilter /filter-class init-param param-namecontentType/param-name param-valuetext/x-server-parsed-html(;.*)?/param-value /init-param init-param param-namedebug/param-name param-value0/param-value /init-param init-param param-nameexpires/param-name param-value666/param-value /init-param init-param param-nameisVirtualWebappRelative/param-name param-value0/param-value /init-param /filter filter-mapping filter-namessi/filter-name url-pattern*.shtml/url-pattern /filter-mapping mime-mapping extensionshtml/extension mime-typetext/x-server-parsed-html/mime-type /mime-mapping Finally, i have a file called test.shtml that has the following code: !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titletester/title /head body hi there !-- #include file=/inc.html -- /body The inc.html file is in the same directory as the test.html file. when I run the file, i simply see the hi there and none of the contents of the inc.html file. 1. i don't have the invoker servlet un-commented. is this required? 2. i got totally lost on the reg -exp discussions. i am not in the IT world and it was simply beyond my skill set. Anybody have an idea where I've gone wrong? Much appreciated. jeff -- View this message in context: http://old.nabble.com/Problems-with-SSI-tp29645512p29645512.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problems with SSI
jeffo1b wrote: I've tried following all of the advice in the previous threads, but I'm up against a wall here. I have added Context privileged=true to my context.xml In the same directory, i have uncommented the SSI Filter as well as the Filter mapping and the *.shtml mime mapping in web.xml. see below: Hi. I have not really followed the discussion so far, but something sounds iffy in what you say above : the in the same directory part. The web.xml and context.xml files of a web application should not be in the same directory, as far as I recall. I believe it is : $CATALINA_BASE/webapps/your-webapp/WEB-INF/web.xml $CATALINA_BASE/webapps/your-webapp/META-INF/context.xml Can you re-check exactly what the previous helpers told you, to see if you did not miss something there ? And/or browse through this page : http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html (although if your are not an IT guy, I feel that you are not going to enjoy this. But at least it shows the locations of things, which you could compare with yours). (And $CATALINA_BASE/ means the top directory of the Tomcat installation). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Best practice for running Tomcat on port 80
On Tue, Sep 7, 2010 at 3:40 PM, Pid p...@pidster.com wrote: On 07/09/2010 06:14, jan gestre wrote: On Tue, Sep 7, 2010 at 1:02 PM, Wesley Acheson wesley.ache...@gmail.com wrote: On Tue, Sep 7, 2010 at 4:34 AM, jan gestre ipcopper...@gmail.com wrote: I'm using the latest 6.0.29 binary distribution, and I don't have an idea where to download jsvc, if it's already included I don't know the location, could someone please enlighten me on how to do this. It can be downloaded as part of this bundle http://commons.apache.org/daemon/download_daemon.cgi. Instructions are here http://commons.apache.org/daemon/jsvc.html. Dunno how to use it even after reading the instructions though. Conveniently, the binary you need is included in tomcat/bin: commons-daemon-native.tar.gz I'll assume Linux, as you didn't state explicitly which OS you're using. tar -zxvf commons-daemon-native.tar.gz cd commons-daemon-1.0.2-native-src more RELEASE-NOTES.txt cd unix more INSTALL.txt ... follow the instructions therein. p Hi Pid, I've followed your instructions and was able to create the executable jsvc however I don't know the next step, should I incorporate jsvc to tomcat's init.d script, and change server.xml respectively? If yes, how will I do it? Tomcat is running as an unprivilege user. Here is my tomcat start up file and server.xml if it matters #!/bin/bash # # tomcat Starts Tomcat Java server. # # # chkconfig: 345 88 12 # description: Tomcat is the server for # Java servlet applications. ### BEGIN INIT INFO # Provides: $tomcat ### END INIT INFO JAVA_HOME=/usr/java/jdk1.6.0_21 export JAVA_HOME TOMCAT_HOME=/usr/src/tomcat/bin START_TOMCAT=/usr/src/tomcat/bin/startup.sh STOP_TOMCAT=/usr/src/tomcat/bin/shutdown.sh # Source function library. . /etc/init.d/functions [ -f $START_TOMCAT ] || exit 0 [ -f $STOP_TOMCAT ] || exit 0 RETVAL=0 umask 077 start() { echo -n $Starting Tomcat Java server: daemon su -c $START_TOMCAT tomcat echo return $RETVAL } stop() { echo -n $Shutting down Tomcat Java server: daemon su -c $STOP_TOMCAT tomcat echo return $RETVAL } restart() { stop start } case $1 in start) start ;; stop) stop ;; restart|reload) restart ;; *) echo $Usage: $0 {start|stop|restart} exit 1 esac exit $? - server.xml ?xml version='1.0' encoding='utf-8'? Server port=8005 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.core.JreMemoryLeakPreventionListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / GlobalNamingResources Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8080 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8443 / Connector port=8009 protocol=AJP/1.3 redirectPort=8443 / Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host /Engine /Service /Server - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org