Boa tarde, pessoal!
Tudo bem?
EStá dando erro quando executo o comando java "-Dspring.profiles.active=prod" -jar target/api-0.0.1-SNAPSHOT.jar no terminal:
2024-01-10T17:08:01.893-03:00 INFO 31468 --- [ main] med.voll.api.ApiApplication : Starting ApiApplication using Java 17.0.7 with PID 3146 8 (C:\Users\famil\IdeaProjects\api\target\api-0.0.1-SNAPSHOT.jar started by famil in C:\Users\famil\IdeaProjects\api) 2024-01-10T17:08:01.902-03:00 INFO 31468 --- [ main] med.voll.api.ApiApplication : The following 1 profile is active: "prod" 2024-01-10T17:08:04.665-03:00 INFO 31468 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT m ode. 2024-01-10T17:08:04.825-03:00 INFO 31468 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 138 ms. Fou nd 4 JPA repository interfaces. 2024-01-10T17:08:06.446-03:00 INFO 31468 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8080 (http) 2024-01-10T17:08:06.469-03:00 INFO 31468 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2024-01-10T17:08:06.470-03:00 INFO 31468 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.17]2024-01-10T17:08:06.582-03:00 INFO 31468 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2024-01-10T17:08:06.586-03:00 INFO 31468 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4445 ms 2024-01-10T17:08:06.765-03:00 ERROR 31468 --- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springfra mework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'securityFilter': Unsatisfied dependency expressed through field 'repo sitory': Error creating bean with name 'usuarioRepository' defined in med.voll.api.domain.usuario.UsuarioRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Cannot resolve reference to bean 'jpaSharedEM_entityManagerFactory' while setting bean property 'enti tyManager' 2024-01-10T17:08:06.845-03:00 INFO 31468 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2024-01-10T17:08:06.875-03:00 WARN 31468 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - c ancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server 2024-01-10T17:08:06.919-03:00 INFO 31468 --- [ main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2024-01-10T17:08:06.984-03:00 ERROR 31468 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:165) ~[spring-boot-3. 2.1.jar!/:3.2.1] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:619) ~[spring-context-6.1.2.jar!/:6.1.2] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2. 1.jar!/:3.2.1] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) ~[spring-boot-3.2.1.jar!/:3.2.1] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:464) ~[spring-boot-3.2.1.jar!/:3.2.1] at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.1.jar!/:3.2.1] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1358) ~[spring-boot-3.2.1.jar!/:3.2.1] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1347) ~[spring-boot-3.2.1.jar!/:3.2.1] at med.voll.api.ApiApplication.main(ApiApplication.java:11) ~[!/:na]