Ao tentar criar meu primeiro controller estou me deparando com o seguinte:
[RequestHandlerObserver] Method GET is not allowed for requested URI. Allowed Methods are [PATCH]
br.com.caelum.vraptor.http.route.MethodNotAllowedException: Method GET is not allowed for requested URI. Allowed Methods are [PATCH]
at br.com.caelum.vraptor.http.route.DefaultRouter.routesMatchingUriAndMethod(DefaultRouter.java:136)
at br.com.caelum.vraptor.http.route.DefaultRouter.parse(DefaultRouter.java:111)
at br.com.caelum.vraptor.http.route.DefaultRouter$Proxy$_$$_WeldClientProxy.parse(Unknown Source)
at br.com.caelum.vraptor.http.DefaultControllerTranslator.translate(DefaultControllerTranslator.java:63)
at br.com.caelum.vraptor.http.DefaultControllerTranslator$Proxy$_$$_WeldClientProxy.translate(Unknown Source)
at br.com.caelum.vraptor.observer.RequestHandlerObserver.handle(RequestHandlerObserver.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
17:45:35,869 DEBUG [VRaptor ] VRaptor ended the request
Meu controller em questão:
package br.com.caelum.vraptor.controller;
import br.com.caelum.vraptor.Controller;
import br.com.caelum.vraptor.Patch;
@Controller
public class ProjetoController {
@Patch("/produto/sobre")
public void sobre() {
System.out.println("passei");
}
}
Minha jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Sobre o projeto</title>
</head>
<body>
<h1>Bem vindo</h1>
<p>Esse é o meu primeiro projeto em vRaptor</p>
</body>
</html>
Estou tentando acessar a URI /produto/sobre e recebendo uma resposta 405
O que está acontece para ele não aceitar um get ?