Announcement

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

    com.google.gwt.core.client.JavaScriptException: (null): null on DS.addData

    Hi All --

    I am using datasource.addData for the first time (see code below), but am getting an uncaught exception for some reason. I have seen some posts about similar exceptions elsewhere, but nothing on this specific issue that I can find.

    The line that causes the exception is this one:

    poTermsDS.addData(newCondition, new DSCallback() { ...

    Can anyone help/advise?

    Thanks.

    IButton saveButton = new IButton("Save");
    saveButton.addClickHandler(new ClickHandler() {
    public void onClick(ClickEvent event) {
    DSRequest req = new DSRequest();
    req.setParams(getExtras());
    poHeaderValuesManager.saveData(new DSCallback() {
    @Override
    public void execute(DSResponse response,
    Object rawData, DSRequest request) {
    if (response.getStatus()==DSResponse.STATUS_SUCCESS)
    poHeaderEditWindow.hide();
    }
    }, req);

    for (ListGridRecord termRecord : getConditionsGrid().getSelection()) {

    Record newCondition = new Record();

    newCondition.setAttribute("PFGP", fileGroupSelect.getValue());
    newCondition.setAttribute("PONO", poHeaderValuesManager.getValues().get("HONO"));
    newCondition.setAttribute("termID", termRecord.getAttribute("id"));
    if (termRecord.getAttribute("Value") != null)
    newCondition.setAttribute("Value", termRecord.getAttribute("Value"));

    DSRequest userUIRequest = new DSRequest();


    poTermsDS.addData(newCondition, new DSCallback() {
    @Override
    public void execute(DSResponse response, Object rawData,
    DSRequest request) {
    if (response.getStatus() != RPCResponse.STATUS_SUCCESS) {
    SC.warn("Error saving PO.");
    return;
    }
    }
    }, userUIRequest);

    }

    }
    });





    14:12:40.469 [ERROR] [ipgui] Uncaught exception escaped
    com.google.gwt.core.client.JavaScriptException: (null): null
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:284)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at com.smartgwt.client.data.DataSource.addData(DataSource.java)
    at com.islandpacific.gui.client.PoHeaderCanvas$10.onClick(PoHeaderCanvas.java:374)
    at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:96)
    at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:1)
    at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(HandlerManager.java:65)
    at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(HandlerManager.java:53)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:178)
    at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:67)
    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:157)
    at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
    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:188)
    at sun.reflect.GeneratedMethodAccessor244.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: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:637)

    #2
    See the FAQ (or the text right next to where you enter your post) - you should be able to get a JavaScript stack trace for this which will much more clearly point to the problem.

    Comment


      #3
      Where exactly in the Developer Console can I find this stack trace? What tab/option, etc?

      Comment


        #4
        The first tab (Results). Extensive information on this is available in the FAQ, again also linked from just to the right of where you type in your post (the link text is "stack trace").

        Comment


          #5
          Thanks for the guidance. There is not really a stack trace there from what I see (hence my earlier confusion). I set the logging level down to debug to get anything, and this is what appears:


          16:41:07.077:MUP2:DEBUG:EventHandler:Event 'mouseUp' bubbled to top
          16:41:07.156:MUP2:INFO:cacheAllData:IPPOCON:fetchingClientOnlyData: useTestDataFetch is false
          16:41:07.158:MUP2:DEBUG:DataSource:IPPOCON:Outbound DSRequest: {operationType: "add",
          dataSource: "IPPOCON",
          data: Obj,
          callback: anonymous(),
          requestId: "IPPOCON$62776",
          bypassCache: true,
          showPrompt: true}
          16:41:13.399:BLR3:DEBUG:nativeFocus:onblur fired on: [IButton ID:isc_IButton_20]
          16:41:13.400:BLR3:DEBUG:visualState:isc_IButton_20:state changed to: stretchImgButton
          16:41:13.400:BLR3:INFO:IButton:isc_IButton_20:call to deprecated setClassName() property - use setStyleName() instead

          I still see an exception in the Development Mode tab in Eclipse. Same as before:

          16:49:45.172 [ERROR] [ipgui] Uncaught exception escaped
          com.google.gwt.core.client.JavaScriptException: (null): null
          at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195)
          at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:284)
          at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
          at com.smartgwt.client.data.DataSource.addData(DataSource.java)
          at com.islandpacific.gui.client.PoHeaderCanvas$10.onClick(PoHeaderCanvas.java:377)
          at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:96)
          at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:1)
          at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(HandlerManager.java:65)
          at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(HandlerManager.java:53)
          at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:178)
          at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:67)
          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:157)
          at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
          at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
          at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
          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:188)
          at sun.reflect.GeneratedMethodAccessor592.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: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:637)

          Comment


            #6
            I started getting the same exception in another part of our application, so on a lark I switched from Firefox to Safari to see if the see if the same thing happened, and was surprise when it did not. Could this kind of javacript exception be browser specific?

            Comment


              #7
              Not really, but overall your results aren't making much sense.

              The FAQ tells you to use Internet Explorer to get stack traces. Did you do that?

              Comment


                #8
                I run everything on Mac normally, so it took a bit to get everything set up for use with Internet Explorer. IE 7, BTW, produced a stack space overflow at line 0 right from the get go. But after upgrading to IE 8, I was able to get the app loaded, but like with Safari, the error did not occur.

                The good news is that problem seems to have been fixed now by a fresh GWT compile. I can now run the app as before with no Javascript/null errors in Firefox.

                Thanks for the follow up on my earlier posts.

                Comment


                  #9
                  OK, so I was getting this in Firefox in hosted mode and it turned out that a widget was set to have width100 but there was not enough room on the screen to render the widget (my browser was not maximized).

                  I think this resulted in a negative width being set and this ambiguous Javascript exception was thrown as a result. Maximizing the browser alleviated the issue, you might want to try setting a width to begin with and using resize handlers to render your widget properly.

                  Comment


                    #10
                    clear firefox cache

                    Comment

                    Working...
                    X