4

We had our own server working with an app. We started hosting with a different provider and now we are getting the above-mentioned error.

On the same page, this works:

<cfset compTest = createObject("component", "components.search")>
<cfset result = compTest.search(1,10,1,"desc","")>
<cfdump var="#result#">

But this one does not

<cfform name="searchResultGridForm">
<cfgrid 
name="searchResultGrid"
bindOnLoad="true" 
bind="cfc:components.search.search({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{searchedWord@keyup})" 
format="html"
selectMode="Row"
selectOnLoad="false"
width="790"
height="290" 
colHeaderAlign="Center"
stripeRows="true"
pagesize="10">
<cfgridcolumn name="fileColor" header="Priority" width="50">
<cfgridcolumn name="idFile" header="ID" width="40">
<cfgridcolumn name="firstName" header="First Name" width="80">
<cfgridcolumn name="lastName" header="Last Name" width="80">
<cfgridcolumn name="email" header="Email" width="100">
<cfgridcolumn name="nextImportantDate" header="Next Important Date" width="70">
<cfgridcolumn name="statusName" header="Status" width="100">
<cfgridcolumn name="historyLastInsert" header="Last Note" width="100">
<cfgridcolumn name="fileAssignedTo" header="Assigned to" width="90">
<cfgridcolumn name="edit" header="Actions" width="60" dataAlign="Center">
</cfgrid>
</cfform>

We can't figure out why could that be. Your help would be greatly appreciated

Paths we use

Our app is hosted here:

/home/[mycompany]/public_html/[appname]/

Our components are here:

/home/[mycompany]/public_html/[appname]/components

Our Application.cfg looks like:

<cfapplication name="[name goes here]" sessionManagement="yes" sessionTimeout="#createTimeSpan(0,8,0,0)#">


<cfset APPLICATION.db = "[appname]">

<cfset APPLICATION.website_url = "http://[ourURL].com">
<cfset APPLICATION.template_path = "#application.website_url#/template/">
<cfset APPLICATION.localPath = "/home/[mycompany]/public_html/[appname]/">
<cfset APPLICATION.codeAlgorithm = "[specific stuff goes here]">
<cfset APPLICATION.codeEncoding = "[code encoding]">
<cfset APPLICATION.codeKey = "[specific stuff goes here]">
  • 1
    I'm not sure if it's absolutely necessary all the time but, when I was dicking around with bind attributes, I would only succeed if the cfc was in the same directory as the page using it. – Dan Bracuk May 29 '14 at 13:13
  • Can you edit your comment and show up where the cfm file lives in the directory (and I see you have a path to your cfc in your comments on the answer below add that to your question too because it is meaninful). Need some proximal perspective... – Frank Tudor May 29 '14 at 13:50
  • Edited the question to reflect the paths we use – user1927686 May 29 '14 at 14:21
  • @DanBracuk I just tried copying a test function out of the "components" folder and into the same folder where the page using it was and it worked. This is good because it works and bad because the change in code is massive. I copied the components to the same place where I have the pages (ugh!) and they seem to be working. I am baffled. Not even sure if should proceed with this. – user1927686 May 29 '14 at 15:04
  • 1
    What might work is if you keep the cfc's with the code in the place you want them. Then, in various folders where you want to use them, create other cfc's. Inside these, create instances of the real cfcs, and write methods that call the corresponding methods from the one in your components folder. It's a bit messy, but at least the functions are available in more than one directory. – Dan Bracuk May 29 '14 at 16:32
  • @DanBracuk Yes. We ended up copying the components to where the page was. here is the thing: we did not have to change the code that was already referencing them on the /components folder. So there is something messed up with the paths on the server that we need to figure out. Please put your comment as an answer so I can mark it as the correct one. – user1927686 May 30 '14 at 16:45

1 Answers1

1

Is components a mapped directory? According to this note about "bind":

In ColdFusion 9 (and ColdFusion 9 only, this note does not apply to ColdFusion 10!), the component path cannot use a mapping. The componentPath value must be a dot-delimited path from the web root or the directory that contains the current page.

Fish Below the Ice
  • 1,273
  • 13
  • 23
  • We have it located at 'code'/home/mycompany/public_html/app/components/search.cfc'code' We tried specifying it with dots on code as 'code'cfc:app.components.search.search'code' and also 'code'cfc:public_html.app.components.search.search'code' and also 'code'cfc:mycompany.public_html.app.components.search.search'code' and also 'code'cfc:home.mycompany.public_html.app.components.search.search'code' but we keep getting the same problem – user1927686 May 29 '14 at 13:28
  • And to answer your question, as far as I know it is not mapped. We are specifying the path with dot notation as you can see – user1927686 May 29 '14 at 13:37