JavaScript-error(s) on IE with very "simple" com.google.gwt.user.client.ui.Image - usage

402 views
Skip to first unread message

chm124

unread,
Mar 11, 2011, 9:13:41 AM3/11/11
to Google Web Toolkit
JavaScript-error(s) on IE with simple
com.google.gwt.user.client.ui.Image

Hi
I have some problems with very simple Image-stuff on the IE.
I have an Icon-Factory (called "Icons") which returns some objects
which hold objects of the type com.google.gwt.user.client.ui.Image.

My "environment":
GWT2.1,


#1#

In a first "attempt", my factory has the following method:
public static Image getImage(int theIconType) {
return new Image(getPath(theIconType));
}
getPath(theIconType) returns a valid URL to an image.
shortly:
private static String getPath(int theIconType) {
String imgLocation = "";
switch(theIconType) {
case HOME:
imgLocation = ICONS_REPOSITORY + "icon_home.png";
break;
}
return imgLocation;
}

again, note: I instantiate an Image here with a String which is a
valid URL to an GIF-, JPG- or PNG-file.
I'm note u

The project compiles without problems (for any browser).

When running the compilation or in hosted mode, it works without any
problems on Firefox and chrome,
but NOT on Internet-Explorer (IE) 8 (on Windows 7) - neither it runs
the compiled version nor does it work on hosted mode.
shortened ERROR-Stack-Trace (when running the App on IE8):
:::
com.google.gwt.core.client.JavaScriptException: (TypeError): Das
Objekt unterstützt diese Eigenschaft oder Methode nicht.
number: -2146827850
[yes, i have german IE... the same message in english, i guess, would
be:
com.google.gwt.core.client.JavaScriptException: (TypeError): Object
doesn't support this property or method
]
description: Das Objekt unterstützt diese Eigenschaft oder Methode
nicht.
at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:
237)
at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
126)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
561)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:
289)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:
107)
at
com.google.gwt.user.client.impl.DOMImplStandard.initEventSystem(DOMImplStandard.java)
at
com.google.gwt.user.client.impl.DOMImplMozilla.initEventSystem(DOMImplMozilla.java:
39)
at
com.google.gwt.user.client.impl.DOMImpl.maybeInitializeEventSystem(DOMImpl.java:
113)
at
com.google.gwt.user.client.impl.DOMImplStandard.sinkEvents(DOMImplStandard.java:
142)
at
com.google.gwt.user.client.impl.DOMImplMozilla.sinkEvents(DOMImplMozilla.java:
27)
at com.google.gwt.user.client.DOM.sinkEvents(DOM.java:1221)
at com.google.gwt.user.client.Event$.sinkEvents(Event.java:553)
at com.google.gwt.user.client.ui.Image
$UnclippedState.<init>(Image.java:294)
at com.google.gwt.user.client.ui.Image
$UnclippedState.<init>(Image.java:302)
at com.google.gwt.user.client.ui.Image.<init>(Image.java:430)
at com.itv.display.gwt.core.client.icons.Icons.getImage(Icons.java:
95)

