• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to fix "getMetaData method was not found" error

Explorer ,
Feb 19, 2019 Feb 19, 2019

Copy link to clipboard

Copied

Hello,

I installed CF2018 on Win2016 server and moved my code into it from CF9. Now I am receiving errors that I did not receive in CF9.

09:15:16.016 - Object Exception - in D:/Application.cfc : line 249

The getMetaData method was not found.

09:15:16.016 - Application Exception - in D:/Application.cfc : line 249

An exception occurred while calling the function getMetaData.

The line 249 refers to the <cfdump> tag in the following function in Application.cfm

<cffunction name="onError" returnType="void" output="false">

<cfargument name="exception" required="true">

<cfargument name="eventname" type="string" required="true">

        <cfset var errortext = "">

   

        <cfif isDefined("arguments.exception.rootCause") AND arguments.exception.rootCause IS "coldfusion.runtime.AbortException">

            <cfreturn/>

        </cfif>

            

<cfmail

to="me@company.com"

from="cf_server@company.com"

subject="ColdFusion request failed for #UCase(listlast(SESSION.curr_user,"\"))#"

type="html">

<p><strong>Error: <font color="red">#arguments.exception.message#</font></strong></p>   

        <strong>Time:</strong> #dateFormat(now(), "short")# #timeFormat(now(), "short")#<br>

        <strong>Error on page:</strong> http://#cgi.server_name##cgi.script_name#?#cgi.query_string#<br>

        <strong>Referrer:</strong> #cgi.HTTP_REFERER#   

    <p></p>

       <cfdump var="#arguments.exception#" label="Error">

</cfmail>

    <cfabort>

</cffunction>

Does anyone know how to fix it?

Thanks,

Eugene

Views

4.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 19, 2019 Feb 19, 2019

Copy link to clipboard

Copied

I don't have an answer for your question, but I must say that CF9 => CF2018 is a HUGE jump.  You should be getting all kinds of errors with CF9 code, for a variety of reasons including (but not limited to) deprecated tags, deprecated/altered attributes and/or parameters, and just plain security issues.

You just might have a lot of code to rewrite in order to keep this site/app running under CF2018.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 19, 2019 Feb 19, 2019

Copy link to clipboard

Copied

Thanks for reply. So far, this is the only message I am receiving after upgrade.

Since it referring to #arguments.exception#, is there a new way to report an error in 2018?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 19, 2019 Feb 19, 2019

Copy link to clipboard

Copied

I haven't worked with anything after CF11, so unfortunately can't help with that.  But hopefully someone with CF2018 experience will look in here and post some suggestions.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 19, 2019 Feb 19, 2019

Copy link to clipboard

Copied

Oh, Eugene, that is weird. Is this construction perhaps the problem:

<cfmail>

    ...

    <cfdump var="#arguments.exception#" label="Error">

    ...

</cfmail>?

Try this:

<cfsavecontent variable="errorDump" >

<cfdump var="#arguments.exception#" label="Error">

</cfsavecontent>

<cfmail>

    ...

    #errorDump#

    ...

</cfmail>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

Just tried that and ... have the same errors

<cffunction name="onError" returnType="void" output="true">

<cfargument name="exception" required="true">

<cfargument name="eventname" type="string" required="true">

<cfset var errortext = "">

<!--- Display error to user --->

<img src="../../IMAGES/SiteError.gif" width="750" height="150" alt="Site Error" border="0">

<p></p>

Error: <cfoutput><strong>#arguments.exception.message#</strong></cfoutput><br />

Error details were sent to the application administrator.<br />

<p></p>

<a href="<cfoutput>#CGI.http_referer#</cfoutput>">Go Back</a> 

  

<cfsavecontent variable="errortext">

<cfoutput>

Time: #dateFormat(now(), "short")# #timeFormat(now(), "short")#<br />

Error on page: http://#cgi.server_name##cgi.script_name#?#cgi.query_string#<br />

Referrer: #cgi.HTTP_REFERER#

<cfdump var="#arguments.exception#" label="Error">

</cfoutput>

</cfsavecontent>

<cfmail to="epipko@unionbay.com"

from="cf_server@unionbay.com"

subject="ColdFusion request failed for #UCase(listlast(SESSION.curr_user,"\"))#"

type="html">

#errortext#

</cfmail>

</cffunction>

Exceptions

13:16:09.009 - Object Exception - in D:/Application.cfc : line 279

         The getMetaData method was not found. 

13:16:09.009 - Application Exception - in D:/Application.cfc : line 279

         An exception occurred while calling the function getMetaData. 

13:16:09.009 - Object Exception - in D:/Application.cfc : line 279

         The getMetaData method was not found. 

