Aaron Greenlee.com | A Personal Journey.
You should follow me here.
This is the RSS subscription you have been looking for.
 
Wrecking Ball Media
A great team that is clearing the way for digital marketing.

Have you thought about joining the Central Florida Web Developers User Group?

A CFC with Entity Name X Could Not Be Found

POSTED Monday, April 19, 2010  |   | DOWNLOAD CODE
Keywords: ORM, ColdFusion

This afternoon I encountered an error 'A CFC with entityname X could not be found' as I was working on a new campaign entity for our Adwords campaign. For GCA.net, we are preparing to launch a AdWord campaign related to the new RedHat JBoss Bootcamp Training classes that are almost public. We also happen to be in the middle of the SugarCRM release to the Sales staff which is causing lots of interruptions.

I was interupted as I was adding a new property to the campaign.cfc entity and lost my train of thought. After returning to work I had a mysterious error that refused to show the root cause!

A CFC with entityname campaign could not be found error was produced by the following code:

Sample
Campaign = entityload('gca.model.entities.campaign',{campaignID=1},true)

After verifying the entity was there and all my ORM settings were unchanged I was puzzeled. I finally created a new entity using the new operator:

Sample
Campaign = new gca.model.entities.campaign();

Using the 'new' operator, I exposed a different issue... the root cause of the 'A CFC with entityname campaign could not be found' error! I actually had a duplicate property name in the Campaign entity and recalled my interruption and loss of concentration.

So, if you are getting a mysterious error that your entity mapping can not be found you may have a syntax or logic issue in your entity that is preventing ColdFusion from generating the .class file for your ORM entity. The order of creation vs. the order of validation is just a little odd in this case. It seems ColdFusion is doing ORM processing before it compiles the .class file for CFC entities.

Hope this help some poor Googler trying to figure out what is wrong with their ORM entity.

blog comments powered by Disqus
You can send me email or work with
   me for digital marketing, web design
      and application development.

         I own proprietary web application development
         company and work with a leading digital marketing firm.
© 2009 - 2012 Aaron Greenlee. Powered by my own code on the ColdBox Framework.

This site is best viewed on Chrome, FireFox and Safari. Subscribe to my RSS feed.