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
henderxeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

_agx_Commented:
(Edit: Never mind. Missed the version info in the 1st doc)

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.getExcludedIDlist (....)?
0
henderxeAuthor Commented:
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_getExcludedIDList.docx).

   Really appreciate it.  This is a production server.

   Regards,
cffunction_getExcludedIDList.docx
CFDUMP_Results.docx
0
_agx_Commented:
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:

 <cfset getExcludedSolicitCount = queryNew("ZZZ,AAA")>
 <cfset columnNameArray = getQueryColumnArray(getExcludedSolicitCount)>
 <cfdump var="#columnNameArray#">

Open in new window


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>

Open in new window


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.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

_agx_Commented:
(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.getClasss()>
<cfdump var="#clz#">
<cfset obj = createObject("java", clz.name)>
<cfdump var="#obj#">

<!--- line throwing the error --->
<cfset columnList = ArraytoList(getExcludedSolicitCount.GetColumnNames())>
0
henderxeAuthor Commented:
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.
0
henderxeAuthor Commented:
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\exportReports\idListGeneration\getSolicitCount.cfm (27)
C:\ColdFusion9\wwwroot\MachII\framework\ViewContext.cfc (114)
C:\ColdFusion9\wwwroot\MachII\framework\EventContext.cfc (475)
C:\ColdFusion9\wwwroot\MachII\framework\commands\ViewPageCommand.cfc (92)
C:\ColdFusion9\wwwroot\MachII\framework\EventHandler.cfc (88)
C:\ColdFusion9\wwwroot\MachII\framework\RequestHandler.cfc (386)
C:\ColdFusion9\wwwroot\MachII\framework\RequestHandler.cfc (334)
C:\ColdFusion9\wwwroot\MachII\framework\RequestHandler.cfc (278)
C:\ColdFusion9\wwwroot\MachII\framework\RequestHandler.cfc (208)
C:\ColdFusion9\wwwroot\MachII\mach-ii.cfm (130)
C:\ColdFusion9\wwwroot\art\index.cfm (9)

Thanks.
0
_agx_Commented:
<cfset clz = getExcludedSolicitCount.getClasss()>

Open in new window


Sorry, typo - my bad.  It should be getClass()  not getClasss().
0
henderxeAuthor Commented:
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!
0
_agx_Commented:
(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

<!--- 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>

Open in new window



Code Result (method list is collapsed)
What I'd expect to see - GetColumnNames method exists
0
henderxeAuthor Commented:
_agx

    Sorry  .  . will respond shortly!

Andy
0
henderxeAuthor Commented:
_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
0
henderxeAuthor Commented:
_agx:

   The file I uploaded is incomplete!

  Uploading complete file!

Thanks
cf_methods_other_stuff.docx
0
_agx_Commented:
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>

Open in new window

0
_agx_Commented:
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.
0
henderxeAuthor Commented:
_agx:

  OK - great!

 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.

function_test.PNG
 See file (getColumnNames_Table)  for results that I missed earlier:

getcolumnNames_table.PNG
Regards!
0
_agx_Commented:
So is it working now? :)

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(getExcludedSolicitCount)>
0
henderxeAuthor Commented:
_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(getExcludedSolicitCount)>
                         <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?
0
henderxeAuthor Commented:
_agx:

Attaching the function in "idListGenerationDAO.cfc", which may be helpful!
getExcludedIDList_Function.docx
0
henderxeAuthor Commented:
_agx:

  I just saw where you suggested how to integrate with the file (idListGenerationDAO.cfc..  I'll give that a try!
0
_agx_Commented:
Here's a dummy example of what I had in mind:

Test page:
<!--- create CFC instance --->
<cfset idListGenerationObj = createObject("component", "idListGenerationDAO").init("dbName", "dbUser", "dbPassword")>
<!--- simulate query returned from CFC --->
<cfset getExcludedSolicitCount = queryNew("ID,Name")>
<!--- function usage --->
<cfset columnNameArray = idListGenerationObj.getQueryColumnArray(getExcludedSolicitCount)>
<cfdump var="#columnNameArray#">

Open in new window


idListGenerationDAO.cfc

<cfcomponent>
	<!--- simulate init() method --->
	<cffunction name="init" returntype="any" access="public">
		<cfargument name="dbName" type="string" required="true">
		<cfargument name="dbUserName" type="string" required="true">
		<cfargument name="dbPassword" type="string" required="true">
		<cfreturn this>
	</cffunction>
	
	<cffunction name="getQueryColumnArray" returntype="array" access="public">
		<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>
</cfcomponent>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
henderxeAuthor Commented:
_agx:

   Sorry .  .  . too many things going on!

   I'll respond with the latest results probably this evening.

   Thanks!
0
henderxeAuthor Commented:
_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!
0
_agx_Commented:
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!
0
henderxeAuthor Commented:
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!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.