Skip to main content
Inspiring
April 13, 2009
Question

CFC Issue when invoking a method

  • April 13, 2009
  • 3 replies
  • 709 views

Hello Community:

I am getting the following error message when invoking my CFC:

"If the component name is specified as a type of this argument, its possible that a definition file for the component cannot be found or is not accessible."

This is the code where I call the method:

<cfinvoke component="cfc.cartSelection" method="#meth#">
                <cfinvokeargument name="inum" value="#ihdnum#">
                <cfinvokeargument name="qty" value="#qty#">
            </cfinvoke>

Any thoughts are deeply appreciated!

Ysais.

This topic has been closed for replies.

3 replies

Inspiring
May 1, 2009

Hi, You specified this:

cfc.cartSelection

check to make sure that you have a cfc folder and cartSelection.cfc as the CFC inside the CFC Folder.

I would suggest you 1 way. if you are using application.cfc or application.cfm:

try as:

<cfset request.cfcPath = cfc>

if you cfc is in admin path and application.cfm file is outside the admin root

you can fetch it as:

<cfset request.cfcPath =admin.cfc>

Try it and let me know how it goes.

Also your method name is dynamic, make sure the method name you are calling exist or not.

Inspiring
April 28, 2009

Check the following:

1) That the following path will reach your CFC: "/cfc/cartSelection.cfc" - if not, you may need to set up a CF mapping to point /cfc to the correct directory

2) Have you tried hardcoding in the value of the method?  Does that return a valid result, or are you still getting the same error?

Inspiring
April 13, 2009

The two things that jump out at me are the component and method attributes of your cfinvoke tag.  Is the name of your cfc file really cfc.CartSelection.cfc?  Plus, using a variable to for the method you want to run is something you don't see very often.