Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Nov 2006
    Location
    Belfast
    Posts
    15

    Data Adapter's subscribe() method not getting called

    Hi again

    Using the Porfolio data adapter code as a template, I am trying to create my own feed with sorting, paging etc. But I cannot get a cut down version of the Portfolio Adapter (took out the JMS-related stuff, kept the hard coded sample values) to run. For some reason on startup the subscribe method does not get called, hence no stocks are added to the table on the client, and updates continue to be created without the updateProcessor consuming any messages (it sleeps as it fails the first queue check in run method).

    Do you know of any reason why the subscribe method would not be called?

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    Hi,

    if you observed that the subscribe method is not called, then the current problem is not on the Data Adapter side.
    You can collect more details on Server operation by setting as DEBUG the priority of the "LightstreamerLogger.requests" and "LightstreamerLogger.subscriptions" loggers on the Server logging configuration file.
    Then, feel free to send us the log for a check.

    Dario

  3. #3
    Member
    Join Date
    Nov 2006
    Location
    Belfast
    Posts
    15
    Thanks for the pointer, no requests coming through apparently, so it must be a javascript problem. But I am using exact same settings as was in the source (\Clients\PortfolioDemo_online) - obviously changing the port/hostname/domain values. One thing the source did not provide was the 'base' js/html files but I just used the ones that came with the server distribution (\DOCS-SDKs\sdk_client_web\lib).

    Not sure what else I need to add? There is no javascript popup msgs, and although the browser status bar reads 'Lightstreamer is connecting...' nothing is displayed in the table rows

    At the moment I have index.html, lsengine_config.js in root web folder with the ls html/js files in /ls/lsblank.html etc (6 files unchanged).

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

    Does the message remains 'Lightstreamer is connecting...' and never switches to "Lightstreamer is in streaming mode..." or "Lightstreamer is in smart polling mode..."?

    If so this means that the web client is not yet connected to the Server, please re-check port/hostname/domain values and return back to me.

    PS:
    Quote Originally Posted by CitiMan
    There is no javascript popup msgs
    In our Portfolio code those messages could be disabled.
    check these calls:
    Code:
    lsPage.context.setDebugAlertsOnClientError(false);
    Code:
    ls.context.setDebugAlertsOnClientError(false);
    on index.html and lsengine_config.js

    Turn false to true to enable messages.

    Bye.

  5. #5
    Member
    Join Date
    Nov 2006
    Location
    Belfast
    Posts
    15
    both calls to setDebugAlertsOnClientError() are set to true.

    At the moment yes all that happens is the 'Lightstreamer is connecting...' msg. Nothing further.

    I've double checked the port/hostname/domain settings, all fine. I can get the simple OverwriteTable demo working with the StockList adapter so whatever it is it's specific to the client config for the Portfolio DynaMetapushTable?

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

    If host/domain/port is all ok maybe the problem is on the Adapters name.

    The name is set client-side in the lsengine_config.js:
    Code:
    ls.connection.setAdapterName("PORTFOLIO");
    And server side in the portfolio adapter's folder in the adapters.xml file:
    HTML Code:
    <adapters_conf id="PORTFOLIO">
    Can you confirm that those names match?

    Note that adding a new adpater to a Lightstreamer instance requires that the Server is restarted.

  7. #7
    Member
    Join Date
    Nov 2006
    Location
    Belfast
    Posts
    15
    Adapter name is fine too, set to PORTFOLIO on both lsengine_config.js & in adapters.xml, located in root of /adapters/Portfolio folder on server. rest of the adapters.xml file is:

    <?xml version="1.0"?>
    <adapters_conf id="PORTFOLIO">

    <metadata_provider>
    <adapter_class>com.lightstreamer.adapters.metadata .LiteralBasedProvider</adapter_class>
    <param name="search_dir">.</param>
    <param name="max_bandwidth">16</param>
    <param name="max_frequency">5</param>
    <param name="buffer_size">30</param>
    </metadata_provider>

    <data_provider>
    <adapter_class>com.lightstreamer.adapters.portfoli o.PortfolioDemoProvider</adapter_class>
    <param name="config_file">portfolio.conf.properties</param>
    </data_provider>

    </adapters_conf>

  8. #8
    Member
    Join Date
    Nov 2006
    Location
    Belfast
    Posts
    15
    I should maybe also point out the only difference I have in architecture is that the index.html and other js/html files are located on a tomcat server (8080) with the lightstreamer server (8081) on the same host/domain.

  9. #9
    Member
    Join Date
    Nov 2006
    Location
    Belfast
    Posts
    15
    changed loadEngine to loadEngineMinimal and added the startEngine js function to lsPage's onEngineReady event and works fine now

 

 

Similar Threads

  1. Replies: 4
    Last Post: October 24th, 2011, 10:33 AM
  2. Error: createEngine() has already been called
    By vaduganathan in forum Client SDKs
    Replies: 3
    Last Post: April 9th, 2010, 09:58 AM
  3. notifySessionClose sometimes not being called
    By lstest in forum Adapter SDKs
    Replies: 2
    Last Post: February 24th, 2010, 12:09 PM
  4. form POST method vs GET method
    By chuan_ckc in forum Client SDKs
    Replies: 1
    Last Post: August 20th, 2009, 11:29 AM
  5. Data Provider Protocol Method Tags
    By juls in forum Adapter SDKs
    Replies: 1
    Last Post: March 4th, 2009, 10:00 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 10:12 AM.