Results 1 to 9 of 9

Hybrid View

  1. #1
    Member
    Join Date
    Jun 2008
    Location
    Seattle
    Posts
    6

    createEngine problem on ASP.NET application

    Hi.

    I have Lightstreamer and an IIS web server on the same server. LS is running on default port 8080. I deployed an ASP.NET on IIS with .NET framework 2.0.

    I've been succefully testing some sample client projects where LS functions as a web server, but this is the first time I have an app running on IIS and trying to connect to LS.

    My web app gets a popup error that says: "ER createEngine The call of createEngine methods after the BODY onload event is supported only for DOM2 browsers. You might have reached this point, due to slow page downloads."

    Im launching the app from IE 7.0.5730.11. I've updated the Javascript code in the client app to connect to the local LS on the same server:

    <script type="text/javascript">
    var page = new PushPage();
    page.context.setDomain("archtst1.test.alaskaair.co m");
    page.onEngineCreation = startEngine;
    page.bind();
    page.createEngine("LSAdapterDemo", "JSLib", "SHARE_SESSION");

    function startEngine(engine)
    {
    engine.connection.setAdapterName("LSADAPTERDEMO");
    engine.changeStatus("STREAMING");
    engine.connection.setLSHost("push.archtst1.test.al askaair.com");
    engine.connection.setLSPort("8080");
    }
    var pushtable = new OverwriteTable(null, null, "MERGE");
    page.addTable(pushtable, "EventTargetTable");
    </script>

    And I've checked that the Adapter, which is a C# adapter that connects through sockets successfully, runs fine.

    Any idea what that error means?

    Thanks.
    -G

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    The reported message is issued as a heuristic attempt to identify specific cases but, unfortunately, sometimes it is wrong.
    In the latest versions of the client library we have fixed some spurious occurrences of the message; which SDK version are you using?

    Other causes may prevent the correct loading of the Engine, as, for instance, a wrong url prefix supplied to "createEngine" (see this thread).
    The problem happens before any attempt to connect to the Server, which is then not related with the issue.

  3. #3
    Member
    Join Date
    Jun 2008
    Location
    Seattle
    Posts
    6
    Hi, and thanks for the quick response.

    I'm using LS Moderato as a proof of concept for my company. The .NET adapter is version 1.5.3331.32630. The Lightstreamer Web Client Library is version 4.3.1 build 1355.3.

    I've noticed that the behavior is erratic. I followed the thread suggested and tried different combinations for this instruction:

    page.createEngine("CBOFlightPublisher", "JSLib", "SHARE_SESSION");

    I've tried: "JSLib", "\JSLib", ".\JSLib", "/JSLib", "./JSLib", "JSLib/", "/JSLib/", and others, but the errors vary between the one described before and "ER bind Unable to find the engine".

    And these errors happen even when I use only one format, for example: "JSLib". If I start a new browser, this latter error shows up, but if I refresh the browser, the former error shows up.

    By the way, "JSLib" is the folder where I have the LS JavaScript libraries and it's located in the root folder of the ASP.NET app.

    Just to verify, in the above instruction I'm referencing "CBOFlightPublisher", which is the name of the class that implements IDataProvider. Is this correct? Or should I use a different name, like the adapter's name that is described in adapters.xml?

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

    first of all I suggest you to replace one of your entry in your hosts file (to be used to access the web server) as follows:
    Code:
    archtst1.test.alaskaair.com -> web.archtst1.test.alaskaair.com
    this will avoid issues with IE that has problems when one of the host names (web server or lightstreamer server) is equal to the domain set.

    Did you try the application with firefox? If not, it could be that the only problem was the one above.

    Apart from that your engine creation seems ok.
    About createEngine parameters,
    the first one is a random name, you can use what you want as it is used only to match different applications in the same browser so that they can share one single connection to Lightstreamer server (see createEngine documentation for further details).
    the other one is the path of lightstreamer js libraries. Such path should be relative to the page that creates the engine (i.e. is the same path you use to include the lspushapge.js and lscommons.js files).

    It should not be important, but where is the engine creation code in your page?

    As the ASP.NET framework makes its own server-side parsing of the page please check how the page reaches the client.

    Please take also a look at our ASP.NET client example.

  5. #5
    Member
    Join Date
    Jun 2008
    Location
    Seattle
    Posts
    6
    Hi Mone.

    I changed it (and went a little more simple), and this is what I have now:

    Hosts file:
    127.0.0.1 web.aagtestdom.com
    127.0.0.1 push.web.aagtestdom.com

    Client script:
    <script type="text/javascript">
    var page = new PushPage();
    page.context.setDomain("web.aagtestdom.com");
    page.onEngineCreation = function startEngine(engine)
    {
    engine.connection.setAdapterName("LSADAPTERDEMO");
    engine.changeStatus("STREAMING");
    engine.connection.setLSHost("push.web.aagtestdom.c om");
    engine.connection.setLSPort("8080");
    }
    page.bind();
    page.createEngine("CBOFlightPublisher", "JSLib/", "SHARE_SESSION");
    var pushtable = new OverwriteTable(null, null, "MERGE");
    page.addTable(pushtable, "EventTargetTable");
    </script>

    But I still get the same error: Unable to find the Engine.

    If I change the hosts file with web.aagtestdom.com, then I have to load the webpage with the same domain: http://web.aagtestdom.com/WebClientA...ayFlights.aspx

    And it doesn't matter whether in the code I do

    page.context.setDomain("web.aagtestdom.com");

    or
    page.context.setDomain("aagtestdom.com");

    I still get the same error.

    I looked at the resource links provided, but can't spot anything different at the basic level from what I have. I see other properties being used (setMaxBandwidth, setIdleTimeout, etc), but I don't think they would make a difference in my case, would they?

    Any ideas of what I might try next?

    Thanks.
    -Guillermo

  6. #6
    Member
    Join Date
    Jun 2008
    Location
    Seattle
    Posts
    6
    Hi Mone.

    To answer another question of yours, the createEngine code is in the BODY section, underneath the DIV tags for the table receiving the updates.

    I tested the ASP.NET page in Firefox and it worked fine!

    I'm noticing that the DIV tags in the client page contain properties not recognized by Microsoft's VisualStudio Editor, namely: source, table, item and field. I can't find them either as recognized properties in W3C and other web sites, but seems to be the difference between IE and Firefox. Any ideas on what do I need to change in the client page to be able to load it from IE? I saw a posting related to a hidden table or something similar to use instead of OverwriteTable. Would that be able to use more generic DIV properties, or another HTML tag instead of DIV that is more browser-agnostic?

    Thanks.
    -Guillermo

 

 

Similar Threads

  1. <URGENT> GWT application problem how to solve
    By karthikjai in forum Client SDKs
    Replies: 5
    Last Post: April 6th, 2011, 08:41 AM
  2. <URGENT> GWT application problem how to solve
    By karthikjai in forum Client SDKs
    Replies: 0
    Last Post: April 1st, 2011, 03:22 PM
  3. createEngine should be in the BODY ??
    By mohamida in forum Client SDKs
    Replies: 10
    Last Post: August 18th, 2010, 12:50 PM
  4. createEngine should be in the BODY ??
    By mohamida in forum Client SDKs
    Replies: 10
    Last Post: August 18th, 2010, 12:50 PM
  5. Error: createEngine() has already been called
    By vaduganathan in forum Client SDKs
    Replies: 3
    Last Post: April 9th, 2010, 08:58 AM

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 03:19 PM.