Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

404 na API

Olá.

Copiei o código exatamente do texto, porém não tive o mesmo erro que a instrutora teve durante a explicação. Porém eu fiz do mesmo jeito que ela indicou com a classe de configuração.

Obtive sucesso na hora de rodar a aplicação conforme código abaixo:

***[texto excluído por conta do limite de caracteres]***
2022-12-22 20:31:29.079  INFO 8160 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-12-22 20:31:29.095  INFO 8160 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 5 ms. Found 0 JPA repository interfaces.
2022-12-22 20:31:29.758  INFO 8160 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2022-12-22 20:31:29.767  INFO 8160 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2022-12-22 20:31:29.767  INFO 8160 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.62]
2022-12-22 20:31:29.838  INFO 8160 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2022-12-22 20:31:29.838  INFO 8160 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1436 ms
2022-12-22 20:31:30.002  INFO 8160 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2022-12-22 20:31:30.241  INFO 8160 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2022-12-22 20:31:30.271  INFO 8160 --- [  restartedMain] o.f.c.internal.license.VersionPrinter    : Flyway Community Edition 8.0.5 by Redgate
2022-12-22 20:31:30.272  INFO 8160 --- [  restartedMain] o.f.c.i.database.base.BaseDatabaseType   : Database: jdbc:mysql://localhost:3306/alurafood-pagamento (MySQL 8.0)
2022-12-22 20:31:30.312  INFO 8160 --- [  restartedMain] o.f.core.internal.command.DbValidate     : Successfully validated 1 migration (execution time 00:00.016s)
2022-12-22 20:31:30.323  INFO 8160 --- [  restartedMain] o.f.core.internal.command.DbMigrate      : Current version of schema `alurafood-pagamento`: 1
2022-12-22 20:31:30.324  INFO 8160 --- [  restartedMain] o.f.core.internal.command.DbMigrate      : Schema `alurafood-pagamento` is up to date. No migration necessary.
2022-12-22 20:31:30.417  INFO 8160 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-12-22 20:31:30.494  INFO 8160 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.6.8.Final
2022-12-22 20:31:30.640  INFO 8160 --- [  restartedMain] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-12-22 20:31:30.759  INFO 8160 --- [  restartedMain] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
2022-12-22 20:31:30.927  INFO 8160 --- [  restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-12-22 20:31:30.935  INFO 8160 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2022-12-22 20:31:30.992  WARN 8160 --- [  restartedMain] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2022-12-22 20:31:31.287  INFO 8160 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2022-12-22 20:31:31.317  INFO 8160 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2022-12-22 20:31:31.330  INFO 8160 --- [  restartedMain] b.c.a.pagamentos.PagamentosApplication   : Started PagamentosApplication in 3.382 seconds (JVM running for 3.814)
2022-12-22 20:31:35.033  INFO 8160 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-12-22 20:31:35.033  INFO 8160 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2022-12-22 20:31:35.034  INFO 8160 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms

Mas estou obtendo 404 conforme print abaixo: Insira aqui a descrição dessa imagem para ajudar na acessibilidadeSabem me dizer onde está o erro?

Obrigado.

1 resposta
solução!

Resolvido.

Baixei o projeto novamente e tudo rodou nos conformes. Devo ter importado de alguma lib que não era a correta.