OK, then... try this:

<cfset xml = xmlParse(expandPath('./cfcs/reactor.xml")>
<cfset config = createObject("component","reactor.config.config").init(xml)>
<cfset reactor = createObject("component","reactor.ReactorFactory").init(config)>
<cfdump var="#reactor#" />

Notes:
xmlParse() will prove that your xml file can be found.
reactor.config.config is a CFC that handles the XML file, not the xml file itself.
This technique will cause the isObject() call to resolve to true rather than false.
The reactor distro cannot be inside another folder off the root.
You can have 10,000 sites using a copy of Reactor, even if it's not at a mapping and sitting in the webroot.

And, one other thing. If you changed the contents of the zip file at all (you've mentioned rearranging all the directories), go get a clean one, delete your reactor folder, and put the contents of the zip (at least the reactor folder that contains config, iterator, query, project, etc.) at c:\inetpub\wwwroot\ so that the following paths are valid:

c:\inetpub\wwwroot\reactor\reactorFactory.cfc
c:\inetpub\wwwroot\reactor\iterator\iterator.cfc
c:\inetpub\wwwroot\reactor\config\config.cfc
etc...

Note 2: I just realized what I was looking at. I've been using shared environments for so long that I made a faulty assumption. I was assuming that c:\inetpub\wwwroot\testsite was the webroot of a virtual site. For this I apologize. However, this further proves my point that your problem is not Reactor as this is what I use every day... I work against a local copy of the built-in CF webserver without a webserver involved at all, and I hang my applications off the root in subfolders. I have ModelGlue, Reactor, ColdSpring, Fusebox, Mach-II and a couple other packages sitting on my box right now that all work fine.

J


------------------------------------------------

Jared C. Rypka-Hauer

Continuum Media Group LLC

http://www.web-relevant.com

Member, Team Macromedia - ColdFusion


"That which does not kill me makes me stranger." - Yonah Schmeidler


On Apr 16, 2006, at 9:43 AM, Mike Kear wrote:

Nope.   my call to the xml file was correct.  It was being passed
through to the cfc with the correct path.  The reactorFactory.cfc
isn't recognising the path in the arguments as an object.

It's not supposed to, necessarily. It can be passed a config object, a relative path, an absolute path, or an XML object.

Furthermore, if you're passing it a string why would you expect that to be seen by anything as an object?

    If I do
a CFDUMP of the arguments scope I can see that there is definitely an
object called arguments.configuration, with a value of 
C:\Inetpub\wwwroot\testsite\cfcs\Reactor.xml, yet the statement

<cfif NOT IsObject(arguments.configuration)> is evaluating to false,
because it's executing the code in the line that follows which is

Again, this is expected.


<cfset arguments.configuration = CreateObject("Component",
"reactor.config.config").init(arguments.configuration) />

and since there is no mapping called "reactor"  and this cfc is
already in a folder called "reactor" there is no place underneath the
reactorFactory cfc for it to find teh config cfc.

"reactor.config.config" is a path. If you have c:\inetpub\wwwroot\reactor\config\config.cfc, then it can find it just fine.

It has zilch to do with mappings. Get off the mappings. You do not need a mapping here.

When I use the code you quoted, cut and pasted directly off your
message, i get the following error:
[quote]
Could not find the ColdFusion Component reactor.config.config.
[/quote]
which is what is to be expected, becuase (a) the xml file is NOT at
/cfcs/reactor.xml  but at cfcs.reactor.xml.    and [b] there is no
mapping called 'reactor' because i deleted the mapping, since i'm
trying to get it working without a mapping.

"reactor.config.config" is not the xml file, it's a CFC that must exist under the reactor folder in a folder called config. As I stated above:

c:\inetpub\wwwroot\reactor\config\config.cfc

cfcs.reactor.xml is an invalid anything. XML files are accessed via a file path, not a dotted path. CFCs are accessed via a dotted path, but the extension is dropped... so cfcs.reactor.xml is a non-thing.

The root of the web site is at c:\inetpub\wwwroot\testsite.    In this
environment you can't use  "/cfcs/reactor.xml"     You can only use 
'cfcs/Reactor.xml".

Why? That makes no sense. The "/" character here is no different than <img src="" /> and is a reference to the root of the site. The only way this could break is if you have yet another mapping that's interfering with your CF server finding the right folder at /, and if you have one, you should remove it or create a mapping to /testsite so that, when you're in testsite, "/reactor" will point to the right folder.

And in fact the code I am using to test reactor is as follows:
<cfset Reactor = CreateObject("Component",
"reactor.reactorFactory").init(expandPath("cfcs\Reactor.xml")) />
<cfdump var="#Reactor#" />

Is this in the site root? The only way this will work is if the file it's in is one folder below CFCs, because expandPath() will assume that cfcs\reactor.xml means "a folder called cfcs in the same folder I'm in, with a file called reactor.xml in it." 

OK perhaps others are using it in a shared environment.  Perhaps what
I should be saying instead then is that you cannot use reactor to
develop on a PC using WinXPPro and IIS because in IIS you cant have
multiple sites.  You can only have one site.

Also incorrect. Perhaps in PWS you could only have one site. Perhaps on the version of IIS that comes with XP Pro you can only have one site... basically PWS XP. But to say that on *IIS* you can only have one site is a gross generalization. It's important to know the platform you're using so that people can help you appropriately. I have a copy of Win2k Advanced Server running IIS with 20 sites on it here in the house. Be specific or we're not going to be able to help you get this resolved.

But it sitll means using reactor is impractical for developing in the
smaller sites.  I can have a site working in the production
environment, but can't have it running in the dev environment.  That
makes it pretty hard to work on dont you think?

Remembering that reactor is supposed to be a time saver, i can't
develop with it, unless i change every reference to CFCs throughout
the code,  every time there's a code change OR  change my web server -
which last time i had a go at it cost me a LOT of time.

Believe me, I'm eager to be proved wrong here.  I think Reactor looks
like a terrific product.  I was excited the other day when i saw
Doug's breezo on it,  and thats why i had a go at using it.   But i
can't see how it's practical to use in a shared environment, using IIS
on my dev machine.


Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month




On 4/17/06, Jared Rypka-Hauer <[EMAIL PROTECTED]> wrote:
Mike...

I'll take a stab at reiterating here...

YOU DO NOT NEED A MAPPING UNLESS YOU'RE SHARING CODE ACROSS SITES.

Mappings are server-wide, so any site connected to the server will see the
same thing at /Reactor if you have a Reactor mapping.

If you don't have a mapping, you need a copy of Reactor in the root of each
site (which, for me in a shared environment, is far preferable, because it
allows your clients to run with/without it and run different versions of
it).

If you don't have a mapping to Reactor, CF looks in the document root for
that website for a folder called Reactor.

And, furthermore, your call to create the ReactorFactory was just plain
wrong. Instead of this (which you had):

<cfset Reactor =
CreateObject("Component","reactor.reactorFactory").init(expandPath("cfcs\Reactor.xml"))
/>


What you SHOULD HAVE HAD was this:

<cfset Reactor =
CreateObject("Component","reactor.reactorFactory").init("/cfcs/Reactor.xml")
/>





That tells CF that your component is off the webroot in a folder called
Reactor and that your XML file is off the root in a folder called cfcs.




And, I'm gonna say this one more time: Sean's using this in a shared
environment. I'm using this in a shared environment. Doug's tested this in a
simulation of a shared environment, and you getting all agitated and rude
and huffy about it doesn't encourage anyone to be terribly helpful. So... my
suggestion is that you test the example I have above by removing any
mappings, dropping Reactor into the webroot of testsite, and creating
c:\inetpub\wwwroot\testsite\index.cfm with the following
code:




<cfset Reactor =
CreateObject("Component","reactor.reactorFactory").init("/cfcs/Reactor.xml")
/>

<cfdump var="#Reactor#" />




That should give you what you are looking for.



J




------------------------------------------------

Jared C. Rypka-Hauer

Continuum Media Group LLC


Member, Team Macromedia - ColdFusion




"That which does not kill me makes me stranger." - Yonah Schmeidler


--



-- Reactor for ColdFusion Mailing List -- [email protected]



Reply via email to