try
{
// name is a CPString which is really just a String with a few more
method calls
_session_exchange = MQ.direct(name);
}
catch(err)
{
console.log(err);
}
TypeError: Result of expression 'this.api[args.shift()]' [undefined]
is not an object. (file:///Users/cremes/Documents/development/javascript/Pilot2/lib/amqp-js/javascripts/mq.js:305
)
While debugging this, the line in question that chokes (mq.js:305) is
this:
return this.api[args.shift()].apply(this.api, args);
At the time of the call, the args array has 3 elements:
0: "exchange"
1:dictionary object
{ exchange: "session", type: "direct"}
2:isa Object
don't know what this is.
Based on my reading and deconstruction of the javascript, it is trying
to retrieve the "exchange" index of the this.api object and call it
with itself and the arguments array (now reduced by 1 element).
Something in there is undefined but I can't see what it is. I tried to
"step into" that call, but it must have thrown that exception right
away.
Any suggestions?
cr
Enabling logging in the MQ.configure block hasn't provided very much
more information. If I provide a MQ.on("load") function in my html
script, it prints to the console that it was loaded. I never see any
other messages in the log from this lib.
This leads me to think that something is going awry with the
ActionScript stuff that needs to be loaded. The call to
this.api[args.shift()].apply(this.api, args) is probably trying to hit
the ActionScript code. I can see that there is a line in the
constructor that sets up the call to "exchange":
ExternalInterface.addCallback("exchange", api_declare_exchange);
I am now loading amqp-debug.swf but it hasn't put out any messages
either about security exceptions or other exceptions. I am guessing
that the flash movie isn't really loading correctly.
I have confirmed that all of the flash files are set to be "trusted"
using the Flash Security Manager. I chose my entire javascripts
folder; according to the docs it should trust all content in the
subdirectories too.
I'm still stuck.
cr
I will check this out tonight and let you know. Have you been able to
get other exchanges working?
--Dan
Sent from my iPhone
> --
>
> You received this message because you are subscribed to the Google
> Groups "amqp-js" group.
> To post to this group, send email to amq...@googlegroups.com.
> To unsubscribe from this group, send email to amqp-js+u...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/amqp-js?hl=en
> .
>
>
This stuff works in the examples but in my own project it is failing. Like I mentioned in an earlier email, I think it is load path issues but I have no idea how to confirm that.
cr
When I make the call to MQ.direct, I have traced through all of the
calls. I can confirm that the call to the ActionScript "exchange"
function (mapped to api_declare_exchange) is returning a null/
undefined value. This null value gets saved in the
this.exchanges[name] array, I think. It is hard to tell because in the
browser javascript debugger it shows the this.exchanges value as an
Object with no elements (i.e. can't examine its contents/fields).
Anyway, the stack unwinds and then executes the "catch" block. I'm
guessing an exception is thrown when making the AS call so
this.exchanges is never really assigned as the stack unwinds. I wish I
could tell why the AS call is throwing an exception. I am using the
amqp-debug.swf but it hasn't produced any more output.
Also, I modified the callback function in the swfobject.embedSWF call
to print out the load status. The event.success value is true, so the
movie *is* loading successfully so I no longer think it is a load path
issue.
I think I have gone as far as I can. I don't have a flash authoring
environment otherwise I would modify the AS and generate new flash
movies with additional debugging.
cr
I have to move on in the short-term just to clear my head. I'll circle
back to this in a day or two.
cr