Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Senior Member
    Join Date
    Jul 2009
    Location
    sofia
    Posts
    40

    Strange Error on item update

    Hi,

    i began to get this strange error:

    ER onItemUpdate exception
    this.LS_QfY.LS_WPo is undefined

    Where this seems to be property from my schema, but i do not have such in it(i can see what are the schema properties from the ls console).
    I am getting the exception from here :
    var msg = itemUpdate.getNewValue(schema[i]);
    It seems that schema[i] is undefined, but why?
    I noticed that this only happens when i change my schema and call restart :
    Code:
    private native void restart(JavaScriptObject nvt, NonVisualGWTClient thiz, JavaScriptObject page, JavaScriptObject map, String [] schema) /*-{
    																															nvt.setDataAdapter(map['adapter_name']);
    																															nvt.setSnapshotRequired(false);
    																															
    																															this.@com.trinitas.ls.client.NonVisualGWTClient::nvt.onItemUpdate = function(item, itemUpdate, itemName) {
    																																	for (i=0;i<=schema.length;i++) {
    																																				var msg = itemUpdate.getNewValue(schema[i]);
    																																				if (msg !=null) {
    																																					thiz.@com.trinitas.ls.client.NonVisualGWTClient::onMessage(Ljava/lang/String;Ljava/lang/String;)(msg, schema[i]);
    																																				}
    																																	}
    																															}
    																															
    																															page.addTable(nvt,"tnvt");
    																															}-*/;
    But right before i call restart i printed the schema and it is exactly as it should be. So where does this LS_QfY.LS_WPo come from?

    And one other thing: before now i used the following:


    Code:
    var msg=itemUpdate.getNewValue(schema[i]);																																			if(msg!=null){																																					    onMessage(Ljava/lang/String;Ljava/lang/String;)(msg, schema[i]);
    }
    Now i removed this if (msg != null) and i began to receive null messages, but i never send null message. Why is that?Why ls sends null Strings?

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    The error seems not related with your schema variable, but with library internal structures; therefore it looks like a bug.
    On the other hand, unexpected values on [I]schema could explain null values returned by getNewValue.

    Can you replicate the issue?
    In that case, may you please check schema[i] before invoking getNewValue and compare it with the outcome from getNewValue?
    Does replicating the issue involve any previous removal of the involved table object?

  3. #3
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    I see that I didn't refresh the forum thread page before answering and I didn't see your latest changes.
    Are you using a library for embedding the browser in a native application?
    In this case, we cannot ensure that our javascript library works properly.
    May you please provide us with more information on your scenario?

  4. #4
    Senior Member
    Join Date
    Jul 2009
    Location
    sofia
    Posts
    40
    Hi,

    well since last week every thing worked perfectly. I didn't do any thing connected with the ls code.
    I inject the js from ls in my GWT application and use native calls to it:
    I needed dynamically to subscribe/unsubscribe from items and dynamically to change the schema:
    Here is simple code:

    Code:
    	private native void restart(JavaScriptObject nvt, NonVisualGWTClient thiz, JavaScriptObject page, JavaScriptObject map, String [] schema) /*-{
    																															nvt.setDataAdapter(map['adapter_name']);
    																															nvt.setSnapshotRequired(false);
    																															
    																															this.@ls.client.NonVisualGWTClient::nvt.onItemUpdate = function(item, itemUpdate, itemName) {
    																																	for (i=0;i<=schema.length;i++) {
    																																	            
    																																				var msg = itemUpdate.getNewValue(schema[i]);
    																																				if (msg !=null) {
    																																					thiz.@ls.client.NonVisualGWTClient::onMessage(Ljava/lang/String;Ljava/lang/String;)(msg, schema[i]);
    																																				}																																				
    																																	}
    																															}
    																															
    																															page.addTable(nvt,"tnvt");
    																															}-*/;
    
    // abstract method 
    protected abstract void onMessage(String message, String schemaId);
    As you can see i have abstract onMessage method that is implemented in the derived class and implements the logic for the received message.
    When i want to change my schema or group i create new NVT and call restart.

    I am not sure i understand what you mean by "embeding the browser in a native application"
    I have web app that is compiled to js and i inject
    <script src="ls/lscommons.js"></script>
    <script src="ls/lspushpage.js"></script>
    It may bo compared to HTML + JS app.

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    Ok, sorry, I was misled by the wrong formatting of your code snippets (by the way, do you see them as expected?).

    I see that you iterate on schema from 0 to schema.length;
    the last call is redundant and may account for some null you see coming from getNewValue.
    Could it even account for the exception? Unfortunately, I couldn't manage to replicate that.

    So, for now, it seems that there is a bug in the library.
    We need all available information on the error context.
    • Does it happen immediately after you call restart?
    • If you issue removeTable("tnvt") before calling restart, does it still happen?
    • Could you test itemUpdate.LS_QfY.LS_WPo before calling itemUpdate.getNewValue and see if you can find it undefined before the exception is thrown?

  6. #6
    Senior Member
    Join Date
    Jul 2009
    Location
    sofia
    Posts
    40
    Hi,

    Sorry for my delay.
    No, the formating is bad, maybe it is my mistake...
    Thanks, i really missed this "=". I don't get this LS_QfY.LS_WPo is undefined now.
    But i am still receiving null messages from lightstreamer. And one other thing. I need to send command like messages to the client. For example: The server sends notification that the client must request (do) something. I use text format for the the command like messages (every command has unique id). But if i send one command two times only the first one is executed because i use MERGE type(i also stream market prices). So i changed it to RAW, in order to send all messages. But the result is the same. I can see from the ls console that every command message is received but not every one is sent to the client.

  7. #7
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    Please, send us the produced log for a check.
    Note that in order to trace the updates lifecycle, the LightstreamerLogger.subscriptions and LightstreamerLogger.pump logging categories should be configured as DEBUG.

    By the way, you can suppress filtering on an item subscribed to in MERGE mode by invoking setRequestedMaxFrequency("unfiltered");
    changing the subscription to RAW mode, on the other hand, involves a few other related changes (one of them could even lead to null field values).

  8. #8
    Senior Member
    Join Date
    Jul 2009
    Location
    sofia
    Posts
    40
    Hi,

    I am unable to send you the logs at the moment (i didn't configure the logging). But i log every message send from my app server to the lightstreamer server: Here is simple log:
    Code:
    17.Mar.10 16:57:39,595 < INFO> Received update for item asset5309
    17.Mar.10 16:57:39,596 < INFO> Received update for item asset5309
    17.Mar.10 16:57:39,599 < INFO> Received update for item userX435Isdjias234dh
    17.Mar.10 16:57:39,702 < INFO> Serving request: /lightstreamer/control.html?LS_session=Sc496e06f69e2a096T5213959&LS_window=8&LS_win_phase=4&LS_op=add&LS_req_phase=40&LS_mode1=RAW&LS_id1=ALLUSERS%20userX435Isdjias234dh%20asset5309&LS_schema1=STREAMPUSH%20USERUPDATES%20IGVOL_CURRENT_DAY%20IGVOL_FOLLOWIND_DAY%20MIX3&LS_data_adapter1=JMSADAPTER&LS_unique=14 from 192.168.2.105:32904
    17.Mar.10 16:57:39,702 < INFO> Controlling session: Sc496e06f69e2a096T5213959 from 192.168.2.105:32904
    17.Mar.10 16:57:39,708 < INFO> Serving request: /lightstreamer/control.html?LS_session=Sc496e06f69e2a096T5213959&LS_window=7&LS_win_phase=4&LS_req_phase=39&LS_op=delete&LS_unique=15 from 192.168.2.105:32904
    17.Mar.10 16:57:39,708 < INFO> Controlling session: Sc496e06f69e2a096T5213959 from 192.168.2.105:32904
    17.Mar.10 16:57:39,770 < INFO> Received update for item asset5309
    17.Mar.10 16:57:39,805 < INFO> Received update for item asset5309
    17.Mar.10 16:57:40,506 < INFO> Received update for item asset5309

    Notice that i have schema:
    STREAMPUSH%20USERUPDATES%20IGVOL_CURRENT_DAY%20IGV OL_FOLLOWIND_DAY%20MIX3

    items like asset + ID receive many messages per sec - market data.
    items like user + hash are separate users.
    Every thing is with one Adapter, and i dynamically change the schema and group and after every change i call the restart method above. Note: before every restart i create new NVT(but this does not matter).
    So items like asset + ID need to be in MERGE MODE, but items like user+ hash need to be in RAW mode, because if i send two times some command(for example UPDATE_FUNDS) ls will not send the second message because of MERGE mode.
    But as you can see i change the mode to RAW and my log shows that the ls received message for the user+hash but from the browser ui i can see that it is not received(no FUNDS_UPDATE) event it is RAW mode.

    I think it is not possible to use some mixed mode i.e. for some items MERGE and for other RAW? If not i can't afford to use MERGE + setRequestedMaxFrequency("unfiltered");

  9. #9
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    I'm not sure how the log should be interpreted.
    There is one event for the user+hash item, but it is just before the table restart, as evidenced by a subscription request followed by a deletion request for a different table (identified through the LS_window parameter).
    I suppose that the user+hash event is actually the trigger for the restart.

    Anyway, you are not bound in any way to using the same NonVisualTable object to request all your items together.
    By using different NonVisualTable instances, you can subscribe to each item in the proper way.

  10. #10
    Senior Member
    Join Date
    Jul 2009
    Location
    sofia
    Posts
    40
    The problem is that i wrote client api that relays only on on NVT.
    My log example was not accurate.

 

 

Similar Threads

  1. Replies: 1
    Last Post: April 17th, 2012, 10:19 AM
  2. Strange exception
    By Alex Zherdev in forum Client SDKs
    Replies: 1
    Last Post: December 1st, 2011, 10:33 AM
  3. Replies: 0
    Last Post: November 8th, 2011, 10:20 AM
  4. Replies: 2
    Last Post: December 24th, 2010, 08:51 AM
  5. Strange FireFox error
    By jameswolfe in forum Client SDKs
    Replies: 5
    Last Post: August 27th, 2007, 02:24 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 04:18 PM.