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

Erro na execução a aplicação servidora

Ao executar o comando: java -Dspring.datasource.password=minhaSenha-jar cdcreact-1.0.0-SNAPSHOT.jar Está me retornando o seguinte erro:

2017-11-08 16:44:32.529 ERROR 21288 --- [ main] o.s.boot.SpringApplication : Application startup failed org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.boot.autoconfigure.web.ServerProperties org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration.properties; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverProperties' defined in class path resource [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class]: Initialization of bean failed; nested exception is javax.validation.ValidationException: Unable to instantiate Configuration. at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133) ~[spring-boot-1.3.1.RELEASE.jar!/:1.3.1.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-4.2.4.RELEASE.jar!/:4.2.4.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.1.RELEASE.jar!/:1.3.1.RELEASE]

O que pode estar ocorrendo?

OS: Windows 10 64 bits

Java: java version "9.0.1"

javac: javac 9.0.1

3 respostas

Oi Silvio, me parece ser coisa apenas da conexão com o MySQL. Outras pessoas já tiveram problemas parecidos, dá uma olhada nos outros tópicos pra ver se em algum deles a solução também serve pra você? Vou deixar o link de alguns:

  1. https://cursos.alura.com.br/forum/topico-erro-ao-tentar-rodar-o-arquivo-jar-48515
  2. https://cursos.alura.com.br/forum/topico-erro-no-arquivo-jar-47380

Wanderson, eu já havia visto estas soluções e as tentei porém não consegui rodar a aplicação. Eu consigo fazer o login no mysql

xxxx@xxxx C:\Users\xxxxxxx$ mysql -u root -pEnter password: **Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 8Server version: 5.7.20-log MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Pelo que me parece, o erro é devido a algum problema com a versão do Java (eu baixei a última versão disponível do jdk.) em relação ao hibernate

Trecho do stacktrace

Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 at org.hibernate.validator.internal.util.Version.getJavaRelease(Version.java:36) at org.hibernate.validator.internal.engine.ConfigurationImpl.(ConfigurationImpl.java:120) at org.hibernate.validator.internal.engine.ConfigurationImpl.(ConfigurationImpl.java:96) at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:31) at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:276) ... 66 more

Mas eu vou deixar para lá, eu estou utilizando a api que vocês disponibilizaram na internet e estou conseguindo prosseguir o curso. Obrigado pelo retorno rápido.

solução!

Entendi, de qualquer forma vou pedir pro pessoal verificar essa questão da versão do Java. Acredito que não deve ser algo desse tipo.

Podemos marcar como solucionado esse tópico então?

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software