Pessoal estou levando um “java.lang.NullPointerException:” em tempo de execução chato pra caramba, e não achei a solução, estou usando o JpaRepository padrão do Spring, nos teste do curso funcionaram, mas no meu projeto do Spring o negocio tá osso.
Pergunta como solucionar isso?
Thu Apr 07 09:24:39 BRT 2022
[116332a4-37] There was an unexpected error (type=Internal Server Error, status=500).
Cannot invoke "br.inf.aps.repository.EstadoRepository.findAll()" because "this.estadoRepository" is null
java.lang.NullPointerException: Cannot invoke "br.inf.aps.repository.EstadoRepository.findAll()" because "this.estadoRepository" is null at br.inf.aps.controllers.EstadoController.pesquisar(EstadoController.java:36) Suppressed: The stacktrace has been enhanced by Reactor, refer to additional information below: Error has been observed at the following site(s): *__checkpoint ⇢ org.springframework.web.filter.reactive.ServerWebExchangeContextFilter [DefaultWebFilterChain] *__checkpoint ⇢ HTTP GET "/estado" [ExceptionHandlingWebHandler] Original Stack Trace: at br.inf.aps.controllers.EstadoController.pesquisar(EstadoController.java:36) at br.inf.aps.controllers.EstadoController$$FastClassBySpringCGLIB$$176b314e.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698) at br.inf.aps.controllers.EstadoController$$EnhancerBySpringCGLIB$$b69be92d.pesquisar(<generated>) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.springframework.web.reactive.result.method.InvocableHandlerMethod.lambda$invoke$0(InvocableHandlerMethod.java:144) at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:152) at