Spring data cassandra Не удалось найти драйвер - PullRequest
0 голосов
/ 25 марта 2020

Я пытаюсь использовать dasastax Cassandra с сохранением данных jpa. при использовании datastax java приложение драйвера выдает следующую ошибку

    2020-03-25 06:37:28.815  WARN 22502 --- [           main] ConfigServletWebServerApplicationContext : 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; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2020-03-25 06:37:28.817  INFO 22502 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-03-25 06:37:28.828  INFO 22502 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-03-25 06:37:28.830 ERROR 22502 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
    If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

ниже мой файл сборки gradle


dependencies {
    implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.2.5.RELEASE'
    implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '2.2.5.RELEASE'
    implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-cassandra', version: '2.2.5.RELEASE'

    compile group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '3.8.0'
    compile group: 'com.datastax.cassandra', name: 'cassandra-driver-mapping', version: '3.8.0'
    compile group: 'com.datastax.cassandra', name: 'cassandra-driver-extras', version: '3.8.0'

    compileOnly 'org.projectlombok:lombok:1.18.12'
    annotationProcessor 'org.projectlombok:lombok:1.18.12'
    testCompile group: 'junit', name: 'junit', version: '4.12'
    testCompileOnly 'org.projectlombok:lombok:1.18.12'
    testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'
}

это мой файл application.properties

spring.data.cassandra.contact-points=bf6111db-6476-41bc-a948-ba24772a4364-europe-west1.db.astra.datastax.com
spring.data.cassandra.port=32751
spring.data.cassandra.username=Chaithanya1996
spring.data.cassandra.password=GoVTWARdY59tg3D62qSnXbnTz
spring.data.cassandra.keyspace=replica

Я пробовал версию драйвера 4.5.1 со следующими зависимостями, но безуспешно

    compile group: 'com.datastax.oss', name: 'java-driver-core', version: '4.5.1'
    compile group: 'com.datastax.oss', name: 'java-driver-query-builder', version: '4.5.1'
    testCompile group: 'com.datastax.oss', name: 'java-driver-mapper-processor', version: '4.5.1'
    compile group: 'com.datastax.oss', name: 'java-driver-mapper-runtime', version: '4.5.1'
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...