Solucionado (ver solução)
Solucionado
(ver solução)
4
respostas

Application Failed to Start

Insira aqui a descrição dessa imagem para ajudar na acessibilidade

Mas não entendo o motivo de estar assim, olhe :

Insira aqui a descrição dessa imagem para ajudar na acessibilidade

4 respostas

A mensagem de erro está dizendo que não está encontrando o caminho URL para localizar sua data de base local, quando vc configurou o seu username, e o password dentro da aplicação, vc também deve ter configurado a URL, está correta essa configuração?

Sim , o tanto que se eu rodo o servidor normal, funciona. O profile ativo está como DEV no run configuratons , então puxa o profile dev mas quando vou contruir o container, dá problema.

O tanto que quando vai só rodar , já funciona : Insira aqui a descrição dessa imagem para ajudar na acessibilidade

solução!

Mas quando dou o comando q o professor disse :

$ docker run -p 8080:8080 -e FORUM_DATABASE_URL='jdbc:h2:mem:alura-forum' -e FORUM_DATABASE_USERNAME='sa' -e FORUM_DATABASE_PASSWORD='' -e FORUM_JWT_SECRET='123456' alura/forum

. __ _ __ _ _ /\ / _'_ _ _ _()_ _ __ _ \ \ \ ( ( )___ | ' | '| | ' / ` | \ \ \ \/ ___)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||_| |_, | / / / / =========||==============|__/=//// :: Spring Boot :: (v2.3.1.RELEASE)

2022-04-07 13:59:51.036 INFO 1 --- [ main] br.com.alura.forum.ForumApplication : Starting ForumApplication v0.0.1-SNAPSHOT on 4e4e4ce88630 with PID 1 (/app.jar started by spring in /) 2022-04-07 13:59:51.042 INFO 1 --- [ main] br.com.alura.forum.ForumApplication : No active profile set, falling back to default profiles: default 2022-04-07 13:59:52.953 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode. 2022-04-07 13:59:53.069 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 103ms. Found 3 JPA repository interfaces. 2022-04-07 13:59:54.104 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2022-04-07 13:59:54.118 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2022-04-07 13:59:54.118 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.36] 2022-04-07 13:59:54.204 INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2022-04-07 13:59:54.204 INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3045 ms 2022-04-07 13:59:54.572 WARN 1 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class 2022-04-07 13:59:54.577 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2022-04-07 13:59:54.612 INFO 1 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2022-04-07 13:59:54.615 ERROR 1 --- [ main] 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).