Results 1 to 3 of 3
  1. #1
    wickedrahul9 is offline Member
    Join Date
    Jul 2008
    Posts
    8
    Rep Power
    0

    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.

  2. #2
    monur is offline Member
    Join Date
    Nov 2008
    Posts
    4
    Rep Power
    0

    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

  3. #3
    wickedrahul9 is offline Member
    Join Date
    Jul 2008
    Posts
    8
    Rep Power
    0

    Default

    Quote 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.

Similar Threads

  1. Replies: 7
    Last Post: 06-08-2010, 01:36 PM
  2. Replies: 1
    Last Post: 10-16-2008, 02:09 PM
  3. RAD - Error getting connection: Timeout.
    By ShoeNinja in forum Other IDEs
    Replies: 0
    Last Post: 09-09-2008, 05:25 PM
  4. Replies: 1
    Last Post: 08-07-2007, 06:03 AM
  5. Detect TimeOut in a HttpURL Connection
    By Ed in forum Advanced Java
    Replies: 2
    Last Post: 07-02-2007, 04:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •