Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-11-2008, 05:10 PM
Member
 
Join Date: Jul 2008
Posts: 8
Rep Power: 0
wickedrahul9 is on a distinguished road
Default Connection timeout exception
Hi guys,
I have developed an application which uses jsp & MySql. MySql database server in on my system & web server is my company's server. When I am trying to submit data it's getting stored in database( that means there is no connectivity problem between database & web server). When I try to download database contents from server it's getting downloaded also(application has force download option). The problem arises when I try to download from some other system.I mean to say download is working on server machine only & not on any other machine. It's giving time out exception. The error is


Error : com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.ConnectException MESSAGE: Connection timed out STACKTRACE: java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl .java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSoc ketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.j ava:366) at java.net.Socket.connect(Socket.java:520) at java.net.Socket.connect(Socket.java:470) at java.net.Socket.(Socket.java:367) at java.net.Socket.(Socket.java:209) at com.mysql.jdbc.StandardSocketFactory.connect(Stand ardSocketFactory.java:256) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:271) at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2744) at com.mysql.jdbc.Connection.(Connection.java:1553) at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:285) at java.sql.DriverManager.getConnection(DriverManager .java:525) at java.sql.DriverManager.getConnection(DriverManager .java:193) at org.apache.jsp.filter_jsp._jspService(filter_jsp.j ava:102) at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet .java:803) at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:337) at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266) at javax.servlet.http.HttpServlet.service(HttpServlet .java:803) at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:595) ** END NESTED EXCEPTION ** Last packet sent to the server was 0 ms ago




What could be the possible reason? Anybody please help me out.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 11-12-2008, 08:33 AM
Member
 
Join Date: Nov 2008
Posts: 4
Rep Power: 0
monur is on a distinguished road
Default
Make sure you have changed your connection properties(connection string) when deploying your application on a machine that's not localhost.
And check if there is any connection problem between the database server and your deployment server. (by using telnet to that specific MySql server listener port)

HTH
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 11-13-2008, 09:32 AM
Member
 
Join Date: Jul 2008
Posts: 8
Rep Power: 0
wickedrahul9 is on a distinguished road
Default
Originally Posted by monur View Post
Make sure you have changed your connection properties(connection string) when deploying your application on a machine that's not localhost.
And check if there is any connection problem between the database server and your deployment server. (by using telnet to that specific MySql server listener port)

HTH
There is no prob in database connectivity as it's working fine from server machine. The problem arises when I try to submit or retrieve data from machines other than the server.

It's taking a lot of time & therefore connection timeout is happening. I'm not able to post simplified code here as post count is less than 20. If you wish to see the code please check Sun Forum -> Java Programming -> Connection Timeout Exception , posted on Nov 11.

Thank you so much for your valuable input.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception: An established connection was aborted by the software in your host machine vidhya.sk Advanced Java 4 04-26-2009 01:02 PM
java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]System Exception: Connection Ram_TPS Database 1 10-16-2008 03:09 PM
RAD - Error getting connection: Timeout. ShoeNinja Other IDEs 0 09-09-2008 06:25 PM
using Java to access a secure webpage, Exception occurred: Connection timed out toby Enterprise JavaBeans 1 08-07-2007 07:03 AM
Detect TimeOut in a HttpURL Connection Ed Advanced Java 2 07-02-2007 05:29 PM


All times are GMT +2. The time now is 10:49 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org