Código :
Ver original
Class.forName(def.getDriver()).newInstance(); Connection c = DriverManager.getConnection("jdbc:mysql://localhost:11003/basededatos","system","pass");
El puerto está bien, el usuario está bien, el pass está bien. Es un server ubuntu y por consola puedo acceder perfectamente con el mismo user, pass y puerto, pero no desde Java. El stack que me da es el siguiente:
Código :
Ver original
........ bla bla bla ...... at java.lang.Thread.run(Thread.java:595) Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.ConnectException MESSAGE: Connection refused STACKTRACE: java.net.ConnectException: Connection refused 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:2744) at com.mysql.jdbc.Connection.<init>(Connection.java:1553) 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 censere.framework.database.SysDBPool.initDefinition(SysDBPool.java:101) at censere.framework.database.SysDBPool.<init>(SysDBPool.java:42) at censere.framework.database.SysDBPool.getInstance(SysDBPool.java:56) at censere.framework.database.SQL.<init>(SQL.java:24) at censere.dao.baseObjects.BaseObjectsDaoImpl.getBaseObject(BaseObjectsDaoImpl.java:100) at censere.bo.baseObjects.BaseObjectsBoImpl.getBaseObjectFromSource(BaseObjectsBoImpl.java:53) at censere.framework.cache.impl.parameters.ConfigParametersCache.loadElementFromSource(ConfigParametersCache.java:31) at censere.framework.cache.GenericCache.getElement(GenericCache.java:141) at censere.framework.utils.baseObjects.BaseObjects.getParameter(BaseObjects.java:18) at censere.framework.mvc.view.AbstractView.execute(AbstractView.java:71) at censere.framework.mvc.controller.BaseController.showBrokenView(BaseController.java:127) at censere.framework.mvc.controller.BaseController.execute(BaseController.java:101) at censere.framework.mvc.controller.AbstractController.doPost(AbstractController.java:57) at censere.framework.mvc.controller.AbstractController.service(AbstractController.java:45) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 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.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Thread.java:595) ** END NESTED EXCEPTION ** Last packet sent to the server was 127 ms ago. at com.mysql.jdbc.Connection.createNewIO(Connection.java:2820) at com.mysql.jdbc.Connection.<init>(Connection.java:1553) 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 censere.framework.database.SysDBPool.initDefinition(SysDBPool.java:101) ... 29 more
Por favor ayudenme. Hace días que estoy con este problema y no lo pude solucionar. Busqué por mil lugares y nada.