Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Member
    Join Date
    Oct 2007
    Location
    new york
    Posts
    9

    Unable to find Engine

    Hello guys,

    i have created a simple .NET adapter. Now I need to create a simple web page that would connect to LS server and get everything that the adapter sends out. LS is running locally on my developement machine. I created an HTML code like this:

    Code:
    <html>
     <head>
       <title></title>
         <script src="ls/lscommons.js"></script>
         <script src="ls/lspushpage.js"></script>
     </head>
      <body>
    	
     </body>
    	
    <script language="javascript" type="text/javascript">
    
    var schema = "hdln smbl body tpcid cmnd";
    
    var lsPage = new PushPage();
    lsPage.context.setDomain(null);
    lsPage.onEngineCreation = startEngine;
    lsPage.onEngineReady = engineReady;
    lsPage.bind();
    lsPage.createEngine("SLEngine", "LS/lsengine.html");
    
    function startEngine(eng) 
    {
    	eng.policy.setMaxBandwidth(30);
    	eng.policy.setIdleTimeout(30000);
    	eng.policy.setPollingInterval(1000);
    	eng.connection.setLSHost("localhost");
    	eng.connection.setLSPort("8080");
    	eng.connection.setAdapterName("HEADLINESDEMO");
    	eng.changeStatus("STREAMING");
    }
    
    function engineReady ()
    {
        var newTable = new NonVisualTable("item",schema,"MERGE");
        newTable.onItemUpdate = updateItem; 
        lsPage.addTable(newTable, "1");
    }
    when I open this page I am getting an error message "ER Bind Unable to find Engine..check your.. bla bla".

    Could you please point me out how do I create a client application?

    Thanks

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hello,

    Probably you have some experience with the old loadEngine/loadEngineMinimal methods.

    there is an error on your createEngine call:

    The path for the createEngine method is not the path of the lsengine.html file but the path of the library.
    So your call should be:

  3. #3
    Member
    Join Date
    Oct 2007
    Location
    new york
    Posts
    9
    Mone,

    thanks a lot for the reply. I changed the path to the library to "ls/" and now everytime I open my page I see a message "Streaming system is connecting..." at the bottom of the browser. And nothing happens next.. I have my LS server up and running and my adapter is connected to the LS server.

  4. #4
    Member
    Join Date
    Oct 2007
    Location
    new york
    Posts
    9
    Mone,

    Do you have a simple step-by-step tutorial with a simple sample code of how to connect to a LS server from a web page and get simple updates from it?

    I have implemented my client side according to those sample code you provided here but it sill does not work.

    Thanks a lot

  5. #5
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hello,

    you can find a tutorial here, and another one on the software distribution. Look for LS_HOME/DOCS-SDKs/sdk_client_web/doc/Web Client Tutorial.pdf . Read also LS_HOME/DOCS-SDKs/sdk_client_web/examples/StockListDemo/README.TXT .

    Your configuration is ok if you access the page from Lightstreamer internal web server with an url like http://localhost:8080/MyApp/

    Please note that the use of localhost is discouraged. Please use a complete machine name (e.g.: mypc.mydomain.com) even if you are just testing LS on your local environment.

  6. #6
    Member
    Join Date
    Oct 2007
    Location
    new york
    Posts
    9
    I put LSS on the same machine as the webserver and created a DNS record "test.domain.com". Here is the new client side code:

    Code:
    <html>
     <head>
        <script src="ls/lscommons.js"></script>
        <script src="ls/lspushpage.js"></script>
      </head>
      <body>
    	
      <script language="javascript" type="text/javascript">
    
      var lsPage = new PushPage();
      lsPage.context.setDomain(null);
      lsPage.onEngineCreation = startEngine;
      lsPage.onEngineReady = engineReady;
      lsPage.bind();
      lsPage.createEngine("SLEngine", "ls/");
    
     function startEngine(eng) 
     {
       eng.policy.setMaxBandwidth(30);
       eng.policy.setIdleTimeout(30000);
       eng.policy.setPollingInterval(1000);
       eng.connection.setLSHost("test.domain.com");
       eng.connection.setLSPort(8080);
       eng.connection.setAdapterName("HEADLINESDEMO");
       eng.changeStatus("STREAMING");
    }
    
    function engineReady ()
    {
        var newTable = new NonVisualTable(new Array("item"), new Array("id", "hdln","smbl","body","tpcid","cmnd"), "DISTINCT"); 
        newTable.onItemUpdate = updateItem; 
        lsPage.addTable(newTable, "1");
    }
    
    function updateItem(item, updateInfo, name) 
    {
        trace (...);
    }
    
     </script>
    </body>
    </html>
    I am still on the same page. When this page is opened in the browser I see "Streaming system is connecting..." message

  7. #7
    Member
    Join Date
    Oct 2007
    Location
    new york
    Posts
    9
    Must any Adapter be started and hooked into LS server before clients start connecting to LS server?

    Mone what did you mean saying "Your configuration is ok if you access the page from Lightstreamer internal web server with an url like http://localhost:8080/MyApp/"?

    My testing HTML page is on my development machine, LS server is also on my development machine, a .NET adapter is also on my development machine. Is this some kind of confugration that would probably not work?

    Thanks

  8. #8
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Quote Originally Posted by ap7256
    Mone what did you mean saying "Your configuration is ok if you access the page from Lightstreamer internal web server with an url like http://localhost:8080/MyApp/"?
    I mean that if your LS server also serve the static pages you can access it via localhost and without setting the domain, in the other case (i.e.: pages from a web server, streaming from Lightstreamer) than you need to set the domain accordingly to the LS host setting. In your case (in the case you're not using Lightstreamer internal web server) you should change the setDomain call:


    If you're using Lightstreamer internal web server than the configuration seems correct. Please could you send Lightstreamer's log?

  9. #9
    Member
    Join Date
    Oct 2007
    Location
    Beijing
    Posts
    5

    The server running LS Demo must have Domain?

    Hi Mone,

    Could you help me to confirm this quesiton? Thanks!

    If I config Demo on server which has public IP address but no domain name,
    how should I set domain and LSHost?
    One important point: Someone will visit this Demo through internet.

    I try to write web page like below, but it throw exception like "ER Bind Unable to find Engine..."

    <script>
    var lsPage = new PushPage();
    lsPage.context.setDomain("55.55.55.55");
    lsPage.onEngineCreation = function(engine) {
    engine.connection.setLSHost("55.55.55.55");
    engine.connection.setLSPort(8080);
    engine.connection.setAdapterName("DEMO");
    engine.changeStatus("STREAMING");
    }
    lsPage.bind();
    </script>

    Or

    <script>
    var lsPage = new PushPage();
    lsPage.context.setDomain(null);
    lsPage.onEngineCreation = function(engine) {
    engine.connection.setLSHost("55.55.55.55");
    engine.connection.setLSPort(8080);
    engine.connection.setAdapterName("DEMO");
    engine.changeStatus("STREAMING");
    }
    lsPage.bind();
    </script>

  10. #10
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    NOTE that this is advised against, but if it's only for some tests it is ok:

    if the pages are on Lightstreamer internal web server just use null (for everything...):

    and access you application via IP (works at least on FX and IE, not sure on other browsers)

    in the other case you can't access the page via IP but you need a hostname (2 if LS and web server are on different machines)

    HTH

 

 

Similar Threads

  1. unable to find engine-chrome browser
    By georgeeapen in forum Client SDKs
    Replies: 1
    Last Post: May 25th, 2009, 10:21 AM
  2. Client error - Unable to find the Engine
    By kg_can in forum Client SDKs
    Replies: 1
    Last Post: March 7th, 2008, 10:11 AM
  3. ER bind Unable to find the Engine
    By eduramires in forum Client SDKs
    Replies: 3
    Last Post: February 4th, 2008, 10:14 AM
  4. ER bind Unable to find the Engine
    By eduramires in forum General
    Replies: 1
    Last Post: January 29th, 2008, 06:03 PM
  5. Unable to find the Engine
    By RichP1 in forum Client SDKs
    Replies: 6
    Last Post: December 18th, 2007, 02:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 09:43 AM.