{"id":672,"date":"2011-02-10T09:11:00","date_gmt":"2011-02-10T07:11:00","guid":{"rendered":""},"modified":"2023-03-23T13:28:09","modified_gmt":"2023-03-23T12:28:09","slug":"gwt-exception-in-hosted-mode","status":"publish","type":"post","link":"https:\/\/touk.pl\/blog\/2011\/02\/10\/gwt-exception-in-hosted-mode\/","title":{"rendered":"GWT exception in Hosted Mode"},"content":{"rendered":"<p>I work with <a href=\"http:\/\/code.google.com\/webtoolkit\/doc\/1.6\/DevGuide.html\">GWT version 1.7.0<\/a>. It\u2019s old but our product requires it. Recently I had to debug using <a href=\"http:\/\/code.google.com\/webtoolkit\/doc\/1.6\/DevGuideCompilingAndDebugging.html#DevGuideHostedMode\">Hosted mode<\/a> under Windows XP. During Hosted mode startup I had an exception<\/p>\n<pre class=\"brush: java\" style=\"font-size:8px\">2011-02-08 17:04:31,578 [FATAL] Uncaught Exception:\r\ncom.google.gwt.core.client.JavaScriptException:(TypeError):\r\nObject doesn't support this property or method.\u00a0number: -2146827850\r\n\u00a0description: Obiekt nie obs\u0142uguje tej w\u0142a\u015bciwo\u015bci lub metody.\r\n\u00a0\u00a0\u00a0 at com.google.gwt.user.client.impl.DOMImplStandard.initEventSystem(Native Method)\r\n\u00a0\u00a0\u00a0 at com.google.gwt.user.client.impl.DOMImplMozilla.initEventSystem(DOMImplMozilla.java:39)\r\n\u00a0\u00a0\u00a0 at com.google.gwt.user.client.impl.DOMImpl.maybeInitializeEventSystem(DOMImpl.java:111)\r\n\u00a0\u00a0\u00a0 at com.google.gwt.user.client.impl.DOMImplStandard.sinkEvents(DOMImplStandard.java:140)\r\n\u00a0\u00a0\u00a0 at com.google.gwt.user.client.impl.DOMImplMozilla.sinkEvents(DOMImplMozilla.java:27)\r\n\u00a0\u00a0\u00a0 at com.google.gwt.user.client.DOM.sinkEvents(DOM.java:1221)<\/pre>\n<p>After some investigation I found the reason.<br \/>\nDuring development, for performance reasons I compile my GWT apps only for Firefox. So this was the case. You must know that in earlier versions of GWT (and so in 1.7.0), application is displayed in special window with embedded Internet Explorer. And now you might look closer to the stacktrace above and see that there are some Mozilla classes involved and that\u2019s wrong because for IE we should have only IE classes! So that\u2019s the cause I had exception.<\/p>\n<p>So if you want to run Hosted mode you have to compile your GWT application at least with IE support. Add this to you *.gwt.xml config file<\/p>\n<pre><em><set-property name=\"user.agent\" value=\"ie6,ie8\"><\/set-property><\/em><\/pre>\n<p>Or leave it without declaring <em>user.agent<\/em> so it would be compiled for all supported browsers. Too shame that GWT doesn\u2019t warn if it was not compiled for current browser.<\/p>\n<p>If you still have problems with mentioned exception look at an issue in <a href=\"http:\/\/code.google.com\/p\/google-web-toolkit\/issues\/detail?id=4086\">GWT bug tracker<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"I work with GWT version 1.7.0. It\u2019s old but our product requires it. Recently I had to debug&hellip;\n","protected":false},"author":22,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[71,28,68],"class_list":{"0":"post-672","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-development-design","7":"tag-frontend","8":"tag-gwt","9":"tag-java"},"_links":{"self":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/comments?post=672"}],"version-history":[{"count":13,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/672\/revisions"}],"predecessor-version":[{"id":15626,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/672\/revisions\/15626"}],"wp:attachment":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/media?parent=672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/categories?post=672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/tags?post=672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}