aspose file tools*
The moose likes JDBC and the fly likes HI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "HI" Watch "HI" New topic
Author

HI

venu jayaram
Greenhorn

Joined: Mar 11, 2008
Posts: 27
Please tell how to solve this Exception............




ERROR [STDERR] com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.ConnectException
MESSAGE: Connection timed out: connect

STACKTRACE:

java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:520)
at java.net.Socket.connect(Socket.java:470)
at java.net.Socket.<init>(Socket.java:367)
at java.net.Socket.<init>(Socket.java:209)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at com.myapp.struts.DatabaseConnection1.getConnection(DatabaseConnection1.java:30)
at com.myapp.struts.MYSQL.isUser(MYSQL.java:28)
at com.myapp.struts.LoginAction.execute(LoginAction.java:36)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)


** END NESTED EXCEPTION **



Last packet sent to the server was 0 ms ago.
16:54:30,015 ERROR [STDERR] at com.mysql.jdbc.Connection.createNewIO(Connection.java:2847)

16:54:30,015 ERROR [STDERR] at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
16:54:30,015 ERROR [STDERR] at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
16:54:30,015 ERROR [STDERR] at java.sql.DriverManager.getConnection(DriverManager.java:525)
16:54:30,015 ERROR [STDERR] at java.sql.DriverManager.getConnection(DriverManager.java:171)

16:54:30,015 ERROR [STDERR] at com.myapp.struts.DatabaseConnection1.getConnection(DatabaseConnection1.java:30)
16:54:30,015 ERROR [STDERR] at com.myapp.struts.MYSQL.isUser(MYSQL.java:28)
16:54:30,015 ERROR [STDERR] at com.myapp.struts.LoginAction.execute(LoginAction.java:36)
16:54:30,015 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
16:54:30,015 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
16:54:30,015 ERROR [STDERR] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
16:54:30,015 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
16:54:30,015 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
16:54:30,015 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
16:54:30,015 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
16:54:30,015 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
16:54:30,015 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
16:54:30,015 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
16:54:30,015 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
16:54:30,015 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
16:54:30,015 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
16:54:30,015 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
16:54:30,015 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
16:54:30,015 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
16:54:30,015 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
16:54:30,015 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
16:54:30,015 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
16:54:30,015 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
16:54:30,015 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
16:54:30,015 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
16:54:30,015 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
16:54:30,015 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
16:54:30,015 ERROR [STDERR] java.lang.NullPointerException
16:54:30,015 ERROR [STDERR] at com.myapp.struts.MYSQL.isUser(MYSQL.java:30)
16:54:30,015 ERROR [STDERR] at com.myapp.struts.LoginAction.execute(LoginAction.java:36)
16:54:30,015 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
16:54:30,015 ERROR [STDERR] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
16:54:30,015 ERROR [STDERR] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
16:54:30,015 ERROR [STDERR] at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
16:54:30,515 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
16:54:30,515 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
16:54:30,515 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
16:54:30,515 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
16:54:30,515 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
16:54:30,515 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
16:54:30,515 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
16:54:30,515 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
16:54:30,515 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
16:54:30,515 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
16:54:30,515 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
16:54:30,515 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
16:54:30,515 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
16:54:30,515 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
16:54:30,515 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
16:54:30,515 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
16:54:30,515 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
16:54:30,515 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
16:54:30,515 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
16:54:30,515 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
16:54:30,515 INFO [STDOUT] null
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

please UseAMeaningfulSubjectLine
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

It would help to see the code for com.myapp.struts.DatabaseConnection1.getConnection(), and please highlight line 30. If that code does not provide the full JDBC connection information, provide that (code or config file) also. And was this the first call into this code?


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HI