Announcement

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

    Issues with 7-27-2012 EE Build

    I pulled down the 7-12-2012 EE Build (SmartClient Version: SNAPSHOT_v8.3d_2012-07-27/Enterprise Deployment (built 2012-07-27)) and I'm getting an error that wasn't present with previous builds when running compiled out to JBoss when trying to access a datasource.

    Code:
    	Error: (TypeError): _9 is null stack: isc_JSONEncoder__serializeObject([object Object],
    ".configuration.aircraftArm.aircraftRegistrationNum.configurationId.configurationName.createDate.createUserId.customerId.envelopes[0].configuration",
    [object Object]," ")@http://localhost:8080/fpo/fpo/sc/modules/ISC_Core.js:4321 isc_JSONEncoder__serialize([object Object]," ",".configuration.aircraftArm.aircraftRegistrationNum.configurationId.configurationName.createDate.createUserId.customerId.e
    I proceeded to try and debug this in hosted mode, and I can't get the application to load now. I get this stack trace during app start up:

    Code:
    com.google.gwt.core.client.JavaScriptException: (TypeError): $wnd.isc.DataSource.reregisterSgwtDS is not a function
    	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.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:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	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:680)
    I made sure to run a clean build, blasting my target and bin directories.

    Any ideas?

    Thanks,
    Chris

    #2
    You're running the new .java code with the old JavaScript. Could be that your browser cache needs cleaning, the GWT unitcache needs clearing, or that you're manually copying .js resources for whatever reason and need to redo that.

    Comment


      #3
      After booting my machine after being off this weekend, and rebuilding, the issue getting hosted mode to start went away.

      I'm now able to track down where I'm getting the (TypeError): _9 is null JavaScritptException. It is coming from JSON.encode() statements:

      Code:
      System.out.println("loadPlan: "
      	+ JSON.encode(loadPlan.getJsObj()));
      And here is the resulting stack trace.

      Code:
      com.google.gwt.core.client.JavaScriptException: (TypeError): _9 is 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.google.gwt.core.client.impl.Impl.apply(Impl.java)
      	at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
      	at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	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)
      I have found a couple other places in the application where it is calling JSON.encode() and failing as well. I have commented these out for now, as they were there for development/debugging purposes.

      Comment


        #4
        Thanks for letting us know.

        We've taken a look at this.
        The basic API does work as demonstrated in this test case:
        Code:
        import com.google.gwt.core.client.EntryPoint;
        import com.google.gwt.core.client.JavaScriptObject;
        import com.smartgwt.client.util.JSON;
        import com.smartgwt.client.widgets.grid.ListGridRecord;
        
        public class JSONEncodeTest implements EntryPoint {
        
            @Override
            public void onModuleLoad() {
                
                ListGridRecord loadPlan = new ListGridRecord(getRecordJsObj());
                
                System.out.println("loadPlan: "
                        + JSON.encode(loadPlan.getJsObj()));        
            }
            public native JavaScriptObject getRecordJsObj() /*-{
                var recordObj = {
                    field1:"value 1",
                    field2:{nestedField1:true, nestedField2:1.333}
                };
                
                return recordObj;
        
            }-*/;
        
        }
        However, we have found one case where JSON.encode() can fail - to do with dealing with JavaScript Date values created within Java application code (for example via JSNI as in the above example code).

        We're working on that case and looking into whether there are other issues likely to come up here.
        However the best way to make sure we fix the specific issues you've encountered would be to see some test code that reproduces the bugs. We basically will need to see the object being passed to JSON.encode (and how it is created), and the easiest way for us to do that would be to have code we can drop in and run on our end.

        Thanks and Regards

        Isomorphic Software

        Comment


          #5
          I can't give you code containing the exact data structures we are employing, as they are proprietary, but I'll see if I can sanitize something and get it to you.

          Kind Regards,
          Chris

          Comment


            #6
            I'm afraid this is going to be a large time sink to create a test case for this. I do have several date fields in my objects. Maybe it would make more sense to try a build with the date issue fixed and see if the problem continues?

            Kind Regards,
            Chris

            Comment


              #7
              Can you give us an idea of where the data (the actual JavaScript) is coming from. The scope in which it is created would be responsible for this specific date bug, so would be important to know.

              In short:
              - Are we talking records from a dataSource or something else?
              - Are the records being retrieved via any of the standard DataSource models (SQLDataSource / RestDataSource etc)? Or via a custom dataSource?
              - If a custom dataSource, how are the records being created (Created in Java code and then accessed via the 'getJsObj()' method? Created via JSNI? parsed from JSON or XML using custom tools? Something else?)

              Also any information about the data structure that causes these crashes would be helpful - basically an idea of the attribute --> value types we're looking at (which will indicate whether we're looking at JavaScript Dates, Arrays, nested objects, etc and whether there are references to Java types or not)

              Thanks

              Comment


                #8
                This is a record that was retrieved via fetch on a custom datasource implemented with DMI. The record in this case was a java object, which has several fields, including a List, and two Sets. The objects in these Lists and Sets in turn contain additional Lists of objects. The objects have Long, String, Date, double types in them.

                This was working fine in EE 3.0.

                Comment


                  #9
                  We've made a couple of changes to the framework (3.1d branch) which we are confident will take care of this.
                  Please try the next nightly build (Dated Aug 3 or greater).
                  If the issues do persist it is likely we'll need to see a standalone test case, but it's very likely we've taken care of the problem.

                  Regards
                  Isomorphic Software

                  Comment

                  Working...
                  X