4

I'm developing an API Server using Spring Boot and Hibernate for persistence.

I created a DataSource in InteliJ and created the entity classes using autogeneration from schema but when i try to run it i get the error :

"Cannot determine embedded database driver class for database type NONE"

even though I provided it in the persistence.xml

In the application.proprieties I didn't write anything.

I tried using methods such as here but I don't use h2Database. In my pom.xml i have the dependency for mysql-connector if that makes a difference.

I analysed this issue for hole day now, I'm out of ideas.


Another thing i tried is : in pom.xml I use h2Database dependecy but when I try to make a query I get this error :

"org.hibernate.tool.hbm2ddl.SchemaExport : Schema "BUY_MEDB" not found; SQL statement:"

I do not know why he's trying to use the BUY_MEDB schema when all my classes are having BuyMeDB schema name. I even tried to use the "INIT=CREATE SCHEMA IF NOT EXISTS BuyMeDB" in persistence.xml and it didn't work.

Community
  • 1
  • 1
ALex
  • 673
  • 1
  • 6
  • 19
  • First you should remove the duplicate mysql driver from the pom. Next, Spring Boot doesn't use persistence.xml. You should configure the necessary properties in your application.properties file. You can find the available property keys here: http://docs.spring.io/spring-boot/docs/1.5.1.RELEASE/reference/htmlsingle/#common-application-properties – dunni Feb 26 '17 at 20:53
  • Thank you , this worked. I will write an answer for those who are in my position in the future. Now i have another issue, if i try to run a query i get this error SQLException: Column 'created_at' not found But i have nowhere "created_at" column, but createdAt. Seems familiar? – ALex Feb 26 '17 at 21:50

0 Answers0