我正在使用ColdFusion 10,Windows 7 64位,Railo 4并安装了Facebook CF SDK。当我尝试测试安装时,它会抛出这个错误:
Could not find the ColdFusion component or interface facebook.sdk.FacebookApp.
Ensure that the name is correct and that the component or interface exists.
The error occurred in C:/ColdFusion10/cfusion/wwwroot/facebook-cf-sdk/examples/website/index.cfm: line 34
32 : } else {
33 : // Create facebookApp instance
34 : facebookApp = new FacebookApp(appId=APP_ID, secretKey=SECRET_KEY);
35 :
36 : // See if there is a user from a cookie or session
如何修复此错误并将此Facebook API与ColdFusion集成?
答案 0 :(得分:3)
在说明中看起来像是一个错误,而不是将文件夹facebook-cf-sdk
重命名为facebook
,因为它正在寻找cfc at。
答案 1 :(得分:1)
布什的回答肯定能解决问题。另一种方法是修改导入以匹配您的目录结构:
facebook-cf-sdk / examples / website / index.cfm
<cfscript>
import "facebook-cf-sdk.sdk.FacebookApp";
import "facebook-cf-sdk.sdk.FacebookGraphAPI";
facebook-cf-sdk / examples / website / tags.cfm
<cfimport taglib="/facebook-cf-sdk/sdk/tags" prefix="facebook" />
<cfscript>
import "facebook-cf-sdk.sdk.FacebookApp";
import "facebook-cf-sdk.sdk.FacebookGraphAPI";
包含连字符的组件路径需要引号。
希望这有帮助, - Minh