Is it possible to create a spring-boot application that has NO datasource? In my case i just need a simple REST app but it seems on start up that there is an attempt to auto
I had this issue, Once I have removed below dependency it started working.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
It is possible to run a spring boot application without datasource. You must disable the auto configuration for the datasource and may be for JPA also :
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
The exception you posted is something else, as written in the comments, you have something in the classpath that references the missing class of apache geronimo. So you must get rid of the code/jar that references geronimo or add geronimo to your dependencies.
@Stefan +1 If you are using YAML file for configuration this is how it is
spring:
profiles: dev
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
- org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
It worked perfectly fine for me.
Provide spring.datasource.url in the application.properties file. It worked for me. Example: spring.datasource.url=jdbc:mysql://localhost/Test_DB
A better way to fix this point will be to remove the dependencies from your POM/Gradle configuration file and Spring Boot will not try to auto configure the DataSource.