JRockFL
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?)
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
???
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"," #applicati on.compone nts#.compo nent_name" )>
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","
ASKER
Yes, that is the correct directory structure
i tried your next suggestion and still getting the same error....
i tried your next suggestion and still getting the same error....
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..
ASKER
Here it is...
<!--- Application --->
<cfset application.components = "\\webserver\Internet\rock \Secure\Co mponents">
<--- Calling Page --->
<cfset myObject = CreateObject("component"," #applicati on.compone nts#.Users ")>
<!--- Application --->
<cfset application.components = "\\webserver\Internet\rock
<--- Calling Page --->
<cfset myObject = CreateObject("component","
\\webserver\Internet\rock\ Secure\Com ponents is not a fully qualified path.. use this..
<cfset application.components = expandpath('components\')>
<cfset application.components = expandpath('components\')>
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"," #applicati on.compone nts#.Users ")>
This is the error I get
The filename, directory name, or volume label syntax is incorrect
If I output
<cfoutput>#application.com ponents#</ cfoutput>< cfabort>
It shows this D:\InetPub\Internet\rock\S ecure\Pric eBooks\com ponents\
My components directory is here
D:\InetPub\Internet\rock\S ecure\Comp onents
<cfset application.components = expandpath('components\')>
This is on the calling page
<cfset myObject = CreateObject("component","
This is the error I get
The filename, directory name, or volume label syntax is incorrect
If I output
<cfoutput>#application.com
It shows this D:\InetPub\Internet\rock\S
My components directory is here
D:\InetPub\Internet\rock\S
lets do this way and see what happens
Let declare few more application variables:
<cfset application.home = "D:\Inetpub">
<cfset application.components = "#application.home#"\inter net\rock\s ecure\comp onents">
and call as
<cfset myObject = CreateObject("component"," #applicati on.compone nts#.Users ")>
Let declare few more application variables:
<cfset application.home = "D:\Inetpub">
<cfset application.components = "#application.home#"\inter
and call as
<cfset myObject = CreateObject("component","
and here is a place to learn more about expandPath
http://www.efflare.com/docs/CFX_ImageCR3/reference/advanced/tips.html
http://www.efflare.com/docs/CFX_ImageCR3/reference/advanced/tips.html
ASKER
application.components displays as D:\Inetpub\internet\spence \secure\co mponents (which is the correct spot)
But I still get this error message...
The filename, directory name, or volume label syntax is incorrect
But I still get this error message...
The filename, directory name, or volume label syntax is incorrect
ASKER
I mean D:\Inetpub\internet\rock\s ecure\comp onents (which is the correct spot)
have you tried forward /? i don't know if they will make a difference.. it will on UNIX..
ASKER
im on windows...
did u try forward / in setting the application variable.. just in case.
ASKER
yes, i have tried just about everything. it should of worked.
ASKER