I understand this like IE cannot instantiate an Image with an URL-
String??? that would be very very disappointing & unbelievable. :(
The "funny" thing is ... sometimes (maybe in 1 of 10 attempts, it
works in IE ...)


I've read many dev-comments about images on IE with GWT, but i didn't
really found the same error and i feel a bit planless somehow.
From maybe related errors, i've read, that IE-problems with images may
arise from IEs way of caching and accesing cached images ...
... and i've "enlarged" the above mentioned method the following way:

private static String getPath(int theIconType) {
String imgLocation = "";
switch(theIconType) {
case HOME:
imgLocation = ICONS_REPOSITORY + "icon_home.png";
break;
}
String aTmp = Long.toString( (new Date()).getTime() );
return imgLocation+"?zx="+aTmp;
}

Unfortuantely, the result/error/stacktrace is still the same .


#2#
::
In a next step, i "put" ALL images in a ClientBundle, so my Icon-
Factory ("Icons") changed a little bit.
/* new clientBundle */
public interface IconsBundle extends ClientBundle {

static final String REPOSITORY = "icons_default/";

static final IconsBundle instance = GWT.create(IconsBundle.class);

@Source(REPOSITORY + "icon_add_2s.png")
ImageResource add_2s();

}


/* within com.itv.display.gwt.core.client.icons.Icons, i changed the
method to access an image: */
public static Image getImage(int theIconType) {
ImageResource anImageResource = null;

switch(theIconType) {
case HOME:
anImageResource = IconsBundle.instance.home();
break;

/* etc. pp. */
}
return new Image(anImageResource);


Again: The appliaction can be compiled for "all" browsers, runs on all
browsers
BUT NOT on IE. :( (not on hosted mode, not on the compiled version)
StackTrace:

14:56:18.580 [ERROR] [crm_demo] Unable to load module entry point
class com.itv.crm.demo.gwt.client.Crm_demo_newer (see associated
exception for details)

com.google.gwt.user.client.ui.AttachDetachException: One or more
exceptions caught, see full set in UmbrellaException#getCauses
at
com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:
87)
at com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:
170)
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:319)
at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:449)
at com.google.gwt.user.client.ui.Panel.adopt(Panel.java:127)
at
com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:97)
at
com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:97)
at
com.itv.crm.demo.gwt.client.ui.RootPanelView.construct(RootPanelView.java:
83)
at com.itv.crm.demo.gwt.client.ui.RootPanelView.&lt;init&gt;
(RootPanelView.java:71)
at
com.itv.crm.demo.gwt.client.Crm_demo_newer.onModuleLoad(Crm_demo_newer.java:
33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:
396)
at
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:
183)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:
510)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:
352)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.google.gwt.user.client.ui.AttachDetachException: One or
more exceptions caught, see full set in UmbrellaException#getCauses
at
com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:
87)
at com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:
170)
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:319)
at com.google.gwt.user.client.ui.AttachDetachException
$1.execute(AttachDetachException.java:34)
at
com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:
74)
at com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:
170)
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:319)
at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:449)
at com.google.gwt.user.client.ui.Panel.adopt(Panel.java:127)
at
com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:97)
at
com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:97)
at
com.itv.crm.demo.gwt.client.ui.RootPanelView.construct(RootPanelView.java:
83)
at com.itv.crm.demo.gwt.client.ui.RootPanelView.&lt;init&gt;
(RootPanelView.java:71)
at
com.itv.crm.demo.gwt.client.Crm_demo_newer.onModuleLoad(Crm_demo_newer.java:
33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:
396)
at
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:
183)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:
510)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:
352)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.google.gwt.user.client.ui.AttachDetachException: One or
more exceptions caught, see full set in UmbrellaException#getCauses
at
com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:
87)
at com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:
170)
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:319)
at com.google.gwt.user.client.ui.AttachDetachException
$1.execute(AttachDetachException.java:34)
at
com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:
74)
at com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:
170)
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:319)
at com.google.gwt.user.client.ui.AttachDetachException
$1.execute(AttachDetachException.java:34)
at
com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:
74)
at com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:
170)
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:319)
at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:449)
at com.google.gwt.user.client.ui.Panel.adopt(Panel.java:127)
at
com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:97)
at
com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:97)
at
com.itv.crm.demo.gwt.client.ui.RootPanelView.construct(RootPanelView.java:
83)
at com.itv.crm.demo.gwt.client.ui.RootPanelView.&lt;init&gt;
(RootPanelView.java:71)
at
com.itv.crm.demo.gwt.client.Crm_demo_newer.onModuleLoad(Crm_demo_newer.java:
33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:
396)
at
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:
183)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:
510)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:
352)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.google.gwt.core.client.JavaScriptException:
(TypeError): Das Objekt unterstützt diese Eigenschaft oder Methode
nicht.
number: -2146827850
description: Das Objekt unterstützt diese Eigenschaft oder Methode
nicht.
at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:
237)
at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
126)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
561)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:
289)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:
107)
at
com.google.gwt.user.client.impl.DOMImplStandard.initEventSystem(DOMImplStandard.java)
at
com.google.gwt.user.client.impl.DOMImplMozilla.initEventSystem(DOMImplMozilla.java:
39)
at
com.google.gwt.user.client.impl.DOMImpl.maybeInitializeEventSystem(DOMImpl.java:
113)
at
com.google.gwt.user.client.impl.DOMImplStandard.sinkEvents(DOMImplStandard.java:
142)
at
com.google.gwt.user.client.impl.DOMImplMozilla.sinkEvents(DOMImplMozilla.java:
27)
at com.google.gwt.user.client.DOM.sinkEvents(DOM.java:1221)
at com.google.gwt.user.client.ui.UIObject.sinkEvents(UIObject.java:
766)
at com.google.gwt.user.client.ui.Widget.sinkEvents(Widget.java:
215)
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:317)
at com.google.gwt.user.client.ui.AttachDetachException
$1.execute(AttachDetachException.java:34)
at
com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:
74)
at com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:
170)
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:319)
at com.google.gwt.user.client.ui.AttachDetachException
$1.execute(AttachDetachException.java:34)
at
com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:
74)
at com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:
170)
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:319)
at com.google.gwt.user.client.ui.AttachDetachException
$1.execute(AttachDetachException.java:34)
at
com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:
74)
at com.google.gwt.user.client.ui.Panel.doAttachChildren(Panel.java:
170)
at com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:319)
at com.google.gwt.user.client.ui.Widget.setParent(Widget.java:449)
at com.google.gwt.user.client.ui.Panel.adopt(Panel.java:127)
at
com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:97)
at
com.google.gwt.user.client.ui.AbsolutePanel.add(AbsolutePanel.java:97)
at
com.itv.crm.demo.gwt.client.ui.RootPanelView.construct(RootPanelView.java:
83)
at com.itv.crm.demo.gwt.client.ui.RootPanelView.&lt;init&gt;
(RootPanelView.java:71)
at
com.itv.crm.demo.gwt.client.Crm_demo_newer.onModuleLoad(Crm_demo_newer.java:
33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:
396)
at
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:
183)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:
510)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:
352)
at java.lang.Thread.run(Thread.java:619)


This time, the stackTrace says NOTHING about Image or a method of
Image which is unsupported or whatever ...
...


Shortly said:
It seems to be impossible to use Images with GWT on IE, which is
fairly impossible.
What did i "miss" / "mess"?
How to handle / use com.google.gwt.user.client.ui.Image that it works
on IE, too?
Did somebody encountered the same problem? What can i do???
i feel realy stranded ...

Thanks in advance for every helpful hint!
_christoph
Reply all
Reply to author
Forward
0 new messages