Results 1 to 9 of 9
  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
    975
    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

  7. #7
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Do you mean that you could see your page working in Firefox?
    Then, the URL supplied to "createEngine" seems correct.
    Anyway, may you please show the URLs by which you include the library javascript files (i.e. lscommons.js and lsengine.js) ?

    Then, the problem might be in the domain management, where some differences between IE and Firefox lie.

    In order to simplify the matter, please try with a canonical use of the host and domain names first, i.e.
    127.0.0.1 web.aagtestdom.com
    127.0.0.1 push.aagtestdom.com
    and issue:
    page.context.setDomain("aagtestdom.com");

    Do you still see the page working with Firefox and not working in IE with this configuration?

    If your tools pose any problem with the custom nonstandard attributes that Lightstreamer needs to identify the visual cells, then you can give up taking advantage of the cell support and use NonVisualTables to receive push data. In this case, you have to put the streaming data on the page in your own way.

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

    Now I have it working in both, IE7 and Firefox 2.

    To recap, and for those who run into "Unable to find the engine" error, here's what I found.

    I have LS Moderato in a server that also hosts a test IIS v6 web server. I created a C# data adapter per the guidelines of the demo projects and an aspx .NET application deployed on IIS. I used VS2005 and .NET framework 2.0.

    In the server's hosts file I have:
    127.0.0.1 web.aagtestdom.com
    127.0.0.1 push.web.aagtestdom.com

    I tried with "127.0.0.1 push.aagtestdom.com" and it works as well.

    Client code in the .aspx page.:
    <script language="JavaScript" type="text/javascript">
    var page = new PushPage();
    page.context.setDomain("aagtestdom.com");
    page.onEngineCreation = function(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>

    The rest of the code is the same as provided from the LS' website.

    To test this from a different machine, I created the same entries in the hosts file of that machine to resolve to the LS/IIS web server:

    xxx.xxx.234.206 web.aagtestdom.com
    xxx.xxx.234.206 push.web.aagtestdom.com

    Next, I'm going to try creating DNS entries in our network to do the same mapping, so we can test these apps from any other machine.

    The address I use to the to the page is:

    http://web.aagtestdom.com/myapp/mypage.aspx

    JSLib is the folder where lscommons.js and lspushpage.js reside and it's located in the same level as the .NET aspx page.

    A word about these files. I started using the files from the Moderato download package, but I noticed that the sample project provided in one of previous replies of this thread included different js files, and only with those my app worked.

    The ones from Moderato package have the date of when I installed Moderato, so that's no good, but their sizes are lscommons 45KB and lspushpage 153 KB. The new ones that do work are 49 KB and 168 KB respectively, and are dated 2/24/2009. The error I get in both browsers when using Moderatos' files is "ER bind Unable to find the engine", which made it also confusing with the domain management problem.

    If you want me to post the files, let me know how I can upload them.

    Thank you Mone and Dario for your guidance, patience and the examples provided.

    If I may have one last question. Could you point me to the document(s) or forum threads that talk about how to get events in non-visible HTML tags on which you can trap events like "onchange" to execute different sets of javascript code based on the data received before they are posted to the browser?

    Thanks again.
    -Guillermo

  9. #9
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    If I may have one last question. Could you point me to the document(s) or forum threads that talk about how to get events in non-visible HTML tags on which you can trap events like "onchange" to execute different sets of javascript code based on the data received before they are posted to the browser?
    you can specify the schema of the table passing an array instead of a null to the table constructor. This way you can provide a schema that is larger than the schema used by the table on the html but you will receive in the callbacks the updates for all the fields.
    OR
    if you need only not-visible cells you could use a NonVisualTable instead of using an OverwriteTable

    all the docs for the web client are available online and in the distribution zip.

    (in case you are referring to DOM events instead of referring to Lightstreamer callbacks, you can find the complete list of DOM events on wikipedia)

    HTH

 

 

Similar Threads

  1. <URGENT> GWT application problem how to solve
    By karthikjai in forum Client APIs
    Replies: 5
    Last Post: April 6th, 2011, 09:41 AM
  2. <URGENT> GWT application problem how to solve
    By karthikjai in forum Client APIs
    Replies: 0
    Last Post: April 1st, 2011, 04:22 PM
  3. createEngine should be in the BODY ??
    By mohamida in forum Client APIs
    Replies: 10
    Last Post: August 18th, 2010, 01:50 PM
  4. createEngine should be in the BODY ??
    By mohamida in forum Client APIs
    Replies: 10
    Last Post: August 18th, 2010, 01:50 PM
  5. Error: createEngine() has already been called
    By vaduganathan in forum Client APIs
    Replies: 3
    Last Post: April 9th, 2010, 09: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 06:46 AM.