Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFC Issue when invoking a method

Participant ,
Apr 13, 2009 Apr 13, 2009

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.

TOPICS
Advanced techniques
679
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 13, 2009 Apr 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 28, 2009 Apr 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 30, 2009 Apr 30, 2009
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources