Eai pessoal!
Estou tentando subir uma aplicação Spring, utilizando um BD no Docker, mas estou tendo o seguinte erro:
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-07-17T14:43:36.922-03:00 ERROR 7660 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
Process finished with exit code 0
Pelo o que pesquisei o drive de conexão com o BD não está sendo encontrado. Já testei várias dependências do mysql. Eu já tenho instalado o MySQL em minha máquina, e também já criei um DB pelo o próprio Intelij e a conexão é realizada com sucesso, mas no momento de subir a aplicação ocorre o erro acima. Vou enviar o pom do projeto e o properties.
Pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>academy.devdojo</groupId>
<artifactId>springboot2-essentials</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>springboot2-essentials</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
Properties:
server:
error:
include-stacktrace: on_param
spring:
datasource:
url: jdbc:msql://localhost:3307/serie?useSSL=false&createDatebaseIfNotExist=true&allowPublicKeyRetrieval=true
username: root
password: root
jpa:
hibernate:
ddl-auto: update
Alguém já passou por algo parecido?