Azure SQL DB connectivity issue

Vijay Kumar 1,996 Reputation points
2022-04-06T17:26:43.27+00:00

We are getting below error from application side. But i am able to connect Azure SQL DB and i didn't find any errors on Azure Dashboard:

Failed to instantiate [javax.sql.DataSource]: Factory method 'secondaryDataSource' threw exception; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: The TCP/IP connection to the host fosp-spa-prod-westus-sqlsrv-01.database.windows.net, port 1433 has failed. Error: "null. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660)

    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640)

    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)

    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1425)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)

    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307)

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227)

    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657)

    ... 62 more

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'DCRepositoryImpl': Unsatisfied dependency expressed through field 'jdbcTemplateOracle'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdbcTemplateOracle' defined in class path resource [com/safeway/app/fosp/config/DataSourceConfiguration.class]: Unsatisfied dependency expressed through method 'jdbcTemplate' parameter 0; nested exception is org.spring
Azure SQL Database
{count} vote

Accepted answer
  1. Alberto Morillo 27,876 Reputation points MVP
    2022-04-06T20:20:20.047+00:00

    Make sure you have set ssl=require and encrypt=true on the connection string.

    Additionally try using username@servername for the username field, where the real server name is servername.database.windows.net,

    Please examine this documentation that could be valuable for you for troubleshooting this issue.

    0 comments No comments

0 additional answers

Sort by: Most helpful