Announcement

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

    Something other than an int was returned from JSNI method

    SmartClient Version: SC_SNAPSHOT-2011-08-02/PowerEdition Deployment (built 2011-08-02)

    I've added a showIfCondition to a DetailViewerField and I'm getting this exception, before the DetailViewerFieldIfFunction is called.

    Code:
    15:12:08.319 [ERROR] [ipgui] Uncaught exception escaped
    com.google.gwt.dev.shell.HostedModeException: Something other than an int was returned from JSNI method '@com.smartgwt.client.util.JSOHelper::getJavaScriptObjectArraySize(Lcom/google/gwt/core/client/JavaScriptObject;)': JS value of type undefined, expected int
        at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266)
        at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt(ModuleSpace.java:247)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:75)
        at com.smartgwt.client.util.JSOHelper.getJavaScriptObjectArraySize(JSOHelper.java)
        at com.smartgwt.client.util.JSOHelper.toArray(JSOHelper.java:85)
        at com.smartgwt.client.widgets.viewer.DetailViewerField.convertToDetailViewerRecordArray(DetailViewerField.java:582)
        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.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.GeneratedMethodAccessor107.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.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.smartgwt.client.widgets.viewer.DetailViewer.create(DetailViewer.java)
        at com.smartgwt.client.widgets.BaseWidget.getOrCreateJsObj(BaseWidget.java:361)
        at com.smartgwt.client.widgets.tab.Tab.setPane(Tab.java:603)
        at com.islandpacific.gui.client.OrderForm.getOrderCanvas(OrderForm.java:361)
        at com.islandpacific.gui.client.OrderForm.showOrder(OrderForm.java:179)
        at com.islandpacific.gui.client.OrderForm.access$5(OrderForm.java:162)
        at com.islandpacific.gui.client.OrderForm$17.onRecordDoubleClick(OrderForm.java:564)
        at com.smartgwt.client.widgets.tile.events.RecordDoubleClickEvent.dispatch(RecordDoubleClickEvent.java:98)
        at com.smartgwt.client.widgets.tile.events.RecordDoubleClickEvent.dispatch(RecordDoubleClickEvent.java:1)
        at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
        at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
        at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
        at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
        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: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.GeneratedMethodAccessor107.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)
        at java.lang.Thread.run(Thread.java:680)

    #2
    We can make a change to avoid this crash, but it would be helpful to know exactly how the code is getting into this bad state.
    Can you show us some code to reproduce this issue?

    Comment


      #3
      All I did was add a showIfCondition to an field that was already showing in the DetailViewer without a problem. In the DetailViewerFieldIfFunction I check another field to see if it is empty.

      return records[0].getAttribute("otherField").isEmpty()

      Running it in debug I got the js error before my DetailViewerFieldIfFunction was invoked.

      I've since removed the showIfCondition to avoid the error which is OK for me in this case. If I have time to try it again I'll see if I can create a standalone test case.

      Comment


        #4
        We've added a fix for the Exception to the mainline (3.0) codebase, which will show up in nightly builds going forward.
        However just to reiterate - the fact that you were hitting this probably implies another issue upstream, so while you won't see the same exception, you could potentially see other problems with your app.

        It sounds like you've modified your app and are no longer using the approach that caused the issue, but if you do decide to go down this path again and encounter any problems, let us know (and try to show us a standalone sample) and we'll take a look

        Comment


          #5
          Something other than an int was returned from JSNI method

          Originally posted by Isomorphic View Post
          We've added a fix for the Exception to the mainline (3.0) codebase, which will show up in nightly builds going forward.
          However just to reiterate - the fact that you were hitting this probably implies another issue upstream, so while you won't see the same exception, you could potentially see other problems with your app.

          It sounds like you've modified your app and are no longer using the approach that caused the issue, but if you do decide to go down this path again and encounter any problems, let us know (and try to show us a standalone sample) and we'll take a look
          SmartGWT version: 2.5
          GWT Version: 2.3.0

          While using the DetailViewerField.showIfCondition function I am receiving same exception which most probably because of the same reason that has been fixed in 3.0 but I can not upgrade to 3.0 right now. Can you tell me the file and fix so that I can update the smartgwt code base locally.

          Thanks,

          StackTrace:

          com.google.gwt.dev.shell.HostedModeException: Something other than an int was returned from JSNI method '@com.smartgwt.client.util.JSOHelper::getJavaScriptObjectArraySize(Lcom/google/gwt/core/client/JavaScriptObject;)': JS value of type undefined, expected int
          at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266)
          at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt(ModuleSpace.java:247)
          at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:75)
          at com.smartgwt.client.util.JSOHelper.getJavaScriptObjectArraySize(JSOHelper.java)
          at com.smartgwt.client.util.JSOHelper.toArray(JSOHelper.java:85)
          at com.smartgwt.client.widgets.viewer.DetailViewerField.convertToDetailViewerRecordArray(DetailViewerField.java:582)
          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)

          Comment


            #6
            We can't really provide you with a local-patch to apply to your existing build for this. We would need to provide a new patched 2.5 build for you.
            2.5 is no longer generally supported, so this would be something of a one-off fix. We don't intend to offer any additional 2.5 fixes, so for future patches etc, you'll want to move to 3.1 or 4.0.
            Bearing this in mind you might want to consider moving to a current release now - but if this is not possible let us know and we'll get a new version of 2.5 with this change out to you.

            Regards
            Isomorphic Software

            Comment

            Working...
            X