Hi
It 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:
https://groups.google.com/forum/#!topic/google-web-toolkit/bBW-RU5wEGs
-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