AnsweredAssumed Answered

MYSQL CONNECTOR FAILS with Could not create connection to database server

Question asked by Shanti Deepak on Dec 18, 2020
Latest reply on Jan 4, 2021 by Ian Staines

Hi All,

 

I was able to make a connection successfully from within the mysql collector. But When I tre to make the same connection in the connector it throws the error:

Connection error: Cannot get connection for URL jdbc:mysql://a.b.c.d:xyz/some_db : Could not create connection to database server. (java.sql.SQLException)

Here is the stack trace:

org.mule.transport.ConnectException: Cannot get connection for URL  jdbc:mysql://a.b.c.d:xyz/some_db : Could not create connection to database server. (java.sql.SQLException)      at org.mule.transport.jdbc.JdbcConnector.getConnection(JdbcConnector.java:280)      at com.aveksa.AFX.transport.database.DatabaseSettingsTest$DatabaseConnector.doConnect(DatabaseSettingsTest.java:143)      at com.aveksa.AFX.transport.database.DatabaseSettingsTest.runTest(DatabaseSettingsTest.java:98)      at com.aveksa.afx.server.component.SettingsTestExecutorComponent.onCall(SettingsTestExecutorComponent.java:29)      at org.mule.model.resolvers.CallableEntryPointResolver.invoke(CallableEntryPointResolver.java:46)      at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultEntryPointResolverSet.java:36)      at org.mule.component.DefaultComponentLifecycleAdapter.invoke(DefaultComponentLifecycleAdapter.java:339)      at org.mule.component.AbstractJavaComponent.invokeComponentInstance(AbstractJavaComponent.java:82)      at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaComponent.java:73)      at org.mule.component.AbstractComponent.invokeInternal(AbstractComponent.java:122)      at org.mule.component.AbstractComponent.access$000(AbstractComponent.java:57)      at org.mule.component.AbstractComponent$1$1.process(AbstractComponent.java:238)      at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)      at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)      at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)      at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:94)      at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)      at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:50)      at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)      at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:22)      at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:66)      at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)      at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)      at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)      at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:61)      at org.mule.component.AbstractComponent.process(AbstractComponent.java:156)      at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)      at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)      at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)      at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:94)      at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)      at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)      at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)      at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:102)      at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:51)      at org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:118)      at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:189)      at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:182)      at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)      at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)      at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)      at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:54)      at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)      at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)      at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)      at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)      at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)      at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)      at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)      at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:109)      at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30)      at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:181)      at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:39)      at org.mule.work.WorkerContext.run(WorkerContext.java:286)      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)      at java.lang.Thread.run(Thread.java:748) Caused by: java.sql.SQLException: Cannot get connection for URL  jdbc:mysql://a.b.c.d:xyz/some_db : Could not create connection to database server.      at org.enhydra.jdbc.standard.StandardDataSource.getConnection(StandardDataSource.java:216)      at org.enhydra.jdbc.standard.StandardDataSource.getConnection(StandardDataSource.java:144)      at org.mule.transport.jdbc.JdbcConnector.getConnection(JdbcConnector.java:276)      ... 56 more

 

Has anyone ever faced this kind of issue?

 

Thanks,

Deepak

Attachments

Outcomes