1
resposta

[Bug] APPLICATION FAILED TO START

Não estou conseguindo corrigir o erro apresentado no console.

log:

2023-03-14T13:57:05.629-03:00 INFO 17152 --- [ restartedMain] b.c.a.pagamentos.PagamentosApplication : Starting PagamentosApplication using Java 17.0.6 with PID 17152 (C:\workspace\pagamentos\target\classes started by 922019 in C:\workspace\pagamentos) 2023-03-14T13:57:05.633-03:00 INFO 17152 --- [ restartedMain] b.c.a.pagamentos.PagamentosApplication : No active profile set, falling back to 1 default profile: "default" 2023-03-14T13:57:05.676-03:00 INFO 17152 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2023-03-14T13:57:05.676-03:00 INFO 17152 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2023-03-14T13:57:06.193-03:00 INFO 17152 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2023-03-14T13:57:06.241-03:00 INFO 17152 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 39 ms. Found 1 JPA repository interfaces. 2023-03-14T13:57:06.739-03:00 INFO 17152 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2023-03-14T13:57:06.747-03:00 INFO 17152 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2023-03-14T13:57:06.747-03:00 INFO 17152 --- [ restartedMain] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.5] 2023-03-14T13:57:06.801-03:00 INFO 17152 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2023-03-14T13:57:06.801-03:00 INFO 17152 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1124 ms 2023-03-14T13:57:06.879-03:00 WARN 17152 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'flyway' threw exception with message: 'org.flywaydb.core.api.configuration.FluentConfiguration org.flywaydb.core.api.configuration.FluentConfiguration.failOnMissingLocations(boolean)' 2023-03-14T13:57:06.881-03:00 INFO 17152 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2023-03-14T13:57:06.892-03:00 INFO 17152 --- [ restartedMain] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2023-03-14T13:57:06.908-03:00 ERROR 17152 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration.configureProperties(FlywayAutoConfiguration.java:187)

The following method did not exist:

'org.flywaydb.core.api.configuration.FluentConfiguration org.flywaydb.core.api.configuration.FluentConfiguration.failOnMissingLocations(boolean)'

The calling method's class, org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration, was loaded from the following location:

jar:file:/C:/Users/922019/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/3.0.4/spring-boot-autoconfigure-3.0.4.jar!/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class

The called method's class, org.flywaydb.core.api.configuration.FluentConfiguration, is available from the following locations:

jar:file:/C:/Users/922019/.m2/repository/org/flywaydb/flyway-core/7.8.0/flyway-core-7.8.0.jar!/org/flywaydb/core/api/configuration/FluentConfiguration.class

The called method's class hierarchy was loaded from the following locations:

org.flywaydb.core.api.configuration.FluentConfiguration: file:/C:/Users/922019/.m2/repository/org/flywaydb/flyway-core/7.8.0/flyway-core-7.8.0.jar

Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration and org.flywaydb.core.api.configuration.FluentConfiguration

1 resposta

Olá

Para corrigir esse erro, confirma se a versão do Flyway e do Spring Boot que você está usando na sua aplicação são as mesmas versões utilizadas no curso