Friday, March 26, 2010

Component not found - The component...

Please help with the following error. How do I fix... The CFC file is at the location specified.

Component not found

The component definition file for component 'tools.cfc.core' cannot be found on this server. 
Component not found - The component...

I am guessing that your problem is on a development machine and not a live site? If that' s not the case, please post back and give a few more details on your server setup.

In general, however, ColdFusion will take a mapping such as 'tools.cfc.core' and start looking for the component at the webroot. So, tools.cfc.core, indicates to CF that there should be a tools folder under the webroot folder. From there CF will look for a folder called cfc under tools and then it looks for the core.cfc file in the cfc folder.

By way of example, let's say you view your site on your dev box with the URL of http://localhost/mysite.

Along those lines, your directory structure would be something like the following:

Webroot - c:\webroot

Application/Site folder - c:\webroot\mysite

Tools - c:\webroot\mysite\tools

CFCs - c:\webroot\mysite\tools\cfc

Core - c:\webroot\mysite\tools\cfc\core.cfc

In such a scenario, CF won't be able to find the CFC with tools.cfc.core because there is no tools folder at the root level (it's under the mysite folder). In this case, you'd want to tell CF to look in mysite.tools.cfc.core

Hope that helps somewhat!!

Component not found - The component...

Hey Craig, thanks for the quick reply.

The path to that CFC and the CFC folder is as follows,?http://localhost/tools/cfc/core.cfc. So, ''tools.cfc.core'' should be correct. We've used this elsewhere without issue.

What kinda server details would you like to see?

Thanks for the follow-up and clarification.

Three questions for you:

1. From what template are you calling the CFC, where is that template located (directory), and how do you access it in a URL?

2. How do you instantiate your component (i.e., createObject('component', 'tools.cfc.core'), etc.)?

3. If you navigate to http://localhost/tools/cfc/core.cfc what happens (you should be prompted to log into the ColdFusion component explorer?

1. From what template are you calling the CFC, where is that template located (directory), and how do you access it in a URL?

http://localhost/core_cure/admin/somepage.cfm

2. How do you instantiate your component (i.e., createObject('component', 'tools.cfc.core'), etc.)?

%26lt;script type='text/javascript'%26gt;_ajaxConfig = {'_cfscriptLocation':'/tools/cfc/core.cfc', '_jsscriptFolder':'/tools/js'};%26lt;/script%26gt;

3. If you navigate to http://localhost/tools/cfc/core.cfc what happens (you should be prompted to log into the ColdFusion component explorer?

If we navigate to the CFC we are prompted with the Component Login, after logging in, we see the details of the Component.

Hope this helps

Are you using AjaxCFC for this? If so, does your core.cfc file extend Ajax.cfc? I believe it has to.

See Dan Vega's post:

http://www.danvega.org/blog/index.cfm/2006/12/4/ajaxCFC-Login-Form

Yes we are using AjaxCFC and the CFC does extend AJAX.

Thanks for the link. I'll take a look at it and see if it helps.

  • eye application
  • No comments:

    Post a Comment