java.version=17
spring-boot-starter-data-r2dbc=3.1.1
spring-boot-starter-webflux=3.1.1
I have specified the following in application.properties to be picked up by the auto configuration.
spring.r2dbc.url=r2dbc:pool:mysql://localhost:3306/airportdb
spring.r2dbc.username=admin
spring.r2dbc.password=REDACTED
logging.level.root=DEBUG
When I start the Spring boot application I get the following exception at the bottom of the log.
Caused by: java.lang.IllegalStateException: Unable to create a ConnectionFactory for 'ConnectionFactoryOptions{options={database=airportdb, host=localhost, driver=mysql, password=REDACTED, protocol=, port=3306, user=admin}}'. Available drivers: [ pool ]
Now, I have been able to solve this exception by adding this snippet to my pom.xml in the dependencies section.
<dependency>
<groupId>io.r2dbc</groupId>
<artifactId>r2dbc-h2</artifactId>
<scope>runtime</scope>
</dependency>
EDIT- This is already a part of my effective pom, I'm not adding it new, just changing it's scope which resolves my issue.
As soon as I add this to my pom, I'm able to launch the app and it works flawlessly but for the life of me I can't understand what the original problem was and how just changing the scope of this dependency which has been pulled in by spring-boot-starter-data-r2dbc
solves it. Thanks.