13:16:09.009 - Application Exception - in D:/Application.cfc : line 279

         An exception occurred while calling the function getMetaData. 

13:16:09.009 - Object Exception - in D:/Application.cfc : line 279

         The getMetaData method was not found. 

13:16:09.009 - Application Exception - in D:/Application.cfc : line 279

         An exception occurred while calling the function getMetaData.

Line 279 refers to this:

<cfdump var="#arguments.exception#" label="Error">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

That is not what I suggested. When you embed cfdump within cfoutput, you're repeating what my example was trying to avoid.

Try this:

<cfsavecontent variable="errortext">

<cfoutput>

    Time: #dateFormat(now(), "short")# #timeFormat(now(), "short")#<br />

    Error on page: http://#cgi.server_name##cgi.script_name#?#cgi.query_string#<br />

    Referrer: #cgi.HTTP_REFERER#

</cfoutput>

<cfdump var="#arguments.exception#" label="Error">

</cfsavecontent>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

changed it to

<cfsavecontent variable="errortext">

<cfoutput>

Time: #dateFormat(now(), "short")# #timeFormat(now(), "short")#<br />

Error on page: http://#cgi.server_name##cgi.script_name#?#cgi.query_string#<br />

Referrer: #cgi.HTTP_REFERER#

<!---<cfdump var="#arguments.exception#" label="Error">--->

</cfoutput>

<cfdump var="#arguments.exception#" label="Error">

</cfsavecontent>

and still getting same errors referring to <cfdump var="#arguments.exception#" label="Error">

Exceptions

14:00:25.025 - Object Exception - in D:/UB_CF_APPS/PROD/Application.cfc : line 281

         The getMetaData method was not found. 

14:00:25.025 - Application Exception - in D:/UB_CF_APPS/PROD/Application.cfc : line 281

         An exception occurred while calling the function getMetaData.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

This makes me think that something might have gone awry during the installation.  getMetaData should be available.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

Hmmm, odd. What happens when you run the following CFM page. It contains just 1 line.

testpage.cfm

<cfdump var="#server#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

<cfdump var="#server#"> works just fine

the workaround using <cfscript> does not work: shows same errors

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

Let's eliminate any effects from the argument. What about this test:

<cfsavecontent variable="errortext">

<cfoutput>

Time: #dateFormat(now(), "short")# #timeFormat(now(), "short")#<br />

Error on page: http://#cgi.server_name##cgi.script_name#?#cgi.query_string#<br />

Referrer: #cgi.HTTP_REFERER#

</cfoutput>

<cfdump var="#server#" label="server">

</cfsavecontent>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

I did not get the same error this time!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

Oh! What did you get?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

So the dump works. At least in the case <cfdump var="#server#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

Search your code for any illegal call to getMetaData().

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

Yes, <cfdump> works fine, but not for some reason it won't dump #arguments.exception#

Not sure I know how to find illegal calls to GetMetadata()

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

EugenePipko  wrote

Not sure I know how to find illegal calls to GetMetadata()

Most text editors can search your entire code for the word getMetadata.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

  wrote

OK. That was that then.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

Exceptions

15:19:49.049 - Object Exception - in D:/UB_CF_APPS/PROD/Application.cfc : line 279

         The getMetaData method was not found. 

15:19:49.049 - Application Exception - in D:/UB_CF_APPS/PROD/Application.cfc : line 279

         An exception occurred while calling the function getMetaData.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

And what happens when you test the division-by-zero page against this:

<cffunction name="onError">

   <cfargument name="exception" required=true>

   <cfargument name = "eventName" type="string" required=true>

      <cfdump var="#arguments.exception#" label="arguments.exception">

</cffunction>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

Exceptions

15:40:30.030 - Object Exception - in D:/UB_CF_APPS/PROD/Application.cfc : line 280

         The getMetaData method was not found. 

15:40:30.030 - Application Exception - in D:/UB_CF_APPS/PROD/Application.cfc : line 280

         An exception occurred while calling the function getMetaData. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

It's just gone past 1 AM here so I'm taking a break. I shall be back later in the morning.

In the meantime you could

1) investigate further with

<cftry>

<cfsavecontent variable="errortext">

<cfoutput>

    Time: #dateFormat(now(), "short")# #timeFormat(now(), "short")#<br />

    Error on page: http://#cgi.server_name##cgi.script_name#?#cgi.query_string#<br />

    Referrer: #cgi.HTTP_REFERER#

</cfoutput>

<cfdump var="#arguments.exception#" label="Error">

</cfsavecontent>

<cfcatch type="any">

    <cfdump var="#cfcatch#" label="cfcatch">

</cfcatch>

</cftry>

2) Report a bug, referring it to this forum page.

3) Reinstall ColdFusion 2018, Update 2

Good luck!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation