Hi Kirill,
Am Mittwoch, 14. Dezember 2016 17:53:03 UTC+1 schrieb Kirill Prazdnikov:
-- Yes, I know, but I think it a bit strange that this only happens on direct accessing the model and not when I assign the value to a variable and use String.valueOf on this.
GXT uses internally their FastMap, a HashMap that is based on JSNI if running on the client. This seems to be the problem.
BTW, I switched to GWT 2.7.0 and the problem disappears. So there's something in GWT 2.8.0 that triggers the problem.
Thanks anyway
Norbert
Am Mittwoch, 14. Dezember 2016 17:53:03 UTC+1 schrieb Kirill Prazdnikov:
HiIt seems here you are trying to cast a native js object to java type.Sometimes GWT generates ClassCastException when I cast type "@JsType(isNative=true) A" to type B which is also native type. This is also kind of magic for me and I also have a strange workaround: write a native method that does the cast by "return arg".I wrote about that earlier:-Kirill
среда, 14 декабря 2016 г., 19:29:39 UTC+3 пользователь Norbert Bartels написал:Hi all,
I'm migrating our GWT app to GWT 2.8 as a PoC because we like to use the SDM.
While testing the SDM I see some strange
ClassCastExceptions
in the console.We use gxt 2 and changed some things to make it work with GWT > 2.5.1.
Here's the error message (stacktrace) of the the class cast exception:
java.lang.ClassCastException at Unknown.java_lang_Throwable_
Throwable__V(Unknown Source) at Unknown.java_lang_Exception_ Exception__V(Unknown Source) at Unknown.java_lang_ RuntimeException_ RuntimeException__V(Unknown Source) at Unknown.java_lang_ ClassCastException_ ClassCastException__V(Unknown Source) at Unknown.javaemul_internal_ InternalPreconditions_ checkCriticalType__ZV(Unknown Source) at Unknown.javaemul_internal_ InternalPreconditions_ checkType__ZV(Unknown Source) at Unknown.com_google_gwt_lang_ Cast_castTo__Ljava_lang_ Object_2Lcom_google_gwt_core_ client_JavaScriptObject_ 2Ljava_lang_Object_2(Unknown Source) at Unknown.com_extjs_gxt_ui_ client_widget_treegrid_ TreeGridCellRenderer_getText__ Lcom_extjs_gxt_ui_client_ widget_treegrid_TreeGrid_ 2Lcom_extjs_gxt_ui_client_ data_ModelData_2Ljava_lang_ String_2IILjava_lang_String_2( Unknown Source) at Unknown.com_extjs_gxt_ui_ client_widget_treegrid_ TreeGridCellRenderer_render__ Lcom_extjs_gxt_ui_client_data_ ModelData_2Ljava_lang_String_ 2Lcom_extjs_gxt_ui_client_ widget_grid_ColumnData_ 2IILcom_extjs_gxt_ui_client_ store_ListStore_2Lcom_extjs_ gxt_ui_client_widget_grid_ Grid_2Ljava_lang_Object_2( Unknown Source) ... The code that triggers this exception is this (http://grepcode.com/file/
repo1.maven.org/maven2/com. ):extjs/gxt/2.3.1-gwt22/com/ extjs/gxt/ui/client/widget/ treegrid/TreeGridCellRenderer. java/#59 return String.valueOf(model.get(
property)); My temporary solution to fix this is:
Object obj = model.get(property); String.valueOf(obj);
I already found several places where the class cast exception occurs and where this fix solves the problem, but I'm afraid that there's something going wrong somewhere in GWT.
Cheers,
Norbert
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment