Skip to content

Using Spring-Boot-Starter-Web in combination with ObjectDB

I am implementing a program in Spring-Boot using ObjectDB. To actually use ObjectDB I have followed this approach which is working perfectly.

However, as soon as I want to use `spring-boot-starter-web“ then I am getting the following errors:

dataSource or dataSourceClassName or jdbcUrl is required. at com.zaxxer.hikari.HikariConfig.validate

I have been fiddling around with parameter jdbc-url in the properties file as mentioned in many posts. Tried to exclude Hikari because probably ObjectDB uses his own connection pooling mechanism. But without any results.

Any ideas on how to solve this error?

I am using the exact same code as in the link. I have added Spring-Actuator in the pom like this:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
</dependency>

Answer

In some cases, frameworks that use JPA require specifying a JDBC connection details, including a JDBC driver, which is then passed to the JPA implementation and used by it to access the database. ObjectDB is a JPA implementation that does not access an external database, and therefore, does not need or use a JDBC driver.

As discussed in the comments to the question, a simple workaround is to specify a dummy JDBC driver, which will be passed to ObjectDB and then ignored. It does look weird, but this is the way to go until either ObjectDB implement its own JDBC driver, or the relevant frameworks become more flexible regarding their request of a JDBC driver.