Skip to main content
Known Participant
July 26, 2011
Question

Why do I get this error: The method GET was not found in component...?

  • July 26, 2011
  • 1 reply
  • 664 views

I am using cfajaxproxy to create a JS object for a simple CFC. Whenever I attempt to invoke any method in this component, I get this error message in both the ColdFusion Ajax Logger window and in Firebug:

The method GET was not found in component c:\mypath\mycomponent.cfc

Of course, there is no method named "get" in this component and my code is not attempting to run a method by that name. Here's the code from the component:

<cfcomponent displayname="My Component" >

<cffunction name="test" access="remote" returntype="string" returnformat="JSON">
    <cfargument name="CityID">
    <cfreturn arguments.CityID>
</cffunction>

</cfcomponent>

And here is the code in the script that calls this (which is located in a different subdirectory from the CFC):


<cfajaxproxy cfc="myPath.myComponent" jsclassname="oMP">


<script type="text/javascript">

    var objMP = new oMP();
</script>

...

<form NAME="frmMP" method="post" action="">
...

<input type="button" value="test" onclick="alert(objMP.test(384));return true;">

</form>

...

There are no problems when I invoke this test method in cfscript by instantiating the component and then calling the function.

Anyone have any clues as to what might be going on here? What is the significance of the reference to the GET method? Does this have something to do with HTTP GET?

This topic has been closed for replies.

1 reply

lchalnickAuthor
Known Participant
July 26, 2011

Here's one more clue from the ColdFusion Ajax Logger window. This is the "info:" type entry that appears in the logger just before the error message.

http: HTTP GET  /myDir/myComponent.cfc?method=test&returnFormat=json&argumentCollection=%7B%22CityID%22%3A%22347%22%7D&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=DEC69B3E82CDD8762555CBECEA295069&_cf_rc=1

This makes me wonder if there is some issue with HTTP GET. Perhaps some kind of server configuration issue. BTW, this is a newly configured CF9 server.

Inspiring
August 26, 2011

Just out of curiosity, what happens if you try an consume your component method using a RESTful style URL call in a browser:

http://[MY_SERVER_NAME]/myDir/myComponent.cfc?method=test&returnFormat=json&other=vars&go=here

Do you get an error or do you receive your expected results in JSON format?