Announcement

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

    removeMembers() throws ClassCastException

    I've just downloaded the lastest nightly build of the Enterprise Edition 2012-07-24.

    SmartClient Version: SNAPSHOT_v8.3d_2012-07-24/Enterprise Deployment (built 2012-07-24)

    My code is now throwing ClassCastExceptions when I attempt to call removeMembers() like so:

    Code:
    imageLayout.removeMembers(imageLayout.getMembers());
    We do this in several places in our code, and they all now break. It was working fine in Enterprise Edition 3.0. Here is a stack trace from when it occurs:

    Code:
    java.lang.ClassCastException
    	at java.lang.Class.cast(Class.java:2990)
    	at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:169)
    	at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:57)
    	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.invokeNativeVoid(ModuleSpace.java:289)
    	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    	at com.smartgwt.client.widgets.layout.Layout.removeMembers(Layout.java)
    	at com.jeppesen.smartgwt.common.client.component.breadcrumb.BreadCrumbSet.clear(BreadCrumbSet.java:427)
    	at com.jeppesen.fpo.client.MainPageCrumbs$22.execute(MainPageCrumbs.java:938)
    	at com.jeppesen.smartgwt.common.client.component.breadcrumb.BreadCrumbSet.canClose(BreadCrumbSet.java:270)
    	at com.jeppesen.fpo.client.MainPageCrumbs.closeScreenCaptureBreadCrumbSet(MainPageCrumbs.java:928)
    	at com.jeppesen.fpo.client.MainPageCrumbs.access$27(MainPageCrumbs.java:925)
    	at com.jeppesen.fpo.client.MainPageCrumbs$21.onSuccess(MainPageCrumbs.java:914)
    	at com.jeppesen.fpo.client.MainPageCrumbs$21.onSuccess(MainPageCrumbs.java:1)
    	at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
    	at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
    	at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
    	at sun.reflect.GeneratedMethodAccessor41.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.google.gwt.core.client.impl.Impl.apply(Impl.java)
    	at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
    	at sun.reflect.GeneratedMethodAccessor40.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)
    Any ideas what maybe causing the issue?

    Thanks,
    Chris

    #2
    We can't see anything that has changed in this area and it looks like it might be some kind of spurious error.

    We would recommend clearing GWT's UnitCache then running a GWT compile, and also seeing if it happens in compiled mode or just hosted. If you're using a beta version of GWT revert to a release version.

    Finally, if the error persists, please give us some more information about how to reproduce it - what types of components are in the layout, is it drawn, other basics like that.

    Comment


      #3
      The error occurs in both hosted mode and compiled. I'm trying this with the 7/24 EE nightly build as I'm working on testing some PDF generation work we sponsored you for, so rolling back to the previous version isn't going to be helpful.

      I did wipe out the GWT unit cache and rebuilt to no effect. I set a break point, and I can see that the getMembers() call returns this:
      Code:
      [HLayout{ID: "isc_HLayout_101",
      height: 65,
      membersMargin: 1,
      backgroundColor: "#666666",
      width: 1285,
      members: Array[4],
      position: "absolute",
      className: "normal",
      vertical: false,
      children: Array[4],
      }, HLayout{ID: "isc_HLayout_102",
      height: 65,
      membersMargin: 1,
      backgroundColor: "#666666",
      width: 1285,
      members: Array[4],
      position: "absolute",
      className: "normal",
      vertical: false,
      children: Array[4],
      }, HLayout{ID: "isc_HLayout_103",
      height: 65,
      membersMargin: 1,
      backgroundColor: "#666666",
      width: 1285,
      members: Array[4],
      position: "absolute",
      className: "normal",
      vertical: false,
      children: Array[4],
      }]
      I have been able to temporarily get around the problem by iterating the list of members and deleting them individually:
      Code:
      		for (Canvas layout : legendLayout.getMembers())  {
      			legendLayout.removeMember(layout);
      		}
      While this isn't preferable, it does keep me moving forward.

      Comment


        #4
        We believe we've just fixed this one - looks like you have a different approach but if you can take a moment to confirm the fix that would be great.

        Comment


          #5
          Will do. I'm crunching on deliverables for the end of our sprint tomorrow, so it will be early next week before I can try it again. I'll let you know when I do.

          Thanks!

          Comment


            #6
            I pulled down the 7/27/2012 build and the removeMembers() call appears to be fixed. Thank you.

            However, I'm not getting other errors. I'll start a new thread for those.

            Comment

            Working...
            X