Re: Chasing a SocketTimeoutException with APR
On 29 Mar 2012, at 12:57, Osipov, Michael michael.osi...@siemens.com wrote: Hi folks, I am trying to narrow down an exception which is happening occasionally in certain spots of your code: SCHWERWIEGEND: Servlet.service() for servlet default threw exception Java.net.SocketTimeoutException at org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:796) ... The problematic spot in that file is: if ((-nRead) == Status.ETIMEDOUT || (-nRead) == Status.TIMEUP) { throw new SocketTimeoutException(sm.getString(iib.failedread)) Not to mention that 'iib.failedread' does not exists in the properties file, I cannot localize the failing point whether it's the client who's resetting/closing the connection or is it libtcnative? My client code does this: private JSONObject getJSON(HttpServletRequest request) throws IOException { String jsonBody = IOUtils.toString(request.getInputStream(), UTF-8); return JSONObject.fromObject(jsonBody); } Is there any clue where I can start digging for this problem? If the client (IE) is failing, I can't do anything about it but if my code is the problem... Can you switch to the NIO connector and see if a similar issue occurs? p I am on bash $ uname -a HP-UX blnn725x B.11.23 U ia64 bash $ /opt/java6/bin/java -version java version 1.6.0.13 Java(TM) SE Runtime Environment (build 1.6.0.13-jinteg_01_dec_2011_03_39-b00) Java HotSpot(TM) Server VM (build 20.3-b02-jre1.6.0.13-rc1b1, mixed mode) Tomcat 6.0.35 Libtcnative 1.1.22 Client IE8 on Windows XP. With best regards, Michael OsipovТ�ХF�V�7V'67�R�R���âW6W'2�V�7V'67�TF��6B�6�R��pФf�FF�F����6����G2�R���âW6W'2ֆV�F��6B�6�R��pР - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Chasing a SocketTimeoutException with APR
Pid * wrote: On 29 Mar 2012, at 12:57, Osipov, Michael michael.osi...@siemens.com wrote: Hi folks, I am trying to narrow down an exception which is happening occasionally in certain spots of your code: SCHWERWIEGEND: Servlet.service() for servlet default threw exception Java.net.SocketTimeoutException at org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:796) ... The problematic spot in that file is: if ((-nRead) == Status.ETIMEDOUT || (-nRead) == Status.TIMEUP) { throw new SocketTimeoutException(sm.getString(iib.failedread)) Not to mention that 'iib.failedread' does not exists in the properties file, I cannot localize the failing point whether it's the client who's resetting/closing the connection or is it libtcnative? My client code does this: private JSONObject getJSON(HttpServletRequest request) throws IOException { String jsonBody = IOUtils.toString(request.getInputStream(), UTF-8); return JSONObject.fromObject(jsonBody); } Is there any clue where I can start digging for this problem? If the client (IE) is failing, I can't do anything about it but if my code is the problem... Can you switch to the NIO connector and see if a similar issue occurs? Not on the production system. We are using APR with SSL, so I did not create Java compatible SSL keys. I can try on an integration system but this error happens sporadically on this method. Mike
RE: [JDBC Pool] PoolCleaner creates some sort of memory
Filip Hanik (mailing lists) wrote: http://svn.apache.org/viewvc?view=revisionrevision=1306946 Thanks for the patch, I am having trouble to build from source. I do have some test failures, should I ignore them and go on? Another one, can we have a clearer name for the thread, e.g. like the I have suggested in a previous mail? Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [JDBC Pool] PoolCleaner creates some sort of memory
2012/3/30 Osipov, Michael michael.osi...@siemens.com: Filip Hanik (mailing lists) wrote: http://svn.apache.org/viewvc?view=revisionrevision=1306946 Thanks for the patch, I am having trouble to build from source. I do have some test failures, should I ignore them and go on? Please be more specific. In what tests? Another one, can we have a clearer name for the thread, e.g. like the I have suggested in a previous mail? Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [JDBC Pool] PoolCleaner creates some sort of memory
Konstantin Kolinko wrote: 2012/3/30 Osipov, Michael michael.osi...@siemens.com: Filip Hanik (mailing lists) wrote: http://svn.apache.org/viewvc?view=revisionrevision=1306946 Thanks for the patch, I am having trouble to build from source. I do have some test failures, should I ignore them and go on? Please be more specific. In what tests? Have a look at this: http://pastebin.com/kiHLF6D9 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Chasing a SocketTimeoutException with APR
2012/3/29 Osipov, Michael michael.osi...@siemens.com: Hi folks, I am trying to narrow down an exception which is happening occasionally in certain spots of your code: SCHWERWIEGEND: Servlet.service() for servlet default threw exception Java.net.SocketTimeoutException at org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:796) ... The problematic spot in that file is: if ((-nRead) == Status.ETIMEDOUT || (-nRead) == Status.TIMEUP) { throw new SocketTimeoutException(sm.getString(iib.failedread)) Not to mention that 'iib.failedread' does not exists in the properties file, I cannot localize the failing point whether it's the client who's resetting/closing the connection or is it libtcnative? It says timeout and it occurs while reading, so I would say that the client is slow at delivering data (disappeared without closing the connection), so read operation times out. The native side (network.c in native/branches/1.1.x/native/src) just calls (tcn_nlayer_t)-recv, which has two different implementations, depending on whether ssl is used or not used (network.c vs sslnetwork.c). The timeout on the socket should be configurable (probably see AprEndpoint#setSocketOptions(..)), but I do not see specific mention of that option in the documentation. It is a bit strange that soTimeout in setSocketOptions() is multiplied by 1000. I'd expect the option to be in milliseconds, like documented options. I cannot say without digging further into the code -- maybe it is divided by 1000 somewhere else. My client code does this: private JSONObject getJSON(HttpServletRequest request) throws IOException { String jsonBody = IOUtils.toString(request.getInputStream(), UTF-8); return JSONObject.fromObject(jsonBody); } Is there any clue where I can start digging for this problem? If the client (IE) is failing, I can't do anything about it but if my code is the problem... I am on bash $ uname -a HP-UX blnn725x B.11.23 U ia64 bash $ /opt/java6/bin/java -version java version 1.6.0.13 Java(TM) SE Runtime Environment (build 1.6.0.13-jinteg_01_dec_2011_03_39-b00) Java HotSpot(TM) Server VM (build 20.3-b02-jre1.6.0.13-rc1b1, mixed mode) Tomcat 6.0.35 Libtcnative 1.1.22 Client IE8 on Windows XP. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Chasing a SocketTimeoutException with APR
Konstantin Kolinko wrote: 2012/3/29 Osipov, Michael michael.osi...@siemens.com: Hi folks, I am trying to narrow down an exception which is happening occasionally in certain spots of your code: SCHWERWIEGEND: Servlet.service() for servlet default threw exception Java.net.SocketTimeoutException at org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:796) ... The problematic spot in that file is: if ((-nRead) == Status.ETIMEDOUT || (-nRead) == Status.TIMEUP) { throw new SocketTimeoutException(sm.getString(iib.failedread)) Not to mention that 'iib.failedread' does not exists in the properties file, I cannot localize the failing point whether it's the client who's resetting/closing the connection or is it libtcnative? It says timeout and it occurs while reading, so I would say that the client is slow at delivering data (disappeared without closing the connection), so read operation times out. The native side (network.c in native/branches/1.1.x/native/src) just calls (tcn_nlayer_t)-recv, which has two different implementations, depending on whether ssl is used or not used (network.c vs sslnetwork.c). The timeout on the socket should be configurable (probably see AprEndpoint#setSocketOptions(..)), but I do not see specific mention of that option in the documentation. It is a bit strange that soTimeout in setSocketOptions() is multiplied by 1000. I'd expect the option to be in milliseconds, like documented options. I cannot say without digging further into the code -- maybe it is divided by 1000 somewhere else. According to Http11AprProtocol.java#L68 the default socket timeout is set to 60 000 milliseconds. The reson for x1000 is: /** * Setup socket timeout for the specified socket * @param sock The socket to set up. * @param t Value for the timeout in microseconds. So 60 seconds of timeout should be enough? Mike - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Chasing a SocketTimeoutException with APR
2012/3/30 Osipov, Michael michael.osi...@siemens.com: Konstantin Kolinko wrote: 2012/3/29 Osipov, Michael michael.osi...@siemens.com: Hi folks, I am trying to narrow down an exception which is happening occasionally in certain spots of your code: SCHWERWIEGEND: Servlet.service() for servlet default threw exception Java.net.SocketTimeoutException at org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:796) ... The problematic spot in that file is: if ((-nRead) == Status.ETIMEDOUT || (-nRead) == Status.TIMEUP) { throw new SocketTimeoutException(sm.getString(iib.failedread)) Not to mention that 'iib.failedread' does not exists in the properties file, I cannot localize the failing point whether it's the client who's resetting/closing the connection or is it libtcnative? It says timeout and it occurs while reading, so I would say that the client is slow at delivering data (disappeared without closing the connection), so read operation times out. The native side (network.c in native/branches/1.1.x/native/src) just calls (tcn_nlayer_t)-recv, which has two different implementations, depending on whether ssl is used or not used (network.c vs sslnetwork.c). The timeout on the socket should be configurable (probably see AprEndpoint#setSocketOptions(..)), but I do not see specific mention of that option in the documentation. It is a bit strange that soTimeout in setSocketOptions() is multiplied by 1000. I'd expect the option to be in milliseconds, like documented options. I cannot say without digging further into the code -- maybe it is divided by 1000 somewhere else. According to Http11AprProtocol.java#L68 the default socket timeout is set to 60 000 milliseconds. The reson for x1000 is: /** * Setup socket timeout for the specified socket * @param sock The socket to set up. * @param t Value for the timeout in microseconds. So 60 seconds of timeout should be enough? OK, understood. There is Collector.java L291 replacements.put(connectionTimeout, soTimeout); The connectionTimeout attribute of Connector in default server.xml is explicitly configured to be 2. I do not know what value is in your server.xml file. (This 2 vs 6 difference is known and is mentioned in TC7 docs). Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Chasing a SocketTimeoutException with APR
Konstantin Kolinko wrote: 2012/3/30 Osipov, Michael michael.osi...@siemens.com: Konstantin Kolinko wrote: 2012/3/29 Osipov, Michael michael.osi...@siemens.com: Hi folks, I am trying to narrow down an exception which is happening occasionally in certain spots of your code: SCHWERWIEGEND: Servlet.service() for servlet default threw exception Java.net.SocketTimeoutException at org.apache.coyote.http11.InternalAprInputBuffer.fill(InternalAprInputBuffer.java:796) ... The problematic spot in that file is: if ((-nRead) == Status.ETIMEDOUT || (-nRead) == Status.TIMEUP) { throw new SocketTimeoutException(sm.getString(iib.failedread)) Not to mention that 'iib.failedread' does not exists in the properties file, I cannot localize the failing point whether it's the client who's resetting/closing the connection or is it libtcnative? It says timeout and it occurs while reading, so I would say that the client is slow at delivering data (disappeared without closing the connection), so read operation times out. The native side (network.c in native/branches/1.1.x/native/src) just calls (tcn_nlayer_t)-recv, which has two different implementations, depending on whether ssl is used or not used (network.c vs sslnetwork.c). The timeout on the socket should be configurable (probably see AprEndpoint#setSocketOptions(..)), but I do not see specific mention of that option in the documentation. It is a bit strange that soTimeout in setSocketOptions() is multiplied by 1000. I'd expect the option to be in milliseconds, like documented options. I cannot say without digging further into the code -- maybe it is divided by 1000 somewhere else. According to Http11AprProtocol.java#L68 the default socket timeout is set to 60 000 milliseconds. The reson for x1000 is: /** * Setup socket timeout for the specified socket * @param sock The socket to set up. * @param t Value for the timeout in microseconds. So 60 seconds of timeout should be enough? OK, understood. There is Collector.java L291 replacements.put(connectionTimeout, soTimeout); The connectionTimeout attribute of Connector in default server.xml is explicitly configured to be 2. I do not know what value is in your server.xml file. My server.xml says 5000 milliseconds for connection timeout. I should increase that value and check for a few days. Mike - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
AW: FormAuthentication Valve changes fail with RequestListeners?
Hi, thank you for the information. We have not succeeded so far. I want to give you some more information what happens, the context.xml and the web.xml What we have changed versus the existing setup, working on 7.0.11 - We have moved the login.jsp into the protection domain (was outside before). This did not remove the issue. - We have changed the preemptiveAuthentication setting. This did not remove the issue. This is the flow through the system that we can see: Client sends request to /portal /portal is not protected /portal/jsp/main.jsp is welcome page and protected (see web.xml) portal context configures formauthentication on the protection domain Tomcat redirects/forwards incoming call to /jsp/login.jsp (protected resource) FormAuthentication Valve is called Request Listener is called (expected: principal is null - OK!) jsp/login.jsp is displayed, waiting for user User adds information, press submit Client sends request to j_security_check is initiated by browser with form data (something happens here?) Realm is called: Authentication succeeds, realm creates principal Realm provides its own implementation of Principal Object Realm uses different table-structure than original DataSource Realm (something happens here?) Request Listener is called (expected: principal is not null - FAILS!) (something happens here?) jsp/main.jsp is called, principal in request is not null - can be dumped to the JSP view Following here is the used context.xml --- 8 -- ?xml version=1.0 encoding=UTF-8? Context antiJARLocking=false antiResourceLocking=false fireRequestListenersOnForwards=true preemptiveAuthentication=true Valve className=org.apache.catalina.valves.AccessLogValve fileDateFormat=-MM-dd pattern=%h %l %u %t quot;%rquot; %s %b quot;%{Referer}iquot; quot;%{User-Agent}iquot; prefix=portal-srs-standard. suffix=.log/ Valve className=org.apache.catalina.authenticator.FormAuthenticator changeSessionIdOnAuthentication=false alwaysUseSession=true landingPage=/jsp/main.jsp / ResourceLink global=pendb name=jdbc/DataSource type=javax.sql.DataSource/ WatchedResourceWEB-INF/web.xml/WatchedResource /Context --- 8 -- Follwing here is the web.xml --- 8 -- ?xml version=1.0 encoding=utf-8? web-app xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd; version=3.0 metadata-complete=true display-nameSRS Standard Portal - PDX Application/display-name filter filter-nameCharacterEncodingFilter/filter-name filter-classde.srs.pen.portal.utils.server.filter.SetCharacterEncodingFilt er/filter-class init-param param-nameignore/param-name param-valuefalse/param-value /init-param /filter filter filter-nameRequestDumper/filter-name filter-class org.apache.catalina.filters.RequestDumperFilter /filter-class /filter filter-mapping filter-nameRequestDumper/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-nameCharacterEncodingFilter/filter-name url-pattern/*/url-pattern /filter-mapping !-- Listener -- listener listener-classde.srs.pen.portal.utils.server.servlet.PortalSessionManager /listener-class /listener listener listener-classde.srs.pen.portal.utils.server.ObjectLockHandler/listener-c lass /listener listener listener-classde.srs.pen.portal.utils.server.servlet.PortalRequestListener /listener-class /listener listener listener-classde.srs.pen.portal.app.server.PortalContextListener/listener -class /listener !-- Servlets und GWT Services -- servlet descriptionSingle point of entry fuer die Web Applikation/description display-nameDelegatingPortalServlet/display-name servlet-nameDelegatingPortalServlet/servlet-name servlet-classde.srs.pen.portal.utils.server.servlet.DelegatingPortalServic eServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet descriptiongets PDF for Instance/description display-nameDisplayPDFServlet/display-name servlet-nameDisplayPDFServlet/servlet-name servlet-classde.srs.pen.portal.utils.server.servlet.DisplayPDFServlet/ser vlet-class init-param param-nameDPI/param-name param-value120/param-value /init-param /servlet servlet display-nameDownloadServlet/display-name servlet-nameDownloadServlet/servlet-name
Re: FormAuthentication Valve changes fail with RequestListeners?
2012/3/30 Thomas Strauß t.stra...@srs-management.de: Hi, thank you for the information. We have not succeeded so far. I want to give you some more information what happens, the context.xml and the web.xml What we have changed versus the existing setup, working on 7.0.11 - We have moved the login.jsp into the protection domain (was outside before). This did not remove the issue. - We have changed the preemptiveAuthentication setting. This did not remove the issue. This is the flow through the system that we can see: Client sends request to /portal /portal is not protected /portal/jsp/main.jsp is welcome page and protected (see web.xml) portal context configures formauthentication on the protection domain Tomcat redirects/forwards incoming call to /jsp/login.jsp (protected resource) FormAuthentication Valve is called Request Listener is called (expected: principal is null - OK!) What is stacktrace at this point inside the listener? (e.g. (new Exception()).printStackTrace()); Maybe you can compare 7.0.26 and 7.0.11. IIRC there was some refactoring with regards to where the valves are placed and how listeners are called In 7.0.22 changelog: Error handling and request listeners are now handled in the StandardHostValve to ensure they wrap all Context level activity. Maybe something was missed there. jsp/login.jsp is displayed, waiting for user User adds information, press submit Client sends request to j_security_check is initiated by browser with form data (something happens here?) Realm is called: Authentication succeeds, realm creates principal Realm provides its own implementation of Principal Object Realm uses different table-structure than original DataSource Realm (something happens here?) Request Listener is called (expected: principal is not null - FAILS!) (something happens here?) jsp/main.jsp is called, principal in request is not null - can be dumped to the JSP view Following here is the used context.xml (...) BTW, if you want to run under debugger, the tips are here: https://wiki.apache.org/tomcat/FAQ/Developing#Debugging Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Running Tomcat as a Standalone desktop Application
We have a Web Application running under Tomcat on a Server. We now have a requirement that our users may not be connected to the internet. We are looking at moving our Web Application to a local disconnected desktop install, still running under TomCat. The target platform is Windows XP all the way up to windows 7. Not sure of the issues or road blocks we may encounter. We are looking for any help/insight on doing this. Has anyone tried this? -- View this message in context: http://tomcat.10.n6.nabble.com/Running-Tomcat-as-a-Standalone-desktop-Application-tp4671621p4671621.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: Running Tomcat as a Standalone desktop Application
On 30/03/2012 16:22, DaveNoth wrote: We have a Web Application running under Tomcat on a Server. We now have a requirement that our users may not be connected to the internet. We are looking at moving our Web Application to a local disconnected desktop install, still running under TomCat. The target platform is Windows XP all the way up to windows 7. Not sure of the issues or road blocks we may encounter. We are looking for any help/insight on doing this. Has anyone tried this? Is there a reason it would be different from running on, say, Windows server? p -- View this message in context: http://tomcat.10.n6.nabble.com/Running-Tomcat-as-a-Standalone-desktop-Application-tp4671621p4671621.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 -- [key:62590808] signature.asc Description: OpenPGP digital signature
High CPU with Tomcat 7.0.26 6.0.35
I am using Tomcat 6.0.16 in production. When I try to upgrade to Tomcat 6.0.35, I see high CPU (about 90% vs. about 20% for 6.0.16), all other things being equal, except that I had to set setBufferSize(16384) in HTTPResponse in order to disable chunked encoding (needed as some of my client appliances fail otherwise). I see the same high CPU issue even with Tomcat 7.0.26. Any help is greatly appreciated. Thanks Prasad - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org