Ao mudar, no pom.xml, a versao do Spring Boot para 2.3.1, varios erros apareceram nas minhas classes. Estes erros, foram em outras classes, que a principio estariam corretas, pelo menos nao apareceram na aula em video apresentada. O que eu faço ?
Ao mudar, no pom.xml, a versao do Spring Boot para 2.3.1, varios erros apareceram nas minhas classes. Estes erros, foram em outras classes, que a principio estariam corretas, pelo menos nao apareceram na aula em video apresentada. O que eu faço ?
Oi Ines,
Pode utilizar a versão mais atual no momento: 2.4.3.
Atualize e veja se ainda vai ter problema nas suas classes.
Agora da esta mensagem de erro no pom.xml
Project build error: Non-resolvable parent POM for br.com.alura:forum:0.0.1-SNAPSHOT: Failure to find org.springframework.boot:spring-boot-starter-parent:pom:2.4.3.RELEASE in https:// repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at no local POM
Oi Ines,
A versão deve ser 2.4.3, sem o .RELEASE
Fiz o que voce falou.. Mas continuar com erro em varios lugares. Exemplo : Na classe Curso esta dando erro nos imports. Veja mensagem abaixo: Multiple markers at this line
- The import javax.persistence cannot be
resolved
- The import javax.persistence cannot be
resolved
- The import javax.persistence cannot be
resolved
- The import javax.persistence cannot be
resolved
Oi Ines,
Posta aqui o conteúdo do seu arquivo pom.xml
4.0.0 org.springframework.boot spring-boot-starter-parent 2.4.3 br.com.alura forum 0.0.1-SNAPSHOT forum Demo project for Spring Boot
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>2.1.4</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</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>
</plugin>
</plugins>
</build>
Está faltando a dependência do Spring Data JPA:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
Resolveu.. Gozado que eu peguei o arquivo zipado de voces e sobescrevi os meus fontes. Acredito que o pom.xml de voces, no git, esta com este erro tambem.
Segue o erro quando subi a aplicação: 2021-03-12 13:18:18.892 WARN 9644 --- [gistrationTask1] d.c.b.a.c.r.ApplicationRegistrator : Failed to register application as Application(name=spring-boot-application, managementUrl=http://172.16.161.137:8080/actuator, healthUrl=http://172.16.161.137:8080/actuator/health, serviceUrl=http://172.16.161.137:8080/) at spring-boot-admin ([http://localhost:8081/instances]): I/O error on POST request for "http://localhost:8081/instances": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect. Further attempts are logged on DEBUG level
O que eu faço ? Obrigada