Я столкнулся с этой ошибкой:
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
Почему я столкнулся с этой проблемой?
Вот pom.xml:
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.3.3.RELEASE
com.wipro.boot
h2sample
0.0.1-SNAPSHOT
war
demo
Demo project for Spring Boot
1.8
org.springframework.boot
spring-boot-starter-data-jpa
org.springframework.boot
spring-boot-starter-web
com.h2database
h2
test
org.springframework.boot
spring-boot-starter-tomcat
provided
org.springframework.boot
spring-boot-starter-test
test
org.junit.vintage
junit-vintage-engine
org.springframework.boot
spring-boot-maven-plugin
Вот файл application.properties:
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
Подробнее здесь: https://stackoverflow.com/questions/636 ... ot-applica
Как решить проблему невозможности загрузки класса драйвера: org.h2.Driver в приложении весенней загрузки? ⇐ JAVA
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Невозможно загрузить класс драйвера: org.h2.driver в приложении Spring Boot JPA
Anonymous » » в форуме JAVA - 0 Ответы
- 14 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как решить проблему невозможности получить изолированное соединение JDBC?
Anonymous » » в форуме JAVA - 0 Ответы
- 162 Просмотры
-
Последнее сообщение Anonymous
-