Topic
1 reply Latest Post - ‏2007-10-29T15:44:57Z by SystemAdmin
SystemAdmin
SystemAdmin
59 Posts
ACCEPTED ANSWER

Pinned topic Cross-domain Comet

‏2007-10-26T09:07:45Z |
Hi!

I hacked the quote_streamer application to create my own app that publishes messages to two different channels (at 5 second intervals). These messages are published from the server using a Timer similiar to quote_streamer. I've added a screenshot to illustrate.

And this works great on my WAS 6.0 Server (client JSP's and server bundled into one web application). Then I tried to create a WAS 5.0/Portal 5.0 (we're still running on this, believe it or not!) JSP that tries to do comet calls to the WAS 6.0 Server. And this is where it start to go a bit wonky...

I get the following exception on the WAS 6.0 Server:

07/10/26 09:44:58:625 GMT 0000002b SystemErr R java.lang.NegativeArraySizeException
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.webmsg.container.cfw.WebMsgCFWService.parseMessageField(WebMsgCFWService.java:272)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.webmsg.container.cfw.WebMsgCFWService.examineRequest(WebMsgCFWService.java:218)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.webmsg.channel.passthrough.PassThroughConnectionLink.processRequest(PassThroughConnectionLink.java)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.webmsg.channel.passthrough.PassThroughConnectionLink.doWork(PassThroughConnectionLink.java:299)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.webmsg.channel.passthrough.PassThroughConnectionLink.ready(PassThroughConnectionLink.java:168)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:288)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:207)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:109)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
07/10/26 09:44:58:656 GMT 0000002b SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1471)

And it's caused by the following JavaScript: (served in a JSP from the WAS 5.0 Server - http://bbdrud.vodacom.corp)
dojox.cometd.init({}, "http://bbdrud2.vodacom.corp:9080/WebNotificationCentral/NotificationCentralServlet");

I looked at the dojox.cometd.init method, and it seems that when the comet call is not from the same originator (cross-domain), it does a JSONP workaround instead of a normal XMLHttpRequest. However, the ioArgs.message is exactly the same! (Exception for the extra JSONP bits.)

Am I trying to do something that still needs some dev in the Dojo library or is it some other problem? Any assistance would be appreciated.

Regards,
Rudolf
Updated on 2007-10-29T15:44:57Z at 2007-10-29T15:44:57Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    59 Posts
    ACCEPTED ANSWER

    Re: Cross-domain Comet

    ‏2007-10-29T15:44:57Z  in response to SystemAdmin
    The current beta version does not handle cross domain Bayeux requests from the Dojo cometd client (callback-polling). The server should handle things more gracefully - and a defect was put in to clean up the exception you are seeing below.

    Can you place a WebServer+plugin, proxy server, or something else in front of the different app servers to route the comet and normal 5.0 server requests to different servers? This would present a single host to the html/web logic, and bayeux/dojo cometd client would use long-polling - which should work well.

    thanks
    Mark