OT: Connection timeout with HttpClient
One of our legacy applications is using Apache Commons HttpClient 3.1. POST call to one REST service is failing with "java.net.ConnectException: Connection timed out: connect" exception[1]. Timeout is occurring after one minute. To figure out where thread is spending all the time, I took multiple thread dumps. In all of them, thread is trying to create secure socket[2]. I am not seeing any thread pool issue. Also the target REST service is working properly with same payload while invoked from Postman. It is only failing consistently when going through the HttpClient. I am trying to figure out why it is taking so long in connecting to the socket. I am looking for suggestion on how to attack this one. Tomcat: 7.0.55 JRE: 1.8_92 -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 [1] java.net.ConnectException: Connection timed out: connect at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) at sun.security.ssl.SSLSocketImpl.(SSLSocketImpl.java:472) at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:153) at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:82) at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:127) at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) [2] "http-apr-18100-exec-5" #327 daemon prio=5 os_prio=0 tid=0x2efbf800 nid=0x2508 runnable [0x2e55d000] java.lang.Thread.State: RUNNABLE at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) - locked <0x00071a984780> (a java.net.TwoStacksPlainSocketImpl) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) at sun.security.ssl.SSLSocketImpl.(SSLSocketImpl.java:472) at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:153) at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:82) at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:127) at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: OT: Connection timeout with HttpClient
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Suvendu, On 7/23/19 07:39, Suvendu Sekhar Mondal wrote: > One of our legacy applications is using Apache Commons HttpClient > 3.1. POST call to one REST service is failing with > "java.net.ConnectException: Connection timed out: connect" > exception[1]. Timeout is occurring after one minute. To figure out > where thread is spending all the time, I took multiple thread > dumps. In all of them, thread is trying to create secure socket[2]. > I am not seeing any thread pool issue. Also the target REST service > is working properly with same payload while invoked from Postman. > It is only failing consistently when going through the HttpClient. > I am trying to figure out why it is taking so long in connecting to > the socket. I am looking for suggestion on how to attack this one. > > Tomcat: 7.0.55 JRE: 1.8_92 -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 Your version is Tomcat is quite old and contains numerous "important" publicly-known vulnerabilities. You should upgrade ASAP. The connection timeout you are seeing is on the client end: your client is connecting to another server and the server isn't responding fast enough. That's why your stack trace always shows the thread "creating a socket": it's trying to connect to the remote service and it's never completing. Since it's failing on "connect" and not "read", it's likely that there is a firewall between your client and the service you are trying to connect to which is dropping all packets instead of returning a "connection refused" response. So this isn't a problem with your code or with Tomcat. It's a problem between your client (which has the stack trace below) and the service that code is trying to call. - -chris > > [1] java.net.ConnectException: Connection timed out: connect at > java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method) at > java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.jav a:350) > > at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImp l.java:206) > at > java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java: 188) > > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at > java.net.Socket.connect(Socket.java:589) at > sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) at > sun.security.ssl.SSLSocketImpl.(SSLSocketImpl.java:472) at > sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImp l.java:153) > > at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSo cket(SSLProtocolSocketFactory.java:82) > at > org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.create Socket(SSLProtocolSocketFactory.java:127) > > at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:70 7) > at > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Http MethodDirector.java:387) > > at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMetho dDirector.java:171) > at > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java :397) > > at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3 23) > > [2] "http-apr-18100-exec-5" #327 daemon prio=5 os_prio=0 > tid=0x2efbf800 nid=0x2508 runnable [0x2e55d000] > java.lang.Thread.State: RUNNABLE at > java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method) at > java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.jav a:350) > > - - locked <0x00071a984780> (a java.net.TwoStacksPlainSocketImpl) > at > java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketI mpl.java:206) > > at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:18 8) > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at > java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at > java.net.Socket.connect(Socket.java:589) at > sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) at > sun.security.ssl.SSLSocketImpl.(SSLSocketImpl.java:472) at > sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImp l.java:153) > > at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSo cket(SSLProtocolSocketFactory.java:82) > at > org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.create Socket(SSLProtocolSocketFactory.java:127) > > at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:70 7) > at > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Http MethodDirector.java:387) > > at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMetho dDirector.java:171) > at > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java :397) > > at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3 23) > > - > > To unsubscribe, e-mail: users
tomcat7 jdbc pool seems blocked: PoolExhaustedException
HI??thank you for read this mail??In our product env??we get exception?? Caused by: org.apache.tomcat.jdbc.pool.PoolExhaustedException: [-cmd[system_intergration.enn_portal_login]-ip[10.11.87.126]] Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none available[size:300; busy:66; idle:0; lastwait:0]. the busy 66 and idle 0 is very lower than maxsize 300. we find threads block at pool return??213 occur??and borrow??226 occur?? ??the jstack like(i cannt find which thread holds 0x0006ea1415d8)?? 1?? java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x0006ea1415d8> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:870) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1199) at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:209) at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:285) at org.apache.tomcat.jdbc.pool.FairBlockingQueue.offer(FairBlockingQueue.java:95) at org.apache.tomcat.jdbc.pool.ConnectionPool.returnConnection(ConnectionPool.java:900) at org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:100) at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109) at org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor.invoke(AbstractCreateStatementInterceptor.java:61) at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109) at org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor.invoke(AbstractCreateStatementInterceptor.java:61) at org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer.invoke(ResetAbandonedTimer.java:63) at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109) at org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor.invoke(AbstractCreateStatementInterceptor.java:61) at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109) at org.apache.tomcat.jdbc.pool.TrapException.invoke(TrapException.java:41) at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109) at org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:80) at com.sun.proxy.$Proxy20.close(Unknown Source) at com.x.commons.database.tomcat.TomcatPoolImpl.returnConnection(qk:203) 2?? java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x0006ea1415d8> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:870) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1199) at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:209) at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:285) at org.apache.tomcat.jdbc.pool.FairBlockingQueue.poll(FairBlockingQueue.java:242) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:613) at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188) at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:128) at com.x.commons.database.tomcat.TomcatPoolImpl.getConnection(qk:149)
Sha-256 encrypted password not working
Hi Sir, I am using tomcat 9 for my application, I got an issue with a password while I am using normal password it is not working when I give the encrypted password it is working without any error Logs I am getting j avax.servlet.request.key_size:128 javax.servlet.request.ssl_session_mgr:org.apache.tomcat.util.net.jsse.JSSESupport@23c2d7e5 javax.servlet.request.cipher_suite:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 Thanks & Regards, Sandeep Vemuri.
Re: Sha-256 encrypted password not working
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Sandeep, On 7/23/19 12:55, Support wrote: > I am using tomcat 9 for my application, I got an issue with a > password while I am using normal password it is not working when I > give the encrypted password it is working without any error > > Logs I am getting j avax.servlet.request.key_size:128 > javax.servlet.request.ssl_session_mgr:org.apache.tomcat.util.net.jsse. JSSESupport@23c2d7e5 > > javax.servlet.request.cipher_suite:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 It's not clear what you are trying to do and what is not working. What is a "normal password"? What is an "encrypted password"? What does the TLS cipher suite have to do with either of those? - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl03cwQACgkQHPApP6U8 pFgYDxAAnlT5hEuvXhmiXd2p2+u2z+tHHmaFSM61UFfj1QFy/oe0W8r7iyt2yUE/ KCsn5ReYR71slr2AerSvaeKE3fB2W1HSQbYAKcvWBnQkDCCLBnJ5+HVcQpR43xcP dbFAAojbZJ394t6H5fMsBFGBKkhxJEluw90Xc4l7goT5tx0cg0btYhmocFT1GjGV ea+txYBCFZcQ2dxAnseCGQ+yXVGXf87fHTJyD3thQx2hd8xhJC/FBOUnM2b2nyNi SstbNnlLwkIcBDEQwuAgAOWIh2j06FIdTUzGDGkA+TZRoMo7uKANSze7ZS6FJ8mM mGj9g2KVqy6yQSeWcxcvWfepjaUDmNUMqaSpw1CkL3NWikyDM9kQZ1+ib8OkJrhL fvl3PXrd3C/agqpX0SIfLaIhW02PnnzAHJo5Sa5C1p0l0l3REZAsDHkq9DG4ZHqx W0jLrSZZNBAYnHwD0VXHVe55pggKtyQEZmy37Avw97VfdsNX069ETUWEmFC55vYv KZa51vunnvb4r/sdwZm00JFuxg0uAmP4mWDLJYswo+ptG3haJji5jOam4G9eXvqu C/AQ3052iCOoMBdY09UZfiAjWU/pAAwpYCuv5gH9lxhv59jj/eQ9JAhPTB6IAGDP Rj5IiSTMVBosjbxeH4lfhHIpKdNBBnH8CLHvkArFUWkvbxacbqk= =JTKx -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
why is ContextListener.attributeAdded means?
Dear experts, I need some help again. I am trying to get a html page out on my browser, I changed my Tomcat server as the previous one has some Ant script 'creeping in when I downloaded an example'. However, I do not know why am I receiving an error message ? Background :- - Netbean IDE Windows OS Tomcat 9.0.12 JEE Error Message : 24-Jul-2019 10:03:27.271 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized() 24-Jul-2019 10:03:27.271 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized() 24-Jul-2019 10:03:27.292 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@4fa4f485') Can I know why there is a ContextListner:attributeAdded('StockTicer', 'async.Stockticker@4fa4f485') as appeared in the log ? How do I make it go away so that I can run my webApp ? Thank you for your help. Karen - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: why is ContextListener.attributeAdded means?
Hi Goh, It’s part of standard tomcat logging for servlet ctx init audit. Check logging.properties file in your conf/ directory. You should be able to change the level and tune how much logging is needed. And btw, it’s an INFO, not ERROR/FATAL/SEVERE. Thanks, On Wed, 24 Jul 2019 at 11:42, Karen Goh wrote: > Dear experts, > > I need some help again. > > I am trying to get a html page out on my browser, I changed my Tomcat > server as the previous one has some Ant script 'creeping in when I > downloaded an example'. However, I do not know why am I receiving an error > message ? > > Background :- > - > Netbean IDE > Windows OS > Tomcat 9.0.12 > JEE > > Error Message : > > 24-Jul-2019 10:03:27.271 INFO [main] > org.apache.catalina.core.ApplicationContext.log ContextListener: > contextInitialized() > 24-Jul-2019 10:03:27.271 INFO [main] > org.apache.catalina.core.ApplicationContext.log SessionListener: > contextInitialized() > 24-Jul-2019 10:03:27.292 INFO [main] > org.apache.catalina.core.ApplicationContext.log ContextListener: > attributeAdded('StockTicker', 'async.Stockticker@4fa4f485') > > Can I know why there is a ContextListner:attributeAdded('StockTicer', > 'async.Stockticker@4fa4f485') as appeared in the log ? > > How do I make it go away so that I can run my webApp ? > > Thank you for your help. > Karen > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: why is ContextListener.attributeAdded means?
Sent from Yahoo Mail for iPhone On Wednesday, July 24, 2019, 12:04 PM, M. Manna wrote: Hi Goh, It’s part of standard tomcat logging for servlet ctx init audit. Check logging.properties file in your conf/ directory. You should be able to change the level and tune how much logging is needed. And btw, it’s an INFO, not ERROR/FATAL/SEVERE. ContextListener: > attributeAdded('StockTicker', 'async.Stockticker@4fa4f485') But, in my WebApp I don’t have this at all? So how did it creep into the log? Is there some kind of script lying somewhere, accidentally crept in without me knowing n some how make its way inside Tomcat...I know this sound abit over imaginative but I really can’t tell for sure this attributeAdded is something that comes with Tomcat Thanks, On Wed, 24 Jul 2019 at 11:42, Karen Goh wrote: > Dear experts, > > I need some help again. > > I am trying to get a html page out on my browser, I changed my Tomcat > server as the previous one has some Ant script 'creeping in when I > downloaded an example'. However, I do not know why am I receiving an error > message ? > > Background :- > - > Netbean IDE > Windows OS > Tomcat 9.0.12 > JEE > > Error Message : > > 24-Jul-2019 10:03:27.271 INFO [main] > org.apache.catalina.core.ApplicationContext.log ContextListener: > contextInitialized() > 24-Jul-2019 10:03:27.271 INFO [main] > org.apache.catalina.core.ApplicationContext.log SessionListener: > contextInitialized() > 24-Jul-2019 10:03:27.292 INFO [main] > org.apache.catalina.core.ApplicationContext.log ContextListener: > attributeAdded('StockTicker', 'async.Stockticker@4fa4f485') > > Can I know why there is a ContextListner:attributeAdded('StockTicer', > 'async.Stockticker@4fa4f485') as appeared in the log ? > > How do I make it go away so that I can run my webApp ? > > Thank you for your help. > Karen > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: why is ContextListener.attributeAdded means?
Karen, On 7/23/2019 7:41 PM, Karen Goh wrote: > Dear experts, > > I need some help again. > > I am trying to get a html page out on my browser, I changed my Tomcat server > as the previous one has some Ant script 'creeping in when I downloaded an > example'. However, I do not know why am I receiving an error message ? > > Background :- > - > Netbean IDE > Windows OS > Tomcat 9.0.12 > JEE > > Error Message : > > 24-Jul-2019 10:03:27.271 INFO [main] > org.apache.catalina.core.ApplicationContext.log ContextListener: > contextInitialized() > 24-Jul-2019 10:03:27.271 INFO [main] > org.apache.catalina.core.ApplicationContext.log SessionListener: > contextInitialized() > 24-Jul-2019 10:03:27.292 INFO [main] > org.apache.catalina.core.ApplicationContext.log ContextListener: > attributeAdded('StockTicker', 'async.Stockticker@4fa4f485') > > Can I know why there is a ContextListner:attributeAdded('StockTicer', > 'async.Stockticker@4fa4f485') as appeared in the log ? > > How do I make it go away so that I can run my webApp ? > > Thank you for your help. > Karen This is coming from the examples that are shipped with Tomcat. In particular, this appears to be from the Stock Ticker asynchronous example. In other words, this is nothing to be concerned about. . . . just my two cents. /mde/ signature.asc Description: OpenPGP digital signature