Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6789511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:36:47+00:00 2026-05-26T17:36:47+00:00

I been developing a site offline on a WAMP setup and have been serializing

  • 0

I been developing a site offline on a WAMP setup and have been serializing beans using the SerializeJSON function like so:

propertyImageBean = CreateObject("component","cfcs.beans.property_image").init();
propertyImageBean.setname("test");
propertyImageBean.setalt("test alt");

<cfoutput>#SerializeJSON(propertyImageBean)#</cfoutput>

This has all been working correctly and the code above produces:

{"name":"test","alt":"asdasd","id":""}

However, when I upload my files to the live site the response is just an empty object:

{}

The local version is running on CF9 and the prod version is on CF8, so this is probably what the issue is.

Any ideas?

Thanks

EDIT:

<cfscript>

    propertyImageBean = CreateObject("component","cfcs.beans.property_image").init();
    propertyImageBean.setid(1);
    propertyImageBean.setname("test");
    propertyImageBean.setalt("asdasd");

</cfscript>
<cfdump var=#propertyImageBean#>
<cfoutput>id: #propertyImageBean.getid()#</cfoutput>
<cfoutput>alt: #propertyImageBean.getalt()#</cfoutput>
<cfoutput>name: #propertyImageBean.getname()#</cfoutput>

Outputs (prod server(:

  • A dump of the bean but does not display the bean properties in the dump whereas on the local server it does

    id: 1 alt: asdasd name: test

So it looks like it is a problem with the bean, unless there is a config issue on the server.

CFC:

<!--- PROPERTIES FOR DOCUMENTATION PURPOSES ONLY --->
<cfproperty name="id" displayname="id" hint="id of the property_image" type="any" required="True" />
<cfproperty name="name" displayname="name" hint="name of the property_image" type="any" required="True" />
<cfproperty name="alt" displayname="alt" hint="alt of the property_image" type="any" required="True" />

<!--- PSEUDO-CONSTRUCTOR: SETS DEFAULT VALUES IF INIT METHOD IS NOT CALLED --->
<cfscript>
    variables.id = "";
    variables.name = "";
    variables.alt = "";
</cfscript>

<!--- CONSTRUCTOR: TAKES IN ARGUMENTS AND CALLS SETTER (MUTATOR) FOR EACH ATTRIBUTE OF THE BEAN --->
<cffunction name="init" displayname="Init" hint="Constructor for the CFC" access="public" output="false" returntype="any">
    <!--- ARGUMENTS FOR THE CONSTRUCTOR, ALL OF WHICH ARE OPTIONAL (NO-ARG CONSTRUCTOR) --->
    <cfargument name="aid" displayname="id" hint="id of the property_image" type="any" required="false" default="" />
    <cfargument name="aname" displayname="name" hint="name of the property_image" type="any" required="false" default="" />
    <cfargument name="aalt" displayname="alt" hint="alt of the property_image" type="any" required="false" default="" />
    <!--- CALL THE SETTERS (MUTATORS) FOR EACH OF THE property_image ATTRIBUTES AND PASS IN THE ARGUMENTS --->
    <cfscript>
        setid(arguments.aid);
        setname(arguments.aname);
        setalt(arguments.aalt);
    </cfscript>

    <cfreturn this />
</cffunction>

<!--- GETTERS AND SETTERS (MUTATORS AND ACCESSORS) --->
<cffunction name="getid" access="public" output="false" returntype="string">
    <cfreturn variables.id />
</cffunction>
<cffunction name="setid" access="public" output="false" returntype="void">
    <cfargument name="aid" type="string" required="true" />
    <cfset variables.id = arguments.aid />
</cffunction>
<cffunction name="getname" access="public" output="false" returntype="string">
    <cfreturn variables.name />
</cffunction>
<cffunction name="setname" access="public" output="false" returntype="void">
    <cfargument name="aname" type="string" required="true" />
    <cfset variables.name = arguments.aname />
</cffunction>
<cffunction name="getalt" access="public" output="false" returntype="string">
    <cfreturn variables.alt />
</cffunction>
<cffunction name="setalt" access="public" output="false" returntype="void">
    <cfargument name="aalt" type="string" required="true" />
    <cfset variables.alt = arguments.aalt />
</cffunction>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:36:48+00:00Added an answer on May 26, 2026 at 5:36 pm

    First, setup CF8 locally. http://www.adobe.com/support/coldfusion/downloads.html#cf8proddl

    I guess SerializeJSON(cfc) is something new in CF9 that’s not available in CF8. This is not an official, documented feature of SerializeJSON I don’t believe.

    Implement a getMemento() function that returns the variables in as a struct, then you can SerializeJSON on that struct.

    /** a public function in Obj.CFC */
    function getMemento()
    {
        return {
            x=variables.x,
            y=variables.y
        };
    }
    
    // outside of the cfc...
    obj = createComponent("component","Obj").init();
    objJson = serializeJSON(obj.getMemento());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been developing a site using ASP.NET MVC, and have decided to use the
I have been using .net for the past couple of years, and I like
I've been developing a site for the past couple of days and have everything
I'm developing a web site which will retrieve SMS messages that have been sent
This is my first site built in Silverstripe, I have been developing the site
I have been developing my first mobile site with jQuery Mobile and you can
I have been developing our php based site on a development box that was
I have been developing an upload site for a couple of months now, and
I have been developing and testing with inline jQuery. I am using CodeIgniter and
I've been developing a site (for now is here as an example: http://neurotoxine.mine.nu/gloom ),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.