Cometd and Adobe AIR / Doesn't seem to work with Dojo v.1.1 beta 1

10 views
Skip to first unread message

bold greymonkey

unread,
Aug 7, 2008, 9:37:53 AM8/7/08
to cometd-users
Hi

I am trying to create an Adobe AIR widget using dojox.cometd for push.
I get stuck with the dojox.cometd.init function which I try to call
during onLoad. I don't know what happens, the application just gets
stuck in the init function. No error message (or maybe there are some
but I can't see them since dojo doesn't print in AIR introspector).

I use AIR 1.1 and dojo 1.1 beta 1 as explained on the Dojo website.
This should be the minimal version to support air. However, I have
been able to make the cometd thing work with version 1.0.2. This
package was distributed with the Aptana IDE. How come it works with
this version ?

Anybody know why cometd 1.1 beta 1 won't work in AIR ?

Regards

Greg Wilkins

unread,
Aug 13, 2008, 7:15:07 PM8/13/08
to cometd...@googlegroups.com

BGM,

what server side are you using ?

Do you have dojo 1.1 working from javascript with your server (try the
chat demo, it is only a few lines).

no calls should ever "stuck" as cometd is implemented asynchronously.

regards

bold greymonkey

unread,
Sep 10, 2008, 4:43:57 AM9/10/08
to cometd-users
Hi

I am using Jetty 6.1.11 on the server side.

I managed to have dojo 1.1 and cometd to work inside AIR only in one
simple case. In the simple version I could connect to a local push
server subscribe and publish.

Then I tried to do the same on my real app. This time, the user needs
to be logged in on a tomcat server before he can log to the push
server. The login to tomcat goes well, I get back an ID, and then try
to connect to the push server. As I said, it appears like the program
is "stuck" in the dojox.init funcion.
I used JS alerts to debug dejo in AIR. In the init function, I have
something like that :

//CODE
if(!this._isXD){
if(props.ext){
if(props.ext["json-comment-filtered"]!==true && props.ext["json-
comment-filtered"]!==false){
props.ext["json-comment-filtered"] = true;
}
}else{
props.ext = { "json-comment-filtered": true };
}
alert("stop 1");
props.supportedConnectionTypes = dojo.map(this.connectionTypes.pairs,
"return item[0]");
alert("stop 2");
}

The firt alert is launched but I never reach the second one. That's
why I say it looks "stuck".

In both scenarios, I have an error message :
Value undefined : result of expression mll[x]) is not object.
- line 409
- message " Value undefined (result of expression mll[x]) is not
object."
- name "TypeError"
- sourceId 3
- sourceURL "app:/lib/dojo/dojo.js.uncompressed.js"
- stackTrace [Array 4]

I understand that the init function is implemented asynchronously so
code shouldn't get stuck there, I am just saying what I observe.

Does this make sens to someone ?
Thanks for your help :-)

On 14 août, 01:15, Greg Wilkins <gr...@mortbay.com> wrote:
> BGM,
>
> what server side are you using ?
>
> Do you have dojo 1.1 working from javascript with your server (try the
> chat demo, it is only a few lines).
>
> no calls should ever "stuck" as cometd is implemented asynchronously.
>
> regards
>
> bold greymonkey wrote:
> > Hi
>
> > I am trying to create an AdobeAIRwidget using dojox.cometd for push.
> > I get stuck with the dojox.cometd.init function which I try to call
> > during onLoad. I don't know what happens, the application just gets
> > stuck in the init function. No error message (or maybe there are some
> > but I can't see them since dojo doesn't print inAIRintrospector).
>
> > I useAIR1.1 and dojo 1.1 beta 1 as explained on the Dojo website.
> > This should be the minimal version to supportair. However, I have

Greg Wilkins

unread,
Sep 10, 2008, 8:14:13 PM9/10/08
to cometd...@googlegroups.com
Confused now??!?!?!

You said Jetty 6.1.11 and then tomcat? Are you using two servers?

cheers

bold greymonkey

unread,
Sep 11, 2008, 4:03:37 AM9/11/08
to cometd-users
Sorry if I didn't make myself clear. I use 2 servers indeed. Tomcat
hosts my application and I use Jetty just for push. Before a user can
connect to the push server, he has to provide an ID obtained by
logging to the application (i.e on the tomvat server). This detail
shouldn't really matter I would say but that's the only difference
between the version that works and the other one.

Besides, if I run the version where the client has to authenticate and
replace dojo 1.1 with dojo 1.0.2, it works fine.

I can send the code maybe, it might help to spot the problem.

have a nice day
Reply all
Reply to author
Forward
0 new messages