我在函数内创建一个查询。一切正常,直到这一行:
ulist = new query();
然后我收到错误:
无法找到ColdFusion组件或接口查询。
代码:
//GET USERS LISTS
remote query function getUserLists(userid) {
//CONFIGURE twitter4j
init();
//DEFINE USER LIST QUERY
var userLists = querynew("id, name, member_count", "Integer, VarChar, Integer");
//GET THE USER LISTS
getLists = t4j.getUserLists(#arguments.userid#);
//BUILD THE USER LIST QUERY
for (i=1;i LTE ArrayLen(getLists);i=i+1) {
newRecord = queryAddRow(userLists);
newRecord = querySetCell(userLists, "id", getLists[i].getId());
newRecord = querySetCell(userLists, "name", getLists[i].getName());
newRecord = querySetCell(userLists, "member_count", getLists[i].getMemberCount());
}
//SORT THE USER LIST BY NAME
ulist = new query();
ulist.setDBType("query");
ulist.setAttributes(sourceQuery=userLists);
ulist.setSQL("select * from sourceQuery order by name");
userListsSorted = ulist.execute().getresult();
//RETURN THE SORTED USER LIST QUERY
return userListsSorted;
}
答案 0 :(得分:1)
根据Twitter,确保您有一个指向[instance] / customtags的自定义标记路径 - 默认情况下应该存在。您可以使用映射,指向该[instance] / customtags目录中的一个子目录,例如:/ coldfusion指向[instance] \ CustomTags \ com \ adobe \ coldfusion,然后使用:
ulist = new coldfusion.query();
// etc
我只是使用自定义标记目录方法。
答案 1 :(得分:0)
尝试使用完整路径:
ulist = new com.adobe.coldfusion.query()