i am tryingti implement the linshare affiliate program in Cf
using this method
http://blog.shortfusion.com/index.cfm/2008/11/20/Linkshare-Affiliate-Program-wit
h-ColdFusion
in this method it talks about the failure of the HMAC MD% function in
Coldfusion and uses this java component method to get around it.
http://blog.shortfusion.com/index.cfm/2008/11/21/ColdFusion-HMACMD5-function
i have 90% of this implemented but i cannot get the component recognized by
the server and so am stuck on the final stage.
here is the error i am getting.
"Could not find the ColdFusion Component or Interface /components.utils.
Ensure that the name is correct and that the component or interface exists.
The error occurred on line 87.
on the /ls_post.cfm page "
The relevant code is attached
i have a components folder sitting in the webroot and a utils.cfc in there
containing all the stuff to perform the HASH.
can anyone see why the server is not recognizing the component?
thanks
<cfinvoke component="/components.utils" method="getUTCTime"
returnvariable="linkshare_server_response">
-==cfSearching==- - 26 Feb 2009 22:27 GMT
Get rid of the slash so the path consists of dot notation only:
<cfinvoke component="components.utils"
...>
See also the documentation for information about how CF searches for
components.
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=buildingCompon
ents_27.html
-==cfSearching==- - 03 Mar 2009 04:32 GMT
> i have a components folder sitting in the webroot and a utils.cfc
> nope, already tried that
Can you create an instance of utils.cfc when directly inside your "components"
folder? If you can, use the component's metadata to get check the path. Is it
what you think it is?
<cfset o = createObject("component", "utils")>
<cfdump var="#getMetaData(o)#">
alexfrates@gmail.com - 15 Apr 2009 04:26 GMT
@anarkyman,
when you invoke a component or use create object to instantiate one,
the "/components.utils" refers to the location of the utils.cfc
relative to your site root.
In this example, you would have a utils.cfc in the a folder called
components that is directly under your site root.
if i understand correctly, your utils.cfc is directly in your site
root folder, therefore the call should be like: <cfset
result=createObject("component","/utils").getUTCTime()>
The error you are getting is CF telling you that it cannot locate the
cfc (or object) you are trying to instantiate. It is a path issue.
As another example, if you had the following file structure:
-ROOT
/components
/subfolder1
/subfolder2
utils.cfc
you can instantiate the cfc like so: <cfset result = createObject
("component","/components.subfolder1.subfolder2.utils")>. You can then
call any function inside that cfc as so: <cfset temp1 =
result.functionName()>
Hope this helps.