tags:

views:

30

answers:

2

I sometimes get

Could not find the ColdFusion Component or Interface Answer. 

and simply doing a refresh fixes the problem. This is not case where the program is being refreshed from ftp while I try to browse from it: no development is being done. But every once in a while I'll get it while trying to do a createobject.

Q: Is there a best practice for sleeping and trying again if instantiating a component fails?

+1  A: 

Phillip, any chance this is on cf 9.0.1, and you're using the "import" keyword?

The reason I ask is that I've seen behavior -- and logged a bug report on it -- where if I have two different object creations on the same page (or in another CFC... doesn't matter), both from the same package, and I'm not using the fully qualified CFC name but instead am using import, then the first createObject() will succeed and the second will fail with the "could not find ... " error.

I wonder if something like that could be at work here.

marc esher
I'm using this.customTagPaths in Application.cfc and letting ColdFusion find it instead of explicitly telling it where to go. You're right, there might be something there.
cf_PhillipSenn
+2  A: 

Are you using a cluster of servers? If so perhaps you have one server misconfigured - perhaps a missing mapping - and when you get served from that server you see the issue? That might explain the way it seems to only sometimes happen.

By the way, instansiation of CFCs should always work - you should not be trying to code around this issue by sleeping and trying again.

Ciaran Archer
Thanks Ciaran. It's on a shared server, so I don't think it's clustered.
cf_PhillipSenn