Saturday, July 28, 2012

GWT 2.4 Javascript exception when selecting an element in a CellBrowser

My application works fine in DevMode but after deployment on appengine, I get JavascriptException. I have a CellBrowser with 3 levels. What is strange is that the exception only occurs on some element of the first and third level. The behavior is correct, meaning that when I select a first level element, the corresponding elements shows in the second level. I have a class that implements UncaughtExceptionHandler where I log the stack trace:

    @Override      public void onUncaughtException(Throwable e) {          StringBuffer sb = new StringBuffer();            sb.append("Exception type: " + e.getClass()).append("\n");          sb.append("Message: ").append(e.getMessage()).append("\n");          Window.alert(sb.toString());          if (e instanceof JavaScriptException) {                Window.alert("JSException");              if (e.getStackTrace().length == 0) {                  e.fillInStackTrace();              }              sb.append(e.getClass()).append(" - ").append(e.getMessage()).append(                      "\n");              for (StackTraceElement stackTrace : e.getStackTrace()) {                  sb.append(stackTrace.getClassName()).append(".").append(                          stackTrace.getMethodName()).append("(").append(                          stackTrace.getFileName()).append(":").append(                          stackTrace.getLineNumber()).append(")");                  sb.append("\n");              }              Window.alert(sb.toString());          }

When the exception occurs after selecting one element of the CellBrowser, the log is:

Exception type: class com.google.gwt.core.client.JavaScriptException  Message: (TypeError): Cannot read property 'firstChild' of undefined  class com.google.gwt.core.client.JavaScriptException - (TypeError): Cannot read property 'firstChild' of undefined  Unknown.com_google_gwt_dom_client_DOMImpl_$getFirstChildElement__Lcom_google_gwt_dom_client_DOMImpl_2Lcom_google_gwt_dom_client_Element_2Lcom_google_gwt_dom_client_Element_2(null:-1)  Unknown.com_google_gwt_user_cellview_client_CellBrowser$BrowserCellList_getCellParent__Lcom_google_gwt_dom_client_Element_2Lcom_google_gwt_dom_client_Element_2(null:-1)  Unknown.com_google_gwt_user_cellview_client_CellList_resetFocusOnCell__Z(null:-1)  Unknown.com_google_gwt_user_cellview_client_AbstractHasData$View$1_execute__V(null:-1)  Unknown.com_google_gwt_core_client_impl_SchedulerImpl_runScheduledTasks__Lcom_google_gwt_core_client_JsArray_2Lcom_google_gwt_core_client_JsArray_2Lcom_google_gwt_core_client_JsArray_2(null:-1)  Unknown.com_google_gwt_core_client_impl_SchedulerImpl_$flushPostEventPumpCommands__Lcom_google_gwt_core_client_impl_SchedulerImpl_2V(null:-1)  Unknown.com_google_gwt_core_client_impl_SchedulerImpl$Flusher_execute__Z(null:-1)  Unknown.com_google_gwt_core_client_impl_SchedulerImpl_execute__Lcom_google_gwt_core_client_Scheduler$RepeatingCommand_2Z(null:-1)  Unknown.com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(null:-1)  Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(null:-1)

Do you know if it's a problem with my code, or if it's a GWT compiler bug?

I also try to run the compiled version of my app locally but I always get the message `GWT module may need to be (re)compiled). I don't understand because in Eclipse click I run the Gwt Compile Project command.

Thanks


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/GUGZlTjhQkwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment