java - Cannot determine embedded database driver class for database type NONE while running jar -
as mentioned in headline of question facing issue cannot determine embedded database driver class database type none
. application have built on spring boot , working fine when run code in intellij.
i have followed several questions regarding same exception , suggested need add spring.datasource
properties in application.properties file. have them , still facing same issue. issue occurs when create jar file using artifacts of intellij , run following command. java - jar myjar.jar
my application.properties file
# =============================== # = data source # =============================== spring.datasource.url = jdbc:mysql://localhost:3306/db_wssmith?usessl=false spring.datasource.username = spring.datasource.password = spring.datasource.driver-class-name=com.mysql.jdbc.driver
error log while running jar
error org.springframework.boot.springapplication - application startup failed org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'org.springframework.boot.autoconfigure.orm.jpa.hibernatejpaautoconfiguration': unsatisfied dependency expressed through constructor parameter 0; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'datasource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/datasourceconfiguration$tomcat.class]: bean instantiation via factory method failed; nested exception org.springframework.beans.beaninstantiationexception: failed instantiate [org.apache.tomcat.jdbc.pool.datasource]: factory method 'datasource' threw exception; nested exception org.springframework.boot.autoconfigure.jdbc.datasourceproperties$datasourcebeancreationexception: cannot determine embedded database driver class database type none. if want embedded database please put supported 1 on classpath. if have database settings loaded particular profile may need active (no profiles active).
use maven command instead of using intellij. should work.
Comments
Post a Comment