Copy link to clipboard
Copied
I am experiencing an "Unresolved component" in the CF Builder 2 (which I'm evaluating as a Trial).
What are the typical causes for this as I have run through all of the possible issues wihtout success?
My Environment:
I have Windows 7, CF8 on IIS7 using a default Jrun installation under C:\Coldfusion8 with a website configured under the IIS webroot C:\inetpub\wwwroot\websites\mysite.
In IIS AND CF Builder, I have configured a virtual host for this site, let's call it "mysite.newbranch", so that when I go to the site in a browser, it points to http://mysite.newbranch. The RDS is working (tested via the RDS config window with both connection and debugger returning success alerts).
In CF Builder, I created a project called "mysite.newbranch" and when I load my files, it doesn't resolve CFC path names:
/root
/cfcfolder
somefile.cfc
if I use CreateObject( "component","cfcfolder.somefile" ).init(), (note, using the top level folder relative to the site), the CF Builder says it's unresolved and wants to create a cfc in "mysite.newbranch.cfcfolder.somefile" and several other options (all of which I have tried (for laughs) and don't work except creating a folder at the somefile.cfc level - a dupicate of the parent tree structure - gah.)
So the mapping is off somewhere and I don't know how to get CF Builder to recognize that the root of my project site is at the virtual host path reference. C:\inetpub\wwwroot\websites\mysite and therefore to understand that my cfc reference
cfcfolder.somefile.cfc is correct.
Any advice, much appreciated.
Jason D.
Copy link to clipboard
Copied
Hi Jason
Resolving component works with precedence rule. The first precedence to Server mapping then doc root then files in project. As your webroot and project location overlaps. according to precedence the resolving the component is happening with respect to docroot in ur case. Hence your getting " unresolved and wants to create a cfc in "mysite.newbranch.cfcfolder.somefile" ".
To avoid this either you add mapping to cfcfolder to /root/cfcfolder and access CFCs inside cfcfolder. U need to refresh server after adding mapping at server. Or you can de-associate server so resolution happens wrt to project root.
Thanks
Kiran Sakhare
Copy link to clipboard
Copied
Kiran:
Thanks for taking the time to read and respond to my issue. Can you clarify what you mean by "disassociating the server"? I prefer a cleaner option (no more mappings and particularly for each folder I have a .cfc file) and the disassociating server option sounds promising.
Also, can you point me to official docs that explain the precedence rule you describe.
Many thx,
Jason D
Copy link to clipboard
Copied
If you edit the properties for your project (right click the project and choose "properties". You will see an option for "ColdFusion Server Settings". Here is where you choose which server you want to associate with this project.
For the component to be properly resolved, you will want to choose a server instance, make sure the server is running, and has cataloged all the CFCs. You said you created a virtual host within CF Builder. I have had an issue w/ virtual hosts inside CFB and resolving components, perhaps you should just create a separate "Server" instance for your virtual host and assign that to the project. That seemed to remove the issue for me in the past.