Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Feb 2009
    Location
    Mumbai
    Posts
    2

    web client is not updating , no errors in server console

    Hi All,

    I am not getting what is the problem in my code. in my html page i am using 42 items, i written one adapter class using Java API, i used SmartDataProvider.
    i am not getting any errors in server console, i used ItemEventListener ,
    smartUpdate(handle,inactiveMap,false) method, this method is also working fine. the server console is showing the System.out.println() line which added with completeInactiveMap details. but front end html page is not updating with new data.

    adapter.xml file
    <adapters_conf id="GROUPLIVERATES33">
    <metadata_provider>
    <adapter_class>com.lightstreamer.adapters.metadata .LiteralBasedProvider</adapter_class>

    </metadata_provider>
    <data_provider>
    <adapter_class>com.group.adapter.GroupStreamAdapte r</adapter_class>
    </data_provider>
    </adapters_conf>

    The code for page

    <script type="text/javascript">
    for (var i = 0; i <42; i++) {

    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="Symbol">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="ABC">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="OfferVol">-</div></td>');
    document.write('<td><span source="lightstreamer" table="main2" item="i'+i+'" field="OfferPrice">-</span></td>');
    document.write('<td nowrap><div source="lightstreamer" table="main2" item="i'+i+'" field="BidVolume">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="BidPrice">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="Volume">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="High">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="Low">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="LastPrice">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="PrevClose">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="Chg">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="%">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="Trades">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="OpenPrice">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="AvgPrice">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="High52Week">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="Low52Week">-</div></td>');
    document.write('<td><div source="lightstreamer" table="main2" item="i'+i+'" field="Value">-</div></td>');
    document.write('</tr>');
    }
    </script>

    var page = new PushPage();
    page.onEngineCreation = function(engine) {
    engine.connection.setAdapterName("GROUPLIVERATES33 ");

    engine.connection.setLSHost("localhost");
    engine.connection.setLSPort("9911");

    engine.changeStatus("STREAMING");

    }
    page.bind();
    page.createEngine("GROUPLIVERATES33APP", "LS", "SHARE_SESSION");

    var pushtable = new OverwriteTable(null, null, "MERGE");
    page.addTable(pushtable, "main2");


    the Java adapter is :


    public class GroupStreamAdapter implements SmartDataProvider , EMSMessageListener{

    public ItemEventListener listener;
    private ConcurrentHashMap<String,SubscribedItemAttributes> subscribedItems = new ConcurrentHashMap<String,SubscribedItemAttributes> ();

    private ConcurrentHashMap<String,Object> handles = new ConcurrentHashMap<String,Object>();

    private volatile int nextHandleId =0;
    private static HashMap<String,String> inactiveMap = new HashMap<String,String>();

    private static HashMap<String,String> completeInactiveMap = new HashMap<String,String>();


    static {

    inactiveMap.put("item_status","inactive");
    completeInactiveMap.put("Symbol", "Test");
    completeInactiveMap.put("ABC", "+");
    completeInactiveMap.put("OfferVol","0");
    completeInactiveMap.put("OfferPrice", "0");
    completeInactiveMap.put("BidVolume", "0");

    completeInactiveMap.put("BidPrice", "0");
    completeInactiveMap.put("Volume", "0");
    completeInactiveMap.put("High", "0");
    completeInactiveMap.put("Low", "0");
    completeInactiveMap.put("LastPrice", "0");
    completeInactiveMap.put("Chg", "0");
    completeInactiveMap.put("%", "0");
    completeInactiveMap.put("Trades", "0");

    completeInactiveMap.put("OpenPrice", "0");
    completeInactiveMap.put("AvgPrice", "0");
    completeInactiveMap.put("High52Week", "0");
    completeInactiveMap.put("Low52Week", "0");
    completeInactiveMap.put("Value", "0");



    } // static


    public void subscribe(String itemName, Object itemHandle, boolean needsIterator)throws SubscriptionException, FailureException {

    System.out.println("GroupAdapter - subscribe(...) "+itemName);

    String uniqueId = String.valueOf(nextHandleId++);

    SubscribedItemAttributes itemAttrs = new SubscribedItemAttributes(itemName,uniqueId);

    rwLock.writeLock().lock();

    subscribedItems.put(itemName, itemAttrs);

    handles.put(uniqueId,itemHandle);

    listener.smartUpdate(handle,completeInactiveMap,fa lse);
    System.out.println("========"+completeInactiveMap) ;
    }

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    I can't find typos at first sight.
    I see that smartUpdate uses a "handle" argument which is not defined, but I suppose that your code snippet is just a compound.
    Does your Data Adapter send only one update for each item and does it return "true" from "isSnapshotAvailable"? (But I'm not sure that this could explain the behavior).
    To simplify the analysis, please get a detailed log from the Server, after setting the priorities for the "LightstreamerLogger.subscriptions" and "LightstreamerLogger.pump" categories as DEBUG in the Server log configuration file.

 

 

Similar Threads

  1. Replies: 7
    Last Post: December 13th, 2011, 05:08 PM
  2. Sync errors in server log
    By riwang in forum Client SDKs
    Replies: 29
    Last Post: June 28th, 2010, 12:56 PM
  3. Client Server Disconnection Notification
    By vaduganathan in forum Adapter SDKs
    Replies: 1
    Last Post: May 28th, 2010, 10:34 AM
  4. Lightstreamer Monitor Console
    By phan_lam in forum General
    Replies: 6
    Last Post: February 5th, 2010, 10:01 AM
  5. Monitor Console Adapter
    By JMolina in forum Adapter SDKs
    Replies: 1
    Last Post: October 5th, 2007, 10:03 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 11:48 PM.