0

Strange component path behavior with event gateway

ColdFusion

I am working on a client project using an SMS event gateway using CF8. I had written out a proxy API to allow the SMS gateway to talk to the core application using a shared data model that is strapped together using ColdSpring. I had written a test harness cfm template during development and just kind of assumed that I could instantiate this proxy component from my event gateway without issue and carry on about my business. For some reason, however, I am seeing some behavior that I wasn't expecting. I have resolved this by way of using a ColdSpring mapping in the CF Admin. However, I am still curious why the following takes place.

Here is the general picture:

I have an app that sits in /www/myclientapp/www

The proxy components and event gateway component sit in /www/myclientapp/api/proxy and there is an Application.cfc in the "api" directory. I have a coldspring directory in both /www/myclientapp/www/coldspring and /www/myclientapp/api/proxy/coldspring.

When I run a testharness file in /www/myclientapp/api/proxy/testharness.cfm, I can instantiate the data model properly and there are no issues. However, when I talk to the event gateway component that sits in the ..../proxy directory, I get errors instantiating ColdSpring in the Application.cfc stating
"Could not find the ColdFusion Component or Interface coldspring.beans.DefaultXmlBeanFactory. --- path: /www/myclientapp/api/proxy/coldspring/beans/DefaultXmlBeanFactory.cfc".

So, digging into this a bit further I did a FileExists() test on that cfc and it returns true. HUH?

Here is my question. How can the following two statements be true:

1) FileExists(ExpandPath("coldspring/beans/DefaultXmlBeanFactory.cfc")) returns "true".

2) CreateObject("component","coldspring.beans.DefaultXmlBeanFactory") errors out with the error you see above.

Hopefully someone smarter than me can shed some light on this problem!

Ron Gowen said:
 
I do not use coldspring (yet) but shouldn't you remove the ".cfc" from the second statement?
 
posted 212 days ago
Add Comment Reply to: this comment OR this thread
 
 
Ooops... good catch. That was actually just a typo in the post. The actual code was correct.
 
posted 212 days ago
Add Comment Reply to: this comment OR this thread
 
dc said:
 
what is in your Application.cfc in the api folder, are you setting any mappings in it?

If you are setting a root mapping for the API for coldspring, make sure it is like:

this.mappings["/"] = getDirectoryFromPath(getBaseTemplatePath())

rather than:

this.mappings["/"] = expandPath(".")
 
posted 212 days ago
View Replies (1) || Add Comment Reply to: this comment OR this thread
 
.: HIDE REPLIES :.
Darren said:
 
Hey dc,

I am having the same problem on a Ubuntu, Apache2 server running CF8.

I am curious to know if the suggestion from dc remedied the problem outlined on this blog post.

Did that fix the problem?

Regards,

Darren
 
posted 180 days ago
Add Comment Reply to: this comment OR this thread
 

Search