Results 1 to 10 of 11

Hybrid View

  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,022
    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,022
    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,022
    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.

 

 

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 10:02 PM.