Не удалось создать экземпляр com.zaxxer.hikari.HikariDataSource: исключение фабричного метода dataSource с сообщением: нJAVA

Программисты JAVA общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Не удалось создать экземпляр com.zaxxer.hikari.HikariDataSource: исключение фабричного метода dataSource с сообщением: н

Сообщение Anonymous »

Я пытаюсь закрепить приложение микросервиса Springboot, но при развертывании возникает ошибка ниже. Ниже приведены все подробности конфигурации. Пожалуйста, помогите решить проблему, предоставив любую подсказку.
То же самое работает, и можно протестировать с помощью почтальона.

Код: Выделить всё

Failed to instantiate com.zaxxer.hikari.HikariDataSource: Factory method 'dataSource'exception with message: Failed to determine suitable driver class
application.propertie

Код: Выделить всё

spring.datasource.url= jdbc:sqlserver://localhost:1433;encrypt=true;trustServerCertificate=true;databaseName=The_Read
spring.datasource.username= The_read
spring.datasource.password= Read@123456
spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
зависимости градиента

Код: Выделить всё

dependencies {
implementation('org.springframework.boot:spring-boot-starter-web')
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
implementation('org.springframework.boot:spring-boot-starter-security:3.0.1')
implementation 'org.projectlombok:lombok:1.18.24'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
annotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
implementation 'io.swagger.core.v3:swagger-models:2.2.7'
implementation 'io.swagger.core.v3:swagger-annotations:2.2.6'
implementation 'io.swagger:swagger-annotations:1.6.8'

// https://mvnrepository.com/artifact/org.springframework.security.oauth/spring-security-oauth2
implementation("org.springframework.security.oauth:spring-security-oauth2:2.5.2.RELEASE")
//implementation("org.springframework.security:spring-security-oauth2-jose:5.3.8.RELEASE")
implementation("org.springframework.security:spring-security-oauth2-jose:5.7.3")
// https://mvnrepository.com/artifact/com.auth0/java-jwt
группа реализации: «com.auth0», имя: «java-jwt» , версия: '4.2.2'
// https://mvnrepository.com/artifact/org. ... urity-core
группа реализации: «org.springframework.security», имя: «spring-security-core», версия: «6.0» .1'
группа реализации: 'org.springframework.security', имя: 'spring-security-oauth2-resource-server', версия: '5.1.6.RELEASE'
//Спасибо за использование https://jar-download.com
// https://mvnrepository.com/artifact/com. ... mssql-jdbc
реализация("com.microsoft.sqlserver:mssql-jdbc:11.2.3.jre18")
// https://mvnrepository.com/artifact/java ... tation-api
реализация("javax.annotation:javax.annotation-api:1.3.2")
реализация("org. Springframework.security:spring-security-oauth2-resource-server:5.1.0.RELEASE")

Код: Выделить всё

annotationProcessor "org.projectlombok:lombok:1.18.8"
testAnnotationProcessor("org.projectlombok:lombok:1.18.8")
// https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt
implementation("io.jsonwebtoken:jjwt:0.9.1")
// https://mvnrepository.com/artifact/javax.validation/validation-api
implementation("javax.validation:validation-api:2.0.1.Final")

implementation("javax.xml.bind:jaxb-api:2.3.1")
implementation("org.apache.commons:commons-lang3:3.0")
Трассировка стека журнала

Код: Выделить всё

    2023-01-25 02:07:10 20:37:10.777 [main] WARN org.springframework.context.annotation.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message: Failed to determine a suitable driver class
2023-01-25 02:07:10 20:37:10.782 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
2023-01-25 02:07:10 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message:  Failed to determine a suitable driver class
2023-01-25 02:07:10 at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:798)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:245)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1344)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1188)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:415)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1324)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1161)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
2023-01-25 02:07:10 at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1130)
2023-01-25 02:07:10 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:905)
2023-01-25 02:07:10 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584)
2023-01-25 02:07:10 at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
2023-01-25 02:07:10 at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:432)
2023-01-25 02:07:10 at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
2023-01-25 02:07:10 at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302)
2023-01-25 02:07:10 at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291)
2023-01-25 02:07:10 at SecurityServiceApplication.main(SecurityServiceApplication.java:9)
2023-01-25 02:07:10 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message:  Failed to determine a suitable driver class
2023-01-25 02:07:10 at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:645)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1324)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1161)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
2023-01-25 02:07:10 at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1405)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1325)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:885)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:789)
2023-01-25 02:07:10 ... 27 common frames omitted
2023-01-25 02:07:10 Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message: Failed to determine a suitable driver class
2023-01-25 02:07:10 at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:171)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
2023-01-25 02:07:10 ... 41 common frames omitted
2023-01-25 02:07:10 Caused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2023-01-25 02:07:10 at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:182)
2023-01-25 02:07:10 at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:123)
2023-01-25 02:07:10 at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:48)
2023-01-25 02:07:10 at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari.dataSource(DataSourceConfiguration.java:90)
2023-01-25 02:07:10 at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
2023-01-25 02:07:10 at java.base/java.lang.reflect.Method.invoke(Method.java:577)
2023-01-25 02:07:10 at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:139)
2023-01-25 02:07:10 ... 42 common frames omitted
Пожалуйста, помогите

Подробнее здесь: https://stackoverflow.com/questions/752 ... hod-dataso
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «JAVA»