I am newbie in Spring boot.I get this error
Cannot determine embedded database driver class for database type NONE
whenever trying to run my spring-boot start web app(I am trying to test the actuator and hal browser). Over the last eight hours or so I have tryied several suggestions over google/stackoverflow. But doesn't seem to work for me. I still keep getting another error.
First try: I followed both the methods mentioned in journaldev
If I use the first method i.e. annotating my main application class
with @EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class })
, I get this error:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.sql.DataSource' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
If I use the second method which, I still get another error:
Binding to target [Bindable@7c551ad4 type = com.zaxxer.hikari.HikariDataSource, value = 'provided', annotations = array<Annotation>[[empty]]] failed:
Property: driverclassname
Value: com.mysql.jdbc.Driver
Origin: "driverClassName" from property source "source"
Reason: Unable to set value for property driver-class-name
I also tried Andy Wilkinson's suggestion and added
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost/mydb
to my application.properties file but I got this error :
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': 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: com.mysql.jdbc.Driver
I also tried with providing the username and pwd(not sure if that's required as I am not trying to access my database), but didn't work for me. If it's reqwuired I can provide my pom configurations too.