Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Autenticação de Usuário - Erro HTTP 500 - Could not invoke method

Olá pessoal,

Fiz meu projeto assim como explicado no vídeo e no texto, mas quando digito o usuário e a senha dá o seguinte erro: HTTP Status 500 - net.vidageek.mirror.exception.ReflectionProviderException: Could not invoke method autentica.

Já pesquisei aqui na alura e na internet e até agora não consegui resolver.

Segue o erro mais detalhado:

18:04:37,603 DEBUG [DefaultExceptionMapper] find for exception class net.vidageek.mirror.exception.ReflectionProviderException 18:04:37,603 DEBUG [DefaultExceptionMapper] find for exception class java.lang.NullPointerException out 25, 2014 6:04:37 PM org.apache.catalina.core.StandardWrapperValve invoke GRAVE: Servlet.service() for servlet [default] in context with path [/vraptor-produtos] threw exception [net.vidageek.mirror.exception.ReflectionProviderException: Could not invoke method autentica] with root cause java.lang.NullPointerException at br.com.caelum.vraptor.controller.LoginController.autentica(LoginController.java:41) at br.com.caelum.vraptor.controller.LoginController$Proxy$$$_WeldClientProxy.autentica(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.vidageek.mirror.provider.java.PureJavaMethodReflectionProvider.invoke(PureJavaMethodReflectionProvider.java:38) at net.vidageek.mirror.invoke.MethodHandlerByMethod.withArgs(MethodHandlerByMethod.java:54) at br.com.caelum.vraptor.observer.ExecuteMethod.execute(ExecuteMethod.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253) at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232) at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169) at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165) at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119) at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112) at org.jboss.weld.event.EventImpl.fire(EventImpl.java:83) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:78) at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:98) at br.com.caelum.vraptor.interceptor.FlashInterceptor$Proxy$$$WeldClientProxy.intercept(Unknown Source) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:58) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83) at br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor.intercept(ExceptionHandlerInterceptor.java:75) at br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor$Proxy$$$WeldClientProxy.intercept(Unknown Source) at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:58) at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83) at br.com.caelum.vraptor.core.DefaultInterceptorStack.start(DefaultInterceptorStack.java:93) at br.com.caelum.vraptor.core.DefaultInterceptorStack$Proxy$$$_WeldClientProxy.start(Unknown Source) at br.com.caelum.vraptor.observer.RequestHandlerObserver.handle(RequestHandlerObserver.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266) at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253) at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232) at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169) at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165) at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119) at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112) at org.jboss.weld.event.EventImpl.fire(EventImpl.java:83) at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)

1 resposta
solução!

Consegui resolver o problema. Tinha esquecido de colocar @Inject no Construtor do LoginController.