3 Replies Latest reply on Apr 30, 2009 10:30 PM by newchickinCF

    CFC Issue when invoking a method

    apocalipsis19 Level 1

      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.

        • 1. Re: CFC Issue when invoking a method
          Dan Bracuk Level 5

          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.

          • 2. Re: CFC Issue when invoking a method
            insuractive Level 3

            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?

            • 3. Re: CFC Issue when invoking a method
              newchickinCF Level 1

              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.