Re: Need solution for MySQL Not connected problem
Posted by: Nataraja mani
Date: January 10, 2019 07:37AM

Dear Filipe Silva,

This is my Full Stacktrace exception message.

1.0-20160813-CMS:08-Jan-2019 11:33:03 PM : com.mysql.jdbc.CommunicationsException -->
DbUtil : getConnection com.mysql.jdbc.Connection.createNewIO(Connection.java:2820)
com.mysql.jdbc.Connection.<init>(Connection.java:1553)
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
java.sql.DriverManager.getConnection(DriverManager.java:664)
java.sql.DriverManager.getConnection(DriverManager.java:247)
com.sardonyx.dbaccess.DbUtil.getConnection(DbUtil.java:19)
com.sardonyx.dbaccess.DataAccess.callquery(DataAccess.java:5651)
com.sardonyx.dbaccess.DataAccess.querytoInt(DataAccess.java:1385)
com.sardonyx.dbaccess.DataAccess.getStringResourceModule(DataAccess.java:1365)
com.sardonyx.server.CommonServlet.doPost(CommonServlet.java:197)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)org.apache.tomcat.ut!
il.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)java.lang.Thread.run(Thread.java:748)

So, you are saying that you have both MySQL and Tomcat running in both machines, one running Windows and the other CentOS but the war only works on windows?

Yes , There is no Issue In Windows OS.

But in the CENT OS only , that Issue is arised.

When I Run as code , My SQL Connected successfully.

But After converting War file , It cannot connect the MySQL.

How does your connection strings look like?

I mentioned My connection String class below.

Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection(
"jdbc:mysql://localhost:3306/sonoo","root","root");

In what ports are your servers running?

My Tomcat Port is : 8080

My SQL Port is : 3306

Can you connect to both MySQL servers using the mysql command line client?

yes, I can connect both MySQL servers using the mysql command line client.

Options: ReplyQuote




Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.