Could not find the ColdFusion component or interface

New Here ,
Apr 05, 2011 Apr 05, 2011

Copy link to clipboard

Copied

I don't know what else to try.  I have created a fully functional ORM CRUD application that is working perfectly when I have the mapping cfc located in the root folder with the index.cfm file that is using it.  However, as soon as I move the mapping cfc into the "ORM" folder that is in the root folder and add the cfclocation attribute all I ever get is that it can't find the component or interface.  To make sure that it works and I don't have any strange errors I have (in the index.cfm file) instanciated it using createObject with a path of "orm.HistoricalEvents" and then dump it to the screen and that works just fine as well.  Below is my setup and directory structure.  If anyone has any suggestions i would love to hear them.  I love the ORM capabilities and want to use them but I don't want to have a pile of mapping cfcs just sitting in the root folder.

Setup:

Windows 7 Enterprise, 64 bit

IIS 7.5

File Directory/IIS Physical Path: C:\WebDev\DevGamma

Virtual Directory under IIS Default Web Site: /DevGamma

ColdFusion Developer Edition > Standard Installation > All IIS Websites

ColdFusion Directory Location: C:\ColdFusion9

CFIDE Directory Location: C:\inetpub\wwwroot\CFIDE

Folder Structure:

[root]

     /orm

          HistoricalEvents.cfc

     Application.cfc

     index.cfm

Application.cfc

component
{
        this.name = "CF/1 Application Generator16";
        this.version = 1.0;
        this.datasource = "fw1testdsn";
        this.sessionmanagement = true;
        this.ormenabled = true;
           
       
       
        this.ormsettings = {
            autorebuild="true",
            dialect="MicrosoftSQLServer",
            dbcreate="update",
            cfclocation="orm"
        };
       
}

HistoricalEvents.cfc

component persistent="true" table="HistoricalEvents"
{
    property name="EventID" fieldtype="id" ormtype="int" generator="identity";
    property name="EventDate" ormtype="date";
    property name="EventTitle" ormtype="string" length=250;
    property name="EventLocation" ormtype="string" length=50;
    property name="EventType" ormtype="string" length=30;
    property name="EventRating" ormtype="short";
    property name="IsPositiveEvent" ormtype="boolean";
}

index.cfm

<cfset data = EntityToQuery(entityLoad("HistoricalEvents"))>
<cfdump var="#data#">

If anyone needs more information please let me know.  If you have any suggestions please send them my way.  I want to use ORM but this is killing me and is a deal breaker if I can't get the cfclocation thing to "see" my components.  Thanks!

Jason

TOPICS
Advanced techniques

Views

12.8K

Likes

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
Participant ,
Apr 05, 2011 Apr 05, 2011

Copy link to clipboard

Copied

When u invoke cfc just by its name CF automatically scans ur site root, web root and any custom path specified in the CF administrator.  So first 2 don't apply since you moved it to a folder, so do yuo have "orm" folder set as custom tag path?

have u tried using qualified path to call your cfc, like "orm.HistoricalEvents" given that the filename for ur cfc is HistoricalEvents.cfc?

Likes

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
New Here ,
Apr 05, 2011 Apr 05, 2011

Copy link to clipboard

Copied

Both ...

<cfset data = EntityToQuery(entityLoad("orm.HistoricalEvents"))>

and

<cfset data = EntityToQuery(entityLoad("devgamma.orm.HistoricalEvents"))

results in "Mapping for component [whatever path I try] not found"

I also don't have any orm path's mapped anywhere (neither CFX Tags nor ColdFusion Mappings).

Likes

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
Participant ,
Apr 05, 2011 Apr 05, 2011

Copy link to clipboard

Copied

I haven't had much expirience with ORM but maybe try following:

<cfset data= CreateObject("component", "orm.HistoricalEvents")>
<cfset data= EntityToQuery(EntityLoad(data))>

or even map custom tag path to your ORM folder

Likes

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
New Here ,
Apr 06, 2011 Apr 06, 2011

Copy link to clipboard

Copied

Thanks for the suggestion but that did not work either.  I get:

Complex object types cannot be converted to simple values.

Likes

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
Participant ,
Apr 06, 2011 Apr 06, 2011

Copy link to clipboard

Copied

Well good news about that it's finding the cfc service.

Try this:

<cfset data= CreateObject("component", "orm.HistoricalEvents")>

<cfset data=EntityLoadByExample(data)>

<cfset data= EntityToQuery(data)>

or

<cfset data= CreateObject("component", "orm.HistoricalEvents")>

<cfset data= EntityToQuery(data)>


Likes

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 ,
Apr 07, 2011 Apr 07, 2011

Copy link to clipboard

Copied

First suggestion returned error.  Second returned empty result set.

I'm not looking for a work around as much as a solution to why ColdFusion can't see my component even when I set up the cfclocation value.  I don't like hacks.  They tend to cause issues later on especially if the architecture of ColdFusion changes.

Thanks for the suggestions.

Jason

Likes

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 ,
Jun 04, 2013 Jun 04, 2013

Copy link to clipboard

Copied

LATEST

I wholeheartedly agree it seems hacky.  I had a very similar issue and added the path to the model (mapping cfc) on to my application.cfc's this.customTagPaths list and it suddenly started working.

It seems to me.... that if you specify a cfclocation.... it should..... Just Work.  One man's opinion.

See this post where I detail my problem for why I think it can locate the file itself even, but just doesn't know how to handle it: https://groups.google.com/forum/?fromgroups#!topic/coldbox/dFMG5PB6wn4

Likes

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