Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7854643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:07:54+00:00 2026-06-02T20:07:54+00:00

I am trying to setup a Bayeux server and client using Jetty, Dojo and

  • 0

I am trying to setup a Bayeux server and client using Jetty, Dojo and maven.

My issue is that dojo seems to never be ready. The callback in require is never called.

This is the code for the HTML page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
            "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
   <title></title>
   <script data-dojo-config="parseOnLoad:true" src="dojo/dojo.js.uncompressed.js"></script>
   <script type="text/javascript">

      function initFormListener( onNewForm ) {

         require(["dojox/cometd", "dojo/io/script", "dojox/cometd/callbackPollTransport", "dojo/domReady!" ],
                     function ( cometd, io, callback ) {
                        console.log(" entered CometD function ");

                        // Function that manages the connection status with the Bayeux server
                        var _connected = false;

                        var _metaConnect = function ( message ) {
                           if ( cometd.isDisconnected() ) {
                              _connected = false;
                              console.log( "disconnected from server " + message );
                              return;
                           }

                           var wasConnected = _connected;
                           _connected = message.successful === true;
                           if ( !wasConnected && _connected ) {
                              console.log( "connected to server " );
                           }
                           else if ( wasConnected && !_connected ) {
                              console.log( "connection broken from server " + message );
                           }
                        }

                        // Function invoked when first contacting the server and
                        // when the server has lost the state of this client
                        var _metaHandshake = function ( handshake ) {
                           if ( handshake.successful === true ) {
                              cometd.batch( function () {
                                 cometd.subscribe( '/newFormData', function ( message ) {
                                    console.log( "new data for form " + message.formId + " in formData " + message.formDataId );
                                 } );
                              } );
                           }
                        }

                        // Disconnect when the page unloads
                        dojo.addOnUnload( function () {
                           cometd.disconnect( true );
                        } );

                        var cometURL = location.protocol + "//" + location.host + "/VisionWeb/cometd";
                        cometd.configure( {
                           url:cometURL,
                           logLevel:'debug'
                        } );

                        cometd.addListener( '/meta/handshake', _metaHandshake );
                        cometd.addListener( '/meta/connect', _metaConnect );

                        cometd.handshake();
                     } );
      }

      initFormListener( function() {console.log("cometd success")});
   </script>
</head>
<body>
   just some content
</body>
</html>

It’s not like dojo does not work on the server. It does. My app is written in dojo 1.7.2

Is there a known issue that I don’t know about or am I doing something wrong?

Thank you for any tip on how to find out why the callback is never called.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:07:56+00:00Added an answer on June 2, 2026 at 8:07 pm

    You are trying to use cometD.

    According to cometD’s Reference Manual, you need to replace some js files of the standard Dojo toolkit, with the files provided in cometD’s Primer download.

    Use cometD’s documentation and you’ll get your app up and running nicely and in a reasonable time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to setup SSRS 2008 on Windows Server 2008. It seems to
Trying to setup SSL on jetty 7.2.2 using these instructions: http://docs.codehaus.org/display/JETTY/How+to+configure+SSL stuck on 3b:
Trying to setup a Cron task that gets a file via FTP however seems
I'm trying to setup an Apache/PHP/Postgresql server locally on my machine. I'm using Windows
I'm trying to setup a private beta for a site that I'm working on.
I am trying to setup a shared authentication system on a build server. We
I'm trying to setup some friendly URLs on a SharePoint website. I know that
I'm trying setup a map that displays different pin colors depending on the type/class
I'm trying to setup a loop in Wordpress that will show all posts from
Im trying to setup my django project on a staging server with nginx, virtualenv,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.