Link to home
Start Free TrialLog in
Avatar of JRockFL
JRockFLFlag for United States of America

asked on

Could not find the ColdFusion Component Components.Users

I'm trying to invoke a Component, but CF can't find it?

I have directory name Secure and then a directory named Components. A cfm file in the secure directory finds it with no problem.

I have a subdirectory named PriceList and a cfm file in this directory. This file can not find the component.

What can I do?

ASKER CERTIFIED SOLUTION
Avatar of adonis1976
adonis1976

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JRockFL

ASKER

I tried it that way and still get the same error message.
Avatar of mrichmon
mrichmon

Have you registered it in teh cfadmin and also tried setting the alternate path to look for compnents (or maybe that is for tags only?)
Avatar of JRockFL

ASKER

i have not registered the cfcs before and they worked. are you suppose to register the cfcs? i thought it was for just tags
no u don't need to register cfcs..

is this ur directory structure?

secure -- some files inside.
 |
  --- Components --- cfc files
 |
  ---Pricelist -- Some .cfm files

???
why dont you do this?

store a variable in the application scope as follows

<cfset application.components = "Fully qualified path to component directory"> you can also use expandPath () if you are using relative path.

now in the call:

try this:

<cfset myObject = CreateObject("component","#application.components#.component_name")>
Avatar of JRockFL

ASKER

Yes, that is the correct directory structure

i tried your next suggestion and still getting the same error....
Avatar of JRockFL

ASKER

It should work, I have done this before on my home web server and it works fine. I dont know what to do now!
paste the code where you are calling the component.. and also i want to see ur Application.cfm where you have implemented my earlier idea..
Avatar of JRockFL

ASKER

Here it is...

<!--- Application --->
<cfset application.components = "\\webserver\Internet\rock\Secure\Components">

<--- Calling Page --->
<cfset myObject = CreateObject("component","#application.components#.Users")>
\\webserver\Internet\rock\Secure\Components is not a fully qualified path.. use this..

<cfset application.components = expandpath('components\')>
Avatar of JRockFL

ASKER

This is what I have in the application page
<cfset application.components = expandpath('components\')>

This is on the calling page
<cfset myObject = CreateObject("component","#application.components#.Users")>

This is  the error I get
The filename, directory name, or volume label syntax is incorrect

If I output
<cfoutput>#application.components#</cfoutput><cfabort>
It shows this D:\InetPub\Internet\rock\Secure\PriceBooks\components\

My components directory is here
D:\InetPub\Internet\rock\Secure\Components
lets do this way and see what happens

Let declare few more application variables:

<cfset application.home = "D:\Inetpub">
<cfset application.components = "#application.home#"\internet\rock\secure\components">

and call as

<cfset myObject = CreateObject("component","#application.components#.Users")>
and here is a place to learn more about expandPath

http://www.efflare.com/docs/CFX_ImageCR3/reference/advanced/tips.html
Avatar of JRockFL

ASKER

application.components displays as D:\Inetpub\internet\spence\secure\components (which is the correct spot)

But I still get this error message...
The filename, directory name, or volume label syntax is incorrect
Avatar of JRockFL

ASKER

I mean D:\Inetpub\internet\rock\secure\components (which is the correct spot)
have you tried forward /? i don't know if they will make a difference.. it will on UNIX..
Avatar of JRockFL

ASKER

im on windows...
did u try forward / in setting the application variable.. just in case.
Avatar of JRockFL

ASKER

yes, i have tried just about everything. it should of worked.