GWT 2.4 Javascript exception when selecting an element in a CellBrowser

588 views
Skip to first unread message

Sydney

unread,
Jul 28, 2012, 6:14:51 AM7/28/12
to google-we...@googlegroups.com

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


Joseph Lust

unread,
Jul 31, 2012, 6:48:56 PM7/31/12
to google-we...@googlegroups.com
Sydney,

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

Trying to understand the issue here. You are trying to catch uncaught exceptions, and display your customized error, right? What you provided as the output looks pretty close to what I'd expect the code you wrote to do. Can you explain how this trace is different from the message you're trying to create, that is, what the 'problem' is?



Sincerely,
Joseph

Sydney

unread,
Aug 2, 2012, 3:52:42 AM8/2/12
to google-we...@googlegroups.com
The problem was "Why I get this exception for no reason?". I finally fixed the issue by redeploying the application and cleaning the browser cache.
Reply all
Reply to author
Forward
0 new messages