Announcement

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

    ClassCastException on call to DSRequest.getSortBy() in custom DataSource

    I'm using a recent snapshot build of SmartGWT. When I try to call getSortBy() on the DSRequest object passed in to my GWT-RPC (i.e. ClientCustom) DataSource's transformRequest() method, I get the following ClassCastException:

    [ERROR] (MessageCenterView.java:213) 2010-11-15 14:06:38,810 [FATAL] Message{conciseMessage='Failure in datasource [FETCH]', detailedMessage='java.lang.ClassCastException:java.lang.String cannot be cast to com.google.gwt.core.client.JavaScriptObject', fired=Mon Nov 15 14:06:38 EST 2010, severity=Fatal, options=[]}
    [ERROR] Failure in datasource [FETCH]
    [ERROR] java.lang.ClassCastException: java.lang.String cannot be cast to com.google.gwt.core.client.JavaScriptObject
    [ERROR] at com.smartgwt.client.util.JSOHelper.getValueFromJavaScriptObjectArray(JSOHelper.java)
    [ERROR] at com.smartgwt.client.util.JSOHelper.toArray(JSOHelper.java:88)
    [ERROR] at com.smartgwt.client.data.SortSpecifier.convertToArray(SortSpecifier.java:100)
    [ERROR] at sun.reflect.GeneratedMethodAccessor1052.invoke(Unknown Source)
    [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
    [ERROR] at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    [ERROR] at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    [ERROR] at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    [ERROR] at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1714)
    [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
    [ERROR] at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
    [ERROR] at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
    [ERROR] at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
    [ERROR] at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    [ERROR] at com.smartgwt.client.data.DSRequest.getSortBy(DSRequest.java)
    [ERROR] at org.rhq.enterprise.gui.coregui.client.util.RPCDataSource.initializeSorting(RPCDataSource.java:164)
    [ERROR] at org.rhq.enterprise.gui.coregui.client.util.RPCDataSource.getPageControl(RPCDataSource.java:158)
    [ERROR] at org.rhq.enterprise.gui.coregui.client.admin.users.UsersDataSource.getFetchCriteria(UsersDataSource.java:319)
    [ERROR] at org.rhq.enterprise.gui.coregui.client.admin.users.UsersDataSource.executeFetch(UsersDataSource.java:149)
    [ERROR] at org.rhq.enterprise.gui.coregui.client.util.RPCDataSource.transformRequest(RPCDataSource.java:101)
    [ERROR] at sun.reflect.GeneratedMethodAccessor1048.invoke(Unknown Source)
    [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
    [ERROR] at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    [ERROR] at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    [ERROR] at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    [ERROR] at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1714)
    [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
    [ERROR] at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
    [ERROR] at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
    [ERROR] at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
    [ERROR] at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    [ERROR] at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    [ERROR] at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
    [ERROR] at sun.reflect.GeneratedMethodAccessor1001.invoke(Unknown Source)
    [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
    [ERROR] at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    [ERROR] at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    [ERROR] at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    [ERROR] at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1669)
    [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
    [ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
    [ERROR] at java.lang.Thread.run(Thread.java:619)



    Note:

    String sortBy = request.getAttribute("sortBy");

    works fine.

    but:

    SortSpecifier[] sortSpecifiers = request.getSortBy();

    causes the above exception.

    #2
    This was fixed only a few days ago. Pick up the latest nightly.

    Comment

    Working...
    X