Announcement

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

    I cant't get data from dataSource (Javascript error)

    Hello!

    I've updated my version of smartGWT because i want to get the latest version of Timeline object but now i get the following error:
    Code:
    [ERROR] [ns] - 00:37:43.407:TMR7:WARN:Log:TypeError: _7 is null
    Stack from error.stack:
        DataSource._handleClientOnlyReply/_6() @ ns/sc/modules/ISC_DataBinding.js:501
        DataSource._handleClientOnlyReply() @ ns/sc/modules/ISC_DataBinding.js:502
        [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:238
        [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:296
        anonymous() @ ns/sc/modules/ISC_DataBinding.js:1229
        $wnd.isc.RPCManager.fireReplyCallback() @ :247
        [c]RPCManager.fireReplyCallbacks() @ ns/sc/modules/ISC_DataBinding.js:1230
        [c]RPCManager.performOperationReply() @ ns/sc/modules/ISC_DataBinding.js:1229
        RPCManager._performTransactionReply() @ ns/sc/modules/ISC_DataBinding.js:1225
        [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:238
        Timer._fireTimeout() @ ns/sc/modules/ISC_Core.js:966
        unnamed() @ ns/sc/modules/ISC_Core.js:962
        unnamed() @
    This is the stack trace:

    Code:
    00:37:43.530 [ERROR] [ns] 00:37:43.407:TMR7:WARN:Log:TypeError: _7 is null
    Stack from error.stack:
        DataSource._handleClientOnlyReply/_6() @ ns/sc/modules/ISC_DataBinding.js:501
        DataSource._handleClientOnlyReply() @ ns/sc/modules/ISC_DataBinding.js:502
        [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:238
        [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:296
        anonymous() @ ns/sc/modules/ISC_DataBinding.js:1229
        $wnd.isc.RPCManager.fireReplyCallback() @ :247
        [c]RPCManager.fireReplyCallbacks() @ ns/sc/modules/ISC_DataBinding.js:1230
        [c]RPCManager.performOperationReply() @ ns/sc/modules/ISC_DataBinding.js:1229
        RPCManager._performTransactionReply() @ ns/sc/modules/ISC_DataBinding.js:1225
        [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:238
        Timer._fireTimeout() @ ns/sc/modules/ISC_Core.js:966
        unnamed() @ ns/sc/modules/ISC_Core.js:962
        unnamed() @ 
    com.smartgwt.client.core.JsObject$SGWT_WARN: 00:37:43.407:TMR7:WARN:Log:TypeError: _7 is null
    Stack from error.stack:
        DataSource._handleClientOnlyReply/_6() @ ns/sc/modules/ISC_DataBinding.js:501
        DataSource._handleClientOnlyReply() @ ns/sc/modules/ISC_DataBinding.js:502
        [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:238
        [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:296
        anonymous() @ ns/sc/modules/ISC_DataBinding.js:1229
        $wnd.isc.RPCManager.fireReplyCallback() @ :247
        [c]RPCManager.fireReplyCallbacks() @ ns/sc/modules/ISC_DataBinding.js:1230
        [c]RPCManager.performOperationReply() @ ns/sc/modules/ISC_DataBinding.js:1229
        RPCManager._performTransactionReply() @ ns/sc/modules/ISC_DataBinding.js:1225
        [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:238
        Timer._fireTimeout() @ ns/sc/modules/ISC_Core.js:966
        unnamed() @ ns/sc/modules/ISC_Core.js:962
        unnamed() @ 
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        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:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
        at java.lang.Thread.run(Thread.java:722)

    I think this occurs when i want to get records from detasource while setAllCacheData is true. The first time gets all data from the server correctly. The second time the fecht occurs in the client side and it doesn't return anything. I tested with several versions of April until the 2013-04-24 version and all fails. But the version 2013-01-27 works fine.

    Here is a simple testCase:

    Code:
    public void onModuleLoad() {
    		// Consola de desarrollo SmartGWT
    		SC.showConsole();
    		SC.disableFirebug();
    		setWidth100();
    		setHeight100();
    		
    		UsuarioDS usuarioDS = UsuarioDS.getInstance();
    		usuarioDS.setCacheAllData(true);
    		
    		SelectItem usuarioItem = new SelectItem();
    		usuarioItem.setOptionDataSource(usuarioDS);
    		usuarioItem.setAutoFetchData(true);
    		usuarioItem.setValueField("nombreUsuario");
    		usuarioItem.setDisplayField("nombreUsuario");	
    		
    		DynamicForm dynamicForm = new DynamicForm();
    		dynamicForm.setWidth100();
    		dynamicForm.setHeight100();
    		dynamicForm.setItems(usuarioItem);
    	
    		addMember(dynamicForm);
    		
    		show();
    DataSource class with Jersey RestFull and Json

    Code:
    public class UsuarioDS extends JSONRestDataSource {
    	// Locale
    	private UsuarioConstants locale = GWT.create(UsuarioConstants.class);
    	private static UsuarioDS instance = null;
    
    	public static UsuarioDS getInstance() {
    		if (instance == null) {
    			instance = new UsuarioDS("usuarioDS");
    		}
    		return instance;
    	}
    
    	public UsuarioDS(String idDataSource) {
    		super();
    
    		// Establecer Id del DataSource
    		setID(idDataSource);
    		// Operaciones CRUD del REST
    		setFetchDataURL("rest/usuario/fetch");
    
    		setCacheAllData(true);
    		// ID
    		DataSourceIntegerField id = new DataSourceIntegerField("id", locale.id());
    		id.setPrimaryKey(true);
    		// NombreUsuario
    		DataSourceTextField nombreUsuario = new DataSourceTextField
    				("nombreUsuario", locale.nombreUsuario());
    
    		// Asignar campos al Data Source
    		setFields(id, nombreUsuario);
    	}
    
    }
    - SmartClient Version: SNAPSHOT_v9.0d_2013-04-01/LGPL Development Only (built 2013-04-01)

    Browser: Firefox 20.0 for Ubuntu

    Here are some pictures attached from smartGWT console. The Consola1.jpg is the fetch for ther server and gets results. The consola2.jpg is the fetch client Only and doesnĄt return anythin.

    Can anyone help me, please?
    Attached Files

    #2
    Can you make this a runnable test by adding the data that the server returns for fetch? Then we can take a look.

    It can be a subset or sanitized version of your real data, but if it is, please make sure the problem is still reproducible.

    Comment


      #3
      runnable test

      Thanks for your quickly reply.

      Here are a complete test with data.

      - SmartClient Version: SNAPSHOT_v9.0d_2013-04-24/LGPL Development Only (built 2013-04-24)

      - Browser : firefox 20.0 for Ubuntu
      Attached Files

      Comment


        #4
        We've made a change to address this - please retest with a nightly build dated April 28 or later - in the meantime, you can just remove the call to setCacheAllData()

        Comment


          #5
          Ok, thanks.

          Ok thanks. i'll wait the 28 of april nightly version.

          Comment


            #6
            The problen is not resolved

            Hello,

            I tested with de version nigthly 2013-05-05 and the bug persists. Sometimes, a need operate on a client only, so i can not remove the call to setCacheAllData().

            thanks.

            Comment


              #7
              Please, are you sure the problem is resolved? Just i run the test case and this is the error

              Browser: Firefox for ubuntu
              SmartClient Version: SNAPSHOT_v9.0d_2013-05-10/LGPL

              Code:
              20:37:34.798 [ERROR] [ns] Uncaught exception escaped
              com.google.gwt.core.client.JavaScriptException: (null): null
                  at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
                  at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
                  at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
                  at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
                  at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
                  at com.smartgwt.client.data.DataSource.getClientOnlyResponse(DataSource.java)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:601)
                  at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
                  at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
                  at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
                  at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
                  at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
                  at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
                  at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
                  at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
                  at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
                  at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
                  at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:601)
                  at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
                  at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
                  at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
                  at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
                  at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
                  at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
                  at java.lang.Thread.run(Thread.java:722)
              Code:
               [ERROR] [ns] - 20:37:34.815:TMR0:WARN:Log:TypeError: newData is undefined
              Stack from error.stack:
                  isc.A.fetchRemoteDataReply() @ ns/sc/modules/ISC_DataBinding.js:1327
                  [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:242
                  [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:300
                  DataSource.fireResponseCallbacks() @ ns/sc/modules/ISC_DataBinding.js:640
                  DataSource._completeResponseProcessing() @ ns/sc/modules/ISC_DataBinding.js:638
                  DataSource._handleClientOnlyReply/_6() @ ns/sc/modules/ISC_DataBinding.js:501
                  DataSource._handleClientOnlyReply() @ ns/sc/modules/ISC_DataBinding.js:502
                  [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:242
                  [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:300
                  anonymous() @ ns/sc/modules/ISC_DataBinding.js:1242
                  $wnd.isc.RPCManager.fireReplyCallback() @ :249
                  [c]RPCManager.fireReplyCallbacks() @ ns/sc/modules/ISC_DataBinding.js:1243
                  [c]RPCManager.performOperationReply() @ ns/sc/modules/ISC_DataBinding.js:1242
                  RPCManager._performTransactionReply() @ ns/sc/modules/ISC_DataBinding.js:1233
                  [c]Class.fireCallback() @ ns/sc/modules/ISC_Core.js:242
                  Timer._fireTimeout() @ ns/sc/modules/ISC_Core.js:978
                  unnamed() @ ns/sc/modules/ISC_Core.js:974
                  unnamed() @

              Comment


                #8
                This is a different bug - we'll take a look

                Comment


                  #9
                  This should now be fixed, please try the next nightly build.

                  Comment

                  Working...
                  X