henderxe
asked on
Coldfusion Error "The GetColumnNames method was not found" after Applying Patch
Please see attached two (2) files.
One file (Coldfusion_Error.docx) contains the error message, as well as additional server information.
The other file (getSolicitCounts.cfm) is the file referenced in the error message.
Any assistance would be hugely appreciated.
Regards, and Thank you!
Coldfusion_Error.docx
getSolicitCount.txt
One file (Coldfusion_Error.docx) contains the error message, as well as additional server information.
The other file (getSolicitCounts.cfm) is the file referenced in the error message.
Any assistance would be hugely appreciated.
Regards, and Thank you!
Coldfusion_Error.docx
getSolicitCount.txt
ASKER
Hello agx,
Sorry for the delay!
Answers your questions follow:
a) It provides a list of the individuals who were EXCLUDED from the mailing list (e.g. folks who have mailing restrictions on their records, such as "Do not Contact", or "Do Not Mail", etc .
b) Query
c) See attached file for code (cffunction_getExcludedIDL ist.docx).
Really appreciate it. This is a production server.
Regards,
cffunction_getExcludedIDList.docx
CFDUMP_Results.docx
Sorry for the delay!
Answers your questions follow:
a) It provides a list of the individuals who were EXCLUDED from the mailing list (e.g. folks who have mailing restrictions on their records, such as "Do not Contact", or "Do Not Mail", etc .
b) Query
c) See attached file for code (cffunction_getExcludedIDL
Really appreciate it. This is a production server.
Regards,
cffunction_getExcludedIDList.docx
CFDUMP_Results.docx
I'll take a look at the new dumps later. There's a couple things that might be problematic under certain conditions. Having said that, honestly getColumnNames() is an undocumented function. Relying it on it is risky because there's always the possibility an update could break your code. Not sure that' s the cause here, but given the new error it might be a good time to switch to a documented method.
Unfortunately, CF doesn't provide a function that returns column names only, but you can create one from the query metatdata. Here's an example. Notice query columns are returned in the original SQL order, not alphabetical like query.columnList
Example:
Function:
Side note,
A) I noticed there's some cfcatch code commented out. Was that part of the original code, because returning "error" instead of query could definitely cause the method not found error.
<!--- <cfcatch type="any">
<cfset error = "#cfcatch.sql#">
<cfreturn error/> --->
B) None of the function variables seem to be localized ie VAR/LOCAL. That could cause problems under some conditions.
C) Probably not related to your error, but some of the queries are at risk for SQL injection. When you get a chance, update them to use cfqueryparam.
Unfortunately, CF doesn't provide a function that returns column names only, but you can create one from the query metatdata. Here's an example. Notice query columns are returned in the original SQL order, not alphabetical like query.columnList
Example:
<cfset getExcludedSolicitCount = queryNew("ZZZ,AAA")>
<cfset columnNameArray = getQueryColumnArray(getExcludedSolicitCount)>
<cfdump var="#columnNameArray#">
Function:
<cffunction name="getQueryColumnArray" returntype="array">
<cfargument name="queryObject" type="query">
<!--- get query metadata --->
<cfset Local.queryMetadata = GetMetaData(arguments.queryObject)>
<cfset Local.namesArray = []>
<!--- extract column names and save to array --->
<cfloop array="#Local.queryMetadata#" index="Local.queryCol">
<cfset arrayAppend(Local.namesArray, Local.queryCol.Name)>
</cfloop>
<cfreturn Local.namesArray>
</cffunction>
Side note,
A) I noticed there's some cfcatch code commented out. Was that part of the original code, because returning "error" instead of query could definitely cause the method not found error.
<!--- <cfcatch type="any">
<cfset error = "#cfcatch.sql#">
<cfreturn error/> --->
B) None of the function variables seem to be localized ie VAR/LOCAL. That could cause problems under some conditions.
C) Probably not related to your error, but some of the queries are at risk for SQL injection. When you get a chance, update them to use cfqueryparam.
(I'd still recommend moving away from the undocumented function, but ...) I took a look at the code. There's nothing obvious that should cause that error. Try adding this debugging code just before the error is thrown:
<!--- debugging --->
<cfset clz = getExcludedSolicitCount.ge tClasss()>
<cfdump var="#clz#">
<cfset obj = createObject("java", clz.name)>
<cfdump var="#obj#">
<!--- line throwing the error --->
<cfset columnList = ArraytoList(getExcludedSol icitCount. GetColumnN ames())>
<!--- debugging --->
<cfset clz = getExcludedSolicitCount.ge
<cfdump var="#clz#">
<cfset obj = createObject("java", clz.name)>
<cfdump var="#obj#">
<!--- line throwing the error --->
<cfset columnList = ArraytoList(getExcludedSol
ASKER
agx
Sorry, I'm still here! Trying to manage multiple issues involving other systems (data warehouse).
I will respond on all of my findings, based on your suggestions, later this afternoon.
Thanks very much for your input - really, really appreciated.
Sorry, I'm still here! Trying to manage multiple issues involving other systems (data warehouse).
I will respond on all of my findings, based on your suggestions, later this afternoon.
Thanks very much for your input - really, really appreciated.
ASKER
agx:
Get the following error when adding the debugging code above:
Message The getClasss method was not found.
Detail Either there are no methods with the specified method name and argument types or the getClasss method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.
Extended Info
Tag Context C:\ColdFusion9\wwwroot\art \views\cfm \exportRep orts\idLis tGeneratio n\getSolic itCount.cf m (27)
C:\ColdFusion9\wwwroot\Mac hII\framew ork\ViewCo ntext.cfc (114)
C:\ColdFusion9\wwwroot\Mac hII\framew ork\EventC ontext.cfc (475)
C:\ColdFusion9\wwwroot\Mac hII\framew ork\comman ds\ViewPag eCommand.c fc (92)
C:\ColdFusion9\wwwroot\Mac hII\framew ork\EventH andler.cfc (88)
C:\ColdFusion9\wwwroot\Mac hII\framew ork\Reques tHandler.c fc (386)
C:\ColdFusion9\wwwroot\Mac hII\framew ork\Reques tHandler.c fc (334)
C:\ColdFusion9\wwwroot\Mac hII\framew ork\Reques tHandler.c fc (278)
C:\ColdFusion9\wwwroot\Mac hII\framew ork\Reques tHandler.c fc (208)
C:\ColdFusion9\wwwroot\Mac hII\mach-i i.cfm (130)
C:\ColdFusion9\wwwroot\art \index.cfm (9)
Thanks.
Get the following error when adding the debugging code above:
Message The getClasss method was not found.
Detail Either there are no methods with the specified method name and argument types or the getClasss method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.
Extended Info
Tag Context C:\ColdFusion9\wwwroot\art
C:\ColdFusion9\wwwroot\Mac
C:\ColdFusion9\wwwroot\Mac
C:\ColdFusion9\wwwroot\Mac
C:\ColdFusion9\wwwroot\Mac
C:\ColdFusion9\wwwroot\Mac
C:\ColdFusion9\wwwroot\Mac
C:\ColdFusion9\wwwroot\Mac
C:\ColdFusion9\wwwroot\Mac
C:\ColdFusion9\wwwroot\Mac
C:\ColdFusion9\wwwroot\art
Thanks.
<cfset clz = getExcludedSolicitCount.getClasss()>
Sorry, typo - my bad. It should be getClass() not getClasss().
ASKER
agx:
I'm not getting any output (or results with the above debugging code. I even added a <cfabort> at the end of the"<cfdump>" lines, and still nothing. I placed the code exactly as you suggested.
Is there something else I need to add, and what type of results are you expecting?
Thanks!
I'm not getting any output (or results with the above debugging code. I even added a <cfabort> at the end of the"<cfdump>" lines, and still nothing. I placed the code exactly as you suggested.
Is there something else I need to add, and what type of results are you expecting?
Thanks!
(Edit: Added try/catch to code snippet)
No, that should be all you need.
Since that method should work w/any query object, the error suggests getExcludedSolicitCount doesn't actually contain a query when it occurs. Here's a standalone example and the expected results. It should produce a dump of the class, telling us what type of object "getExcludedSolicitCount" is AND whether its really missing a getColumnNames() method as the error message claims....
BTW, any change if you use the alternate method of grabbing the column names?
Standalone example
No, that should be all you need.
Since that method should work w/any query object, the error suggests getExcludedSolicitCount doesn't actually contain a query when it occurs. Here's a standalone example and the expected results. It should produce a dump of the class, telling us what type of object "getExcludedSolicitCount" is AND whether its really missing a getColumnNames() method as the error message claims....
BTW, any change if you use the alternate method of grabbing the column names?
Standalone example
<!--- simulate query returned from CFC --->
<cfset getExcludedSolicitCount = queryNew("ID,Name")>
<!--- debugging --->
<cfset clz = getExcludedSolicitCount.getClass()>
<cfdump var="#clz#">
<cfset obj = createObject("java", clz.name)>
<cfdump var="#obj#">
<cftry>
<cfdump var="#getExcludedSolicitCount.getColumnNames()#">
<cfcatch>
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
ASKER
_agx
Sorry . . will respond shortly!
Andy
Sorry . . will respond shortly!
Andy
ASKER
_agx:
Truly appreciate your patience!
The results of your "alternate method", and determining if the "getColumnNames" method actually exists, is in the attached file. It appears that it does NOT exists.
However, this application as worked the past 4 years, or so.
I'm told that the Coldfusion error could be due to a "failed" AJAX call. If this is "out of scope" of our original conversation, please let me know, and I'll submit another question, giving you full credit for this one, of course.
Included in the attached file is an error message generated by Firebug. I have attached the function referred to in the "main.js" file cited in the error by Firebug (Line 2354), which I've highlighted in yellow. I can say with certainty that it all leads back to the original error on Line 27 in the first files I sent to you (getSolicitCount.cfm).
I have some, but not a lot of knowledge of either Javascript, or AJAX. Let me know if you need additional information.
Thank you!!
cf_methods.docx
Truly appreciate your patience!
The results of your "alternate method", and determining if the "getColumnNames" method actually exists, is in the attached file. It appears that it does NOT exists.
However, this application as worked the past 4 years, or so.
I'm told that the Coldfusion error could be due to a "failed" AJAX call. If this is "out of scope" of our original conversation, please let me know, and I'll submit another question, giving you full credit for this one, of course.
Included in the attached file is an error message generated by Firebug. I have attached the function referred to in the "main.js" file cited in the error by Firebug (Line 2354), which I've highlighted in yellow. I can say with certainty that it all leads back to the original error on Line 27 in the first files I sent to you (getSolicitCount.cfm).
I have some, but not a lot of knowledge of either Javascript, or AJAX. Let me know if you need additional information.
Thank you!!
cf_methods.docx
ASKER
_agx:
The file I uploaded is incomplete!
Uploading complete file!
Thanks
cf_methods_other_stuff.docx
The file I uploaded is incomplete!
Uploading complete file!
Thanks
cf_methods_other_stuff.docx
It appears that it does NOT exists.
You need to expand the dump to show the parent class too (not expanded by default). Notice in the earlier dump that method is actually defined in the parent class: coldfusion.sql.Table
I'm told that the Coldfusion error could be due to a "failed" AJAX call.
Hm... I don't see how, since it's clearly a CF error message.
Variable getQueryColumnArray is undefined
From the error message, it sounds like you forgot to add the function to that page:
<cffunction name="getQueryColumnArray" returntype="array">
<cfargument name="queryObject" type="query">
<!--- get query metadata --->
<cfset Local.queryMetadata = GetMetaData(arguments.queryObject)>
<cfset Local.namesArray = []>
<!--- extract column names and save to array --->
<cfloop array="#Local.queryMetadata#" index="Local.queryCol">
<cfset arrayAppend(Local.namesArray, Local.queryCol.Name)>
</cfloop>
<cfreturn Local.namesArray>
</cffunction>
The file I uploaded is incomplete!
Got it. If an error occurs in the CF code, that could definitely cause an cascade error with the ajax. I'll have to take a closer look at the ajax dump.
ASKER
So is it working now? :)
I don't see those files, but ... that should work too, as long as it's public. Just access it through the
idListGenerationObj object. Not tested, but something like:
<cfset columnNameArray = idListGenerationObj .getQueryColumnArray(getEx cludedSoli citCount)>
BTW, I did add the function, but not to the same page. Instead, I tried to integrate it with the file (idListGenerationDAO.cfc).See file (function_results) for results.
I don't see those files, but ... that should work too, as long as it's public. Just access it through the
idListGenerationObj object. Not tested, but something like:
<cfset columnNameArray = idListGenerationObj .getQueryColumnArray(getEx
ASKER
_agx:
The error I showed earlier (getQueryColumnArray Undefined), was when I attempted to integrate it with the following lines in "getSolicitCount.cfm"
<cfset getExcludedSolicitCount = queryNew("ZZZ,AAA")>
<cfset columnNameArray = getQueryColumnArray(getExc ludedSolic itCount)>
<cfdump var="#columnNameArray#">
and the function in the file "isListGenerationDAO.cfc".
The results above were generated as a "standalone" test to see if it worked. It has to be integrated with the above mentioned files in order work properly. I'm not seeing the connection at this point.
Can you place it where you think it needs to go in both files?
The error I showed earlier (getQueryColumnArray Undefined), was when I attempted to integrate it with the following lines in "getSolicitCount.cfm"
<cfset getExcludedSolicitCount = queryNew("ZZZ,AAA")>
<cfset columnNameArray = getQueryColumnArray(getExc
<cfdump var="#columnNameArray#">
and the function in the file "isListGenerationDAO.cfc".
The results above were generated as a "standalone" test to see if it worked. It has to be integrated with the above mentioned files in order work properly. I'm not seeing the connection at this point.
Can you place it where you think it needs to go in both files?
ASKER
_agx:
Attaching the function in "idListGenerationDAO.cfc", which may be helpful!
getExcludedIDList_Function.docx
Attaching the function in "idListGenerationDAO.cfc",
getExcludedIDList_Function.docx
ASKER
_agx:
I just saw where you suggested how to integrate with the file (idListGenerationDAO.cfc.. I'll give that a try!
I just saw where you suggested how to integrate with the file (idListGenerationDAO.cfc..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
_agx:
Sorry . . . too many things going on!
I'll respond with the latest results probably this evening.
Thanks!
Sorry . . . too many things going on!
I'll respond with the latest results probably this evening.
Thanks!
ASKER
_agx
Many apologies for the delay!
I finally got your revised CF function to work, which was extremely helpful, in that it brought forth the true reason for the CF error.
A stored procedure failed when attempting to make a database call with the error: "ORA- 00054: resource busy and acquire with NOWAIT specified or timeout expired" .
Anyway, truly appreciate your assistance. Changed my focus from strictly CF to other areas (e.g. database).
Thanks, again!
Many apologies for the delay!
I finally got your revised CF function to work, which was extremely helpful, in that it brought forth the true reason for the CF error.
A stored procedure failed when attempting to make a database call with the error: "ORA- 00054: resource busy and acquire with NOWAIT specified or timeout expired" .
Anyway, truly appreciate your assistance. Changed my focus from strictly CF to other areas (e.g. database).
Thanks, again!
No worries at all. I remember seeing your last comment about solving it and could have sworn I'd responded, but .. I guess got busy too :-) Anyway, don't you love those "red-herring" type problems? It's always extremely satisfying when you finally figure it out. Glad you finally tracked it down!
ASKER
agx
Wow - didn't realize this was still open!
Yes - tracking it to the database was certainly somewhat of a relief.
But another issue has surfaced which I'll send as a separate question.
Thanks again!
Wow - didn't realize this was still open!
Yes - tracking it to the database was certainly somewhat of a relief.
But another issue has surfaced which I'll send as a separate question.
Thanks again!
So it works with getSolicitCount, but not getExcludedSolicitCount? That suggests they are different object types. (The variable name suggests it might be a count or number, rather than a query). Can you CFDump getExcludedSolicitCount?
a) What are the contents
b) What type of object (query, number, ....)
c) What code generates it? ie Code inside idListGenerationObj.getExc