"405 - Method not allowed" on rpc call

1,425 views
Skip to first unread message

L Frohman

unread,
Sep 11, 2007, 6:05:43 PM9/11/07
to Google-We...@googlegroups.com
I have an app that makes an rpc call using -noserver. It works fine on my test machine in web and hosted mode
(tomcat 5.5.9), but when I implement on my production machine, I get
 
405 - Method not allowed
The requested method POST is not allowed for the URL ...
 
Has anyone seen this before, or know what would cause this?
I have all the same files uploaded from my development machine to the server machine.
 
 

Eric B

unread,
Sep 11, 2007, 8:21:27 PM9/11/07
to Google Web Toolkit
This is because your RPC call is using the POST method. If possible,
use the GET method for the your call. If not, then you'll have to
find the Apache rule for this error. I couldn't find it because I
don't have permission to access the httpd.conf file on my hosted
virtual server, so I just changed my RPC's to use the GET method.

Hope this helps,
Eric

L Frohman

unread,
Sep 11, 2007, 9:19:52 PM9/11/07
to Google-We...@googlegroups.com
On my development machine, If I just type in
http://localhost/servlet
I get

HTTP Status 405 - HTTP method GET is not supported by this URL

You are saying there is an Apache rule to set GET vs. POST?
How do I


"so I just changed my RPC's to use the GET method."

Thanks,
Lance

Eric B

unread,
Sep 12, 2007, 11:58:04 AM9/12/07
to Google Web Toolkit
I guess I had this problem with an ajax call, not a rpc call. So I
had to change my code to use RequestBuilder.Method.GET in the
RequestBuilder constructor.

For rpc, if your server-side code implements RemoteServiceServlet,
then both the get and post methods should be enabled, but I'd check
the source for that class to make sure. There also might be a setting
in your web.xml file that can restrict the method type.

Sorry about the confusion.

Thanks,
Eric

charlie...@gmail.com

unread,
Sep 12, 2007, 5:12:28 PM9/12/07
to Google Web Toolkit
This could be configuration on the HTTP server, but also may be
simpler. What is the endpoint set to in your RPC call?

I ask because it might be that you are using a different path or
context on the hosted server than on the "production" one, are you
using GWT.getModuleBaseURL()?

Double check that the endpoint is valid for the production machine.

L Frohman

unread,
Sep 13, 2007, 3:53:08 AM9/13/07
to Google-We...@googlegroups.com
I found the problem, the server has jsf/facelets and was changing a call to
/app_home/servlet_name
(no extension)
to
/app_home/servlet_name.xhtml
which is a valid jsf/facelets page on the server.
I guess this is some server configuration.

I changed the servlet mapping to
/app_home/servlet_name.rpc
and everything works fine.

Thanks.


----- Original Message -----
From: <charlie...@gmail.com>
To: "Google Web Toolkit" <Google-We...@googlegroups.com>

wduffee

unread,
Sep 14, 2007, 3:08:49 PM9/14/07
to Google Web Toolkit
L Frohman,

So when you say that you "changed the servlet mapping to...." do you
mean that the URL-Path is now /app_home/servlet_name.rpc, or that you
had to re-name your servlet? I know that's probably a silly question,
just trying to follow. And this is in the web.xml, or in the *.gwt.xml
file as well?

Thanks,
Wesley

On Sep 13, 3:53 am, "L Frohman" <lfroh...@gmail.com> wrote:
> I found the problem, the server has jsf/facelets and was changing acallto
> /app_home/servlet_name
> (no extension)
> to
> /app_home/servlet_name.xhtml
> which is a valid jsf/facelets page on the server.
> I guess this is some server configuration.
>
> I changed the servlet mapping to
> /app_home/servlet_name.rpc
> and everything works fine.
>
> Thanks.
>
> ----- Original Message -----
> From: <charlie.coll...@gmail.com>
> To: "Google Web Toolkit" <Google-We...@googlegroups.com>
> Sent: Wednesday, September 12, 2007 2:12 PM
> Subject: Re: "405 - Method not allowed" onrpccall
>
> > This could be configuration on the HTTP server, but also may be
> > simpler. What is the endpoint set to in yourRPCcall?
>
> > I ask because it might be that you are using a different path or
> > context on the hosted server than on the "production" one, are you
> > using GWT.getModuleBaseURL()?
>
> > Double check that the endpoint is valid for the production machine.
>
> > On Sep 11, 6:05 pm, "L Frohman" <lfroh...@gmail.com> wrote:

> >> I have an app that makes anrpccallusing -noserver. It works fine on my

L Frohman

unread,
Sep 15, 2007, 1:57:23 PM9/15/07
to Google-We...@googlegroups.com
In web.xml, I changed:

<servlet-mapping>
<servlet-name>servlet_name</servlet-name>
<url-pattern>/servlet_name</url-pattern>
</servlet-mapping>

to

<servlet-mapping>
<servlet-name>servlet_name</servlet-name>
<url-pattern>/servlet_name.rpc</url-pattern>
</servlet-mapping>

(and changed the AsyncCallback call in the client)

Reply all
Reply to author
Forward
0 new messages