Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    invalid index -1 for ResultSet

    Hi everyone

    I am using SmartGwt 2.1 build 1116 and gwt 2.0.3

    I have two related ListGrids binded with RestDataSources. When there is no data in primary table or related table I get warning:
    Code:
    22:27:48.609 [ERROR] [strukt_springsmart2] 22:27:48.594:RDQ5:WARN:ResultSet:isc_ResultSet_1 (created by: Lista_rach):get: invalid index -1
    com.smartgwt.client.core.JsObject$SGWT_WARN: 22:27:48.594:RDQ5:WARN:ResultSet:isc_ResultSet_1 (created by: Lista_rach):get: invalid index -1
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
        at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
        at java.lang.Thread.run(Unknown Source)
    My question is: How response should look like when there is no data (or ralated records in another table) in table
    right now my server response look like this:

    Code:
    <response>
      <status>0</status>
      <startRow>0</startRow>
      <endRow>0</endRow>
      <totalRows>0</totalRows>
      <data />
    </response>
    but this couse error mantioned above

    #2
    Same issue

    I have go the same issue populating a grid from a GwtRpcDataSource. When the result size is 0 it throws up this warning.

    Anybody a idea how to fix this?

    Code:
    executeFetch=>onSuccess=>
    
      ListGridRecord[] list = new ListGridRecord[0];
      response.setData (list);
      processResponse (requestId, response);
    N.B. isc_OID_31 is the grid
    Code:
    06:54:45.037 [ERROR] [esos] 08:54:45.051:RDQ1:WARN:ResultSet:isc_ResultSet_1 (created by: isc_OID_31):get: invalid index -1
    com.smartgwt.client.core.JsObject$SGWT_WARN: 08:54:45.051:RDQ1:WARN:ResultSet:isc_ResultSet_1 (created by: isc_OID_31):get: invalid index -1
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
        at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
        at java.lang.Thread.run(Thread.java:595)
    Last edited by meindert; 8 Apr 2010, 23:01.

    Comment


      #3
      I have the same issue.

      If I set setGroupByField("agroup"), I don't get the exception However, when I don't set the groupby field, I gtt the same "get: invalid index -1" exception.

      In my case, I don't have a server. Instead, I have a clientonly data source with no data in it (a test case). I had been setting the datasource's data using an empty (zero length array) - eg setTestData(new Record[0]); I changed this to call setTestData(null) and get the same result.

      Comment


        #4
        Same thing happens to me, I am returning json from server. using the official 2.1 version.
        I really have no idea how to avoid this error....

        Comment


          #5
          same issue here...

          Comment


            #6
            Looks like this is just a WARNing that was added to the latest build -- it's pointless since the condition of 0 results can't be considered an error.

            Comment


              #7
              +1 on this. I've been seeing a lot more red in Eclipse lately after going to 2.1 :(

              Comment


                #8
                same issue here too.

                can we please get an answer from dev. group.

                Comment


                  #9
                  This warning can occur spuriously under some conditions and this problem is being corrected. However if your code directly accesses the RecordList or ResultSet and you see this warning, it may indicate a problem in your code where you are asking for index -1.

                  Comment


                    #10
                    I have the same issue. This warning raises even if I don't try to get any data from the ListGrid.

                    Comment


                      #11
                      This has been fixed in SVN. Pick up the next nightly build.

                      Sanjiv

                      Comment


                        #12
                        I've same issue with Smart GWT 2.2 !

                        Comment


                          #13
                          Same problem here. Any listgrid that displays 0 results (for instance, as a result of asking the server-side DAO for Criteria that guarantee no results will be returned) throws this error. It's irrelevant whether or not the ListGrid results are accessed - simply configuring a ListGrid with a datasource and ensuring that datasource returns no results generates this error.

                          That being said - I only see this problem in GWT DevMode - the error is not actually displayed to a user when running in, for instance, compiled mode.

                          Comment


                            #14
                            If you think you are getting this as a spurious warning in 2.2, please post a standalone test case and exact versions of all involved software (see the FAQ).

                            Comment


                              #15
                              i got this warning to

                              10:24:10.218 [ERROR] [] 10:24:10.225:WARN:ResultSet:isc_ResultSet_3 (created by: isc_PickListMenu_2):getRange(-1, 1): negative indices not supported, clamping start to 0

                              10:24:10.218 [ERROR] [] 10:24:10.238:WARN:ResultSet:isc_ResultSet_3 (created by: isc_PickListMenu_2):get: invalid index -1

                              Comment

                              Working...
                              X