GWT working fine in Hosted mode but not in complied mode

379 views
Skip to first unread message

saurabh saurabh

unread,
Jul 16, 2011, 9:57:21 PM7/16/11
to Google Web Toolkit
Hi all,
I am working on GWT application, till now it has got over 50
classes. Now all in a sudden I noticed that the application is working
fine and as expected in hosted mode but when I try to run it in
compiled mode it does not. It throws an exception on Mozilla firefox :

uncaught exception: com.google.gwt.event.shared.UmbrellaException: One
or more exceptions caught, see full set in UmbrellaException#getCauses

Line 0

This has became a very bad situation for me because application has
quite grown up in size and hosted mode is giving me no clue.

*Till now my application is not using any RPC/asynchronous call.

Please !!! help.

Thanks in advance

Jens

unread,
Jul 17, 2011, 5:20:43 AM7/17/11
to google-we...@googlegroups.com
First you should add GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() { .... } ) to your EntryPoint's onModuleLoad() method. In the UncaughtExceptionHandler check if its an UmbrellaException and if so iterate over getCauses() and print each stack trace to the log.

That way you hopefully see what has really happened.

-- J.



saurabh saurabh

unread,
Jul 18, 2011, 7:37:25 AM7/18/11
to Google Web Toolkit
Thanks for reply, but I have already done that. Very Strangely the
application is not throwing even a single exception in hosted mode but
it throws the mentioned exception in compiled mode. How I traced
that ? I am using "Console.log(String)" for mozilla. So I am getting
it over the console of firebug.

Anyway using the same strategy for debugging I logged the things over
firebug and I got this :

(*note : once again you should notice that none of the exception are
being thrown in hosted mode, the console of mozilla and eclipse are
not having any of them but the same code in complied mode is throwing
the below mentioned. The code has set 'UncaughtExceptionHandler' and
taking care of umbrella exceptions

Code :
class AxisFactory{
private Axis axis;
.
.
public RaphaelObject getRaphaelAxis(){
Console.log((axis == null)+" "); // Expected true or false
but below mentioned exceptions are thrown
......
......
}
}

EXCEPTIONS TRACE ON FIREBUG CONSOLE(COMPILED MODE) :
..
...
..
calling getRaphaelAxis()

com.google.gwt.core.client.JavaScriptException: (TypeError): this
$static is null stack: java_lang_Object_
$toString__Ljava_lang_Object_2Ljava_lang_String_2(null)@file:///D:/
Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:20
com_google_chart_1gwt_client_category_AxisFactory_
$getRaphaelAxis__Lcom_google_chart_1gwt_client_category_AxisFactory_2Lcom_hydro4ge_raphaelgwt_client_RaphaelObject_2([object
Object])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:1251
com_google_chart_1gwt_client_category_bar_BarChartFactory_
$createBarAxis__Lcom_google_chart_1gwt_client_category_bar_BarChartFactory_2ZLjava_lang_Class_2V([object
Object],true,[object Object])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:2205
com_google_chart_1gwt_client_category_bar_BarChart_
$draw__Lcom_google_chart_1gwt_client_category_bar_BarChart_2ZV([object
Object],true)@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:2032
com_google_chart_1gwt_client_category_bar_BarChart_draw__V()@file:///
D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:2149
com_google_chart_1gwt_client_testwidgets_BarChartWidget_
$createChart__Lcom_google_chart_1gwt_client_testwidgets_BarChartWidget_2Lcom_google_chart_1gwt_client_Chart_2V([object
Object],[object Object])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:2937
com_google_chart_1gwt_client_testwidgets_BarChartWidget_
$createBarChart__Lcom_google_chart_1gwt_client_testwidgets_BarChartWidget_2Lcom_google_chart_1gwt_client_category_bar_BarChart_2V([object
Object],[object Object])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:2906
com_google_chart_1gwt_client_testwidgets_BarChartWidget_
$onDrawChart__Lcom_google_chart_1gwt_client_testwidgets_BarChartWidget_2Lcom_google_gwt_event_dom_client_ClickEvent_2V([object
Object])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:2986
com_google_chart_1gwt_client_testwidgets_BarChartWidget_1BinderImpl
$3_onClick__Lcom_google_gwt_event_dom_client_ClickEvent_2V([object
Object])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:3257
com_google_gwt_event_dom_client_ClickEvent_dispatch__Lcom_google_gwt_event_shared_EventHandler_2V([object
Object])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:5545
com_google_web_bindery_event_shared_SimpleEventBus_
$doFire__Lcom_google_web_bindery_event_shared_SimpleEventBus_2Lcom_google_web_bindery_event_shared_Event_2Ljava_lang_Object_2V([object
Object],[object Object])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:5914
com_google_gwt_event_shared_HandlerManager_
$fireEvent__Lcom_google_gwt_event_shared_HandlerManager_2Lcom_google_gwt_event_shared_GwtEvent_2V([object
Object],[object Object])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:5826
com_google_gwt_user_client_ui_Widget_
$fireEvent__Lcom_google_gwt_user_client_ui_Widget_2Lcom_google_gwt_event_shared_GwtEvent_2V([object
Object],[object Object])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:740
com_google_gwt_event_dom_client_DomEvent_fireNativeEvent__Lcom_google_gwt_dom_client_NativeEvent_2Lcom_google_gwt_event_shared_HasHandlers_2Lcom_google_gwt_dom_client_Element_2V([object
MouseEvent],[object Object],[object HTMLButtonElement])@file:///D:/
Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:5491
com_google_gwt_user_client_ui_Widget_
$onBrowserEvent__Lcom_google_gwt_user_client_ui_Widget_2Lcom_google_gwt_user_client_Event_2V([object
Object],[object MouseEvent])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:768
com_google_gwt_user_client_ui_Widget_onBrowserEvent__Lcom_google_gwt_user_client_Event_2V([object
MouseEvent])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:852
com_google_gwt_user_client_DOM_dispatchEvent__Lcom_google_gwt_user_client_Event_2Lcom_google_gwt_user_client_Element_2Lcom_google_gwt_user_client_EventListener_2V([object
MouseEvent],[object HTMLButtonElement],[object Object])@file:///D:/
Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:6617 ([object
MouseEvent])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:6999
com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2((function
(evt) {var listener, curElem = this;while (curElem && !(listener =
curElem.__listener)) {curElem = curElem.parentNode;}curElem &&
curElem.nodeType != 1 && (curElem = null);listener &&
com_google_gwt_user_client_impl_DOMImpl_isMyListener__Ljava_lang_Object_2Z(listener)
&&
com_google_gwt_user_client_DOM_dispatchEvent__Lcom_google_gwt_user_client_Event_2Lcom_google_gwt_user_client_Element_2Lcom_google_gwt_user_client_EventListener_2V(evt,
curElem, listener);}),[object HTMLButtonElement],[object
Arguments])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:4464
com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2((function
(evt) {var listener, curElem = this;while (curElem && !(listener =
curElem.__listener)) {curElem = curElem.parentNode;}curElem &&
curElem.nodeType != 1 && (curElem = null);listener &&
com_google_gwt_user_client_impl_DOMImpl_isMyListener__Ljava_lang_Object_2Z(listener)
&&
com_google_gwt_user_client_DOM_dispatchEvent__Lcom_google_gwt_user_client_Event_2Lcom_google_gwt_user_client_Element_2Lcom_google_gwt_user_client_EventListener_2V(evt,
curElem, listener);}),[object HTMLButtonElement],[object
Arguments])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:4494 ([object
MouseEvent])@file:///D:/Chart_gwt/Chart_gwt1.2/war/
chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html:4479
fileName: file:///D:/Chart_gwt/Chart_gwt1.2/war/chart_gwt1_2/8F84D8610801266733245FFB19A0E8D9.cache.html
lineNumber: 20

saurabh saurabh

unread,
Jul 18, 2011, 7:50:52 AM7/18/11
to Google Web Toolkit
One more thing I forgot to mention : the exception trace mentioned in
previous post is javascriptexception but what I get from this

UncaughtExceptionHandler:

try{

}
catch(UmbrellaException e){
...

}

is java.lang.IndexOutOfBoundsException : index 47 size 21 ( *IN
COMPILED MODE OVER FIREBUG CONSOLE)

if I comment // log Console.log((axis == null)+" ');

and the point the where exception is being thrown I am not doing any
kind of array or collection operations not even using em. It is just a
check for boolean value (axis == null)+" "

saurabh saurabh

unread,
Jul 18, 2011, 8:02:49 AM7/18/11
to Google Web Toolkit
Strange behavior now it is not giving that long trace of
JavaScriptException. Now it is giving just
java.lang.IndexOutOfBoundsException: Index: 47, Size: 24 (* BUT NOT IN
HOSTED MODE)


So forget that JavaScriptException

Thanks in advance

Jens

unread,
Jul 18, 2011, 8:14:24 AM7/18/11
to google-we...@googlegroups.com
Well then take a look at the stack trace of that IndexOutOfBoundsException. If it really points to Console.log() I would change it to GWT's java.util.logging emulation (http://code.google.com/intl/de-DE/webtoolkit/doc/latest/DevGuideLogging.html). 
If not then you may want to compile your app in "pretty" mode and take a look at the javascript that causes the exception. Maybe that gives you a better idea of whats going on.


Magno Machado

unread,
Jul 18, 2011, 9:08:03 AM7/18/11
to google-we...@googlegroups.com
Are you using the same browser/locale/etc on devmode and webmode?

On Mon, Jul 18, 2011 at 9:14 AM, Jens <jens.ne...@gmail.com> wrote:
Well then take a look at the stack trace of that IndexOutOfBoundsException. If it really points to Console.log() I would change it to GWT's java.util.logging emulation (http://code.google.com/intl/de-DE/webtoolkit/doc/latest/DevGuideLogging.html). 
If not then you may want to compile your app in "pretty" mode and take a look at the javascript that causes the exception. Maybe that gives you a better idea of whats going on.


--
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/-/kJvA2lH7QL8J.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Magno Machado Paulo
http://blog.magnomachado.com.br
http://code.google.com/p/emballo/

saurabh saurabh

unread,
Jul 18, 2011, 9:31:27 AM7/18/11
to Google Web Toolkit
Problem Solved.

Somewhere in my application this was the code

List<Double> list1 = dataTable.getValues();
List<Double> sortList = new ArrayList<Double>(list1);

Collections.copy(list1,sortList);
Collections.sort(sortList);

double max = sortList.get(list1.size() - 1); // giving
java.lang.IndexOutOfBoundsExeception

Now I have removed unnecessary code ' Collections.copy(....)' and
corrected 'sortList.get(sortList.size() - 1);'
Problem Solved here. But this was a buggy feature of GWT 2.1 for
whatever if there was a exception to be thrown it should have been
thrown in hosted mode too.

And ....But ... a new problem arises, the webpage is working best in
MS Internet Explorer than bit slow in Mozilla and not working in
Chrome. Anyway I ll make a new post for this issue

amos

unread,
Jul 17, 2011, 9:27:40 PM7/17/11
to Google Web Toolkit
You may also want to open a dialog box with the string of the errors.
Some of the logs don't show up properly when running in compiled mode.

Amos
Reply all
Reply to author
Forward
0 new messages