tracker issue : CF-3546237

select a category, or use search below
(searches all categories and all time range)
Title:

getMetaData() after objectLoad() causes NULL POINTER error

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Simon Hooker / Simon Hooker (Simon Hooker)

Created: 04/21/2013

Components: ORM Support

Versions: 9.0.1

Failure Type: Crash

Found In Build/Fixed In Build: 9.0.1 / CF10 Update16

Priority/Frequency: Critical / All users will encounter

Locale/System: English / Linux All

Vote Count: 3

Problem Description: In CF 9.0.1 if you perform a getMetaData() call on an object that was just loaded with ObjectLoad() then you will have a NULL POINTER error.  If you call a method of that object, or writedump that object, prior to the getMetaData() call then the getMetaData() call will function correctly.  See StackOverflow ticket http://stackoverflow.com/questions/16103089/null-pointer-error-when-using-objectloadobjectsave for a couple of methods to reliably reproduce.

This is not a problem within Railo.  This has been confirmed within CF 9.0.1, CF 9.0.2, and CF 10.0.9

Steps to Reproduce:

I have attached 2 files.  NullError.cfc and NullErrorTest.cfc.  If you run the MXUnit tests within NullErrorTest.cfc then the error will reproduce.

Alternatively another user has found the following will also reproduce the error

// C.cfc
component {}

<!--- test.cfm --->
<cfscript>
o1 = new C();
writeDump(getMetaData(o1)); // OK

o2 = objectLoad(objectSave(o1));
writeDump(getMetadata(o2)); // breaks
</cfscript> 

Actual Result:

NULL POINTER ERROR

Expected Result:

Metadata dump of component object

Any Workarounds:

1 : WriteDump(o2) prior to doing GetMetaData(o2)
2 : Calling a method of o2 prior to GetMetaData(o2)

Both these workarounds result in the object behaving correctly following an ObjectLoad

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3546237

External Customer Info:
External Company:  
External Customer Name: MSO Simon
External Customer Email:  
External Test Config: My Hardware and Environment details:

This is reproducable on any CF 9.0.1 environment  (Linux + Win) that I have tried so far.  Another user has also tested 9.0.2 and 10.0.9 and found this same issue to be reproducable in that.

Attachments:

  1. April 21, 2013 00:00:00: 1_NullError.zip

Comments:

Details also available on the following StackOverflow thread : http://stackoverflow.com/questions/16103089/null-pointer-error-when-using-objectloadobjectsave
Comment by External U.
15586 | April 21, 2013 08:49:13 AM GMT
+1 -- Adam ////////////////////
Vote by External U.
15590 | April 21, 2013 02:52:07 PM GMT
-- Andrew ////////////////////
Vote by External U.
15591 | April 22, 2013 02:51:52 AM GMT
Fills up server log with a tonne of null pointer errors
Vote by External U.
15592 | April 22, 2013 02:52:37 AM GMT
Bug Verified. (Comment added from ex-user id:vnigam)
Comment by Adobe D.
15587 | December 17, 2013 10:11:41 AM GMT
The fix for this bug is available in the pre-release build of ColdFusion 10 Update 16
Comment by CFwatson U.
15588 | February 20, 2015 09:22:34 AM GMT
Verified the fix in CF10 HF16, added test at //depot/qa/cf10/regression/coretests/components/functions/getmetadata/bugCF-3546237
Comment by HariKrishna K.
15589 | March 10, 2015 12:40:09 AM GMT