Wpis z mikrobloga

#java #spring

siema Mirki!
Stawiam nowy projekt spring boot + h2 in memory i w pom.xml mam:

org.springframework.boot
spring-boot-starter-data-jpa

com.h2database
h2
runtime

org.flywaydb
flyway-core

ale w application.properties w:
spring.datasource.driverClassName=org.h2.Driver

org.h2.Driver caly czas swieci mi na czerwono w intelliJ no i potem leci blad:
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 java.lang.IllegalStateException: Cannot load driver class: org.h2.Driver
Caused by: java.lang.IllegalStateException: Cannot load driver class: org.h2.Driver

wiec tak jakby ewidentnie tego drivera nie znal. Jak moge ich poznac tzn. drivera z projektem?
  • 1
  • Odpowiedz
  • Otrzymuj powiadomienia
    o nowych komentarzach