4
respostas

localhost:8080/api/autores não encontrada pelo browser

Estou tentando rodar a api, usando o comando: java -jar cdcreact-1.0.0-SNAPSHOT.jar

Mas, quando tento acessar no browser, http://localhost:8080/api/autores dá erro de objeto não encontrado.

Alguém ja passou por esse problema ou sabe como resolver?

4 respostas

GlobalSys, boa tarde!

Ao rodar a api via o comando, você está recebendo algum erro?

Me retorna vários códigos, mas acredito que nenhum erro.

Você poderia compartilhar conosco a log? Assim fica mais fácil de identificar o que está ocorrendo

Estou com o mesmo problema, aparece um erro gigantesco no console, tanto que nem consigo colar aqui

2019-06-24 11:26:18.627  INFO 2520 --- [           main] br.com.caelum.cdcreact.Boot              : Starting Boot v1.0.0-SNAPSHOT on DESKTOP-V6MJ2JL with PID 2520 (C:\Users\ame\Documents\workspaces\Alura\react\cdcreact-1.0.0-SNAPSHOT.jar started by ame in C:\Users\ame\Documents\workspaces\Alura\react)
2019-06-24 11:26:18.634  INFO 2520 --- [           main] br.com.caelum.cdcreact.Boot              : No active profile set, falling back to default profiles: default
2019-06-24 11:26:18.752  INFO 2520 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@58c8e4b1: startup date [Mon Jun 24 11:26:18 BRT 2019]; root of context hierarchy
2019-06-24 11:26:20.306  INFO 2520 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'beanNameViewResolver' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (jar:file:/C:/Users/ame/Documents/workspaces/Alura/react/cdcreact-1.0.0-SNAPSHOT.jar!/lib/spring-core-4.2.4.RELEASE.jar!/) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2019-06-24 11:26:20.996  INFO 2520 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$71f1b311] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-06-24 11:26:21.280  WARN 2520 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: 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.
2019-06-24 11:26:21.315 ERROR 2520 --- [           main] o.s.boot.SpringApplication               : Application startup failed

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