Copy link to clipboard
Copied
The ORM which did work fine when everything was in the same directory gives this error
when I moved the Artist.cfc to its own folder at C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\ORM\cfc
I am using this in the application.cfc
<cfcomponent
n
output="false">
<cfset this.name = "arty"> <cfset this.ormenabled = "true">
<cfset this.datasource = "cfartgallery">
<cfset this.ormsettings.logSQL = "true">
<cfset this.cfclocation="/ORM/cfc">
</cfcomponent>
I have also tried <cfset this.cfclocation="ORM.cfc">
I tried using script notation in the application.cfc, creating a mapping in admin, every kind or dot, backslash and forward slash I could think of.
No joy. Any help greatly appreciated. This is the Artist.cfc -- stolen straight
<cfcomponent output="false" persistent="true" table="Artist" hint="Hint.">
<cfproperty name="artistid" type="numeric" validate="integer" setter="false" hint="Hint"
persistent="true" fieldtype="id" column="id" ormtype="integer" generator="identity" length="10"/>
<cfproperty name="firstname" type="string">
<cfproperty name="lastname" type="string">
<cfproperty name="address" type="string">
<cfproperty name="city" type="string">
<cfproperty name="state" type="string">
<cfproperty name="postalcode" type="string">
<cfproperty name="email" type="string" validate="email">
<cfproperty name="phone" type="string" validate="telephone">
<cfproperty name="fax" type="string" validate="telephone">
<cfproperty name="thepassword" type="string">
</cfcomponent>
Copy link to clipboard
Copied
Try using either a full filesystem path, or lose the leading slash (provided your orm dir is in your CF root dir). Full file system path has always worked for me, and in googling around just now, I see other people have used a relative path rather than an absolute one.
--
Adam
Copy link to clipboard
Copied
I have been playing with the this.cfclocation property.
It seems that no matter what I type in there -- even nonsence -- the property is alwats ignored and CF looks for the cfc in ORM directory not ORM/cfc.
As soon as I move Artist.cfc back to ORM directory everyhting works fine no matter what is in the cfclocation property.
http://localhost:8300/ORM/list.cfm works fine.
Thanks for the response.
Copy link to clipboard
Copied
Oh. Just noticed something you said... it's this.ormsettings.cfclocation, not this.cfclocation.
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSED380324-6CBE-47cb-9E5E-26B66ACA9E81.html
--
Adam
Copy link to clipboard
Copied
Thanks.
I had it correct originally and then mistyped it along the way but it still does not work as
<cfset this.ormsetting.cfclocation ="ORM.cfc">
or
<cfset this.ormsetting.cfclocation ="/ORM/cfc">
or
<cfset this.ormsetting.cfclocation ="\ORM\cfc">
-----------------------------------------------------------------------------------------------------
<cfcomponent output="false">
<cfset this.name = "arty">
<cfset this.ormenabled = "true">
<cfset this.datasource = "cfartgallery">
<cfset this.ormsettings.logSQL = "true">
<cfset this.ormsetting.cfclocation ="ORM.cfc">
</cfcomponent>
Thanks again.
Copy link to clipboard
Copied
<cfset this.ormsetting.cfclocation ="ORM.cfc">
or
<cfset this.ormsetting.cfclocation ="/ORM/cfc">
or
<cfset this.ormsetting.cfclocation ="\ORM\cfc">
It's ormsettings
Just in case that's a typo, did you try - as I suggested - a full path:
<cfset this.ormsettings.cfclocation = "C:\path\to\where\the\file\is\ORM\cfc">
?
--
Adam
Copy link to clipboard
Copied
Yes. I did try the full path when you first suggested that.
Copy link to clipboard
Copied
This is beginning to be like pulling teeth.
Did you see the bit I mentioned about it being this.ormsettings, not this.ormsetting?
--
Adam
Copy link to clipboard
Copied
Yes I did and changed that typo.
Copy link to clipboard
Copied
The full path + ormsettingS worked.
Thank you.
Copy link to clipboard
Copied
The full path + changing ormsetting to ormsettingS worked.
C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\ORM\cfc
Thank you for your help.
Copy link to clipboard
Copied
NP.
I don't think the docs for cfclocation are particularly clean, to be honest. And with no examples to go on, they're not very helpful.
Glad you got it sorted out though.
--
Adam
Copy link to clipboard
Copied
Yes. Thanks again.