J'étudie l'ajout de GWT à un projet Spring MVC existant. J'ai passé avec succès un tutoriel en utilisant spring4gwt et j'ai eu la communication entre le point d'entrée du client et le service.
J'ai ajouté un nouveau module dans eclipse et à gauche comme défaut par défaut. Maintenant, quand j'appuie sur n'importe quel bouton (soit le nouveau bouton Hello World, soit un de l'exemple précédent), j'obtiens une pile de traces.
Pour ajouter le point d'entrée supplémentaire, je viens d'ajouter le script supplémentaire include.
À quoi est-ce dû? Dois-je ajouter des modules entrypoint à mon projet d'une manière différente?
Voici la cause.
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): $wnd.alert is not a function
fileName: LOCALHOST
lineNumber: 146
stack: ("Hello, GWT World!")@LOCALHOST:146
@:0
(null,458830,[object MouseEvent],[object HTMLButtonElement],[object GWTJavaObject])@LOCALHOST/clariti-gwt/alert/hosted.html?alert:56
([object MouseEvent])@LOCALHOST:38
((function (evt) {var listener, curElem = this;while (curElem && !(listener = curElem.__listener)) {curElem = curElem.parentNode;}if (curElem && curElem.nodeType != 1) {curElem = null;}if (listener) {if (__gwt_makeJavaInvoke(1)(null, 393334, listener)) {__gwt_makeJavaInvoke(3)(null, 458830, evt, curElem, listener);}}}),[object HTMLButtonElement],[object Object])@LOCALHOST:18
@:0
(null,106,(function (evt) {var listener, curElem = this;while (curElem && !(listener = curElem.__listener)) {curElem = curElem.parentNode;}if (curElem && curElem.nodeType != 1) {curElem = null;}if (listener) {if (__gwt_makeJavaInvoke(1)(null, 393334, listener)) {__gwt_makeJavaInvoke(3)(null, 458830, evt, curElem, listener);}}}),[object HTMLButtonElement],[object Object])@LOCALHOST/clariti-gwt/alert/hosted.html?alert:56
([object MouseEvent])@LOCALHOST:43
17:04:32.466 [ERROR] [alert] Uncaught exception escaped
com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:214)
at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:96)
at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:107)
at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:155)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1264)
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.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
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.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
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): $wnd.alert is not a function
fileName: LOCALHOST
lineNumber: 146
stack: ("Hello, GWT World!")@LOCALHOST:146
@:0
(null,458830,[object MouseEvent],[object HTMLButtonElement],[object GWTJavaObject])@LOCALHOST/clariti-gwt/alert/hosted.html?alert:56
([object MouseEvent])@LOCALHOST:38
((function (evt) {var listener, curElem = this;while (curElem && !(listener = curElem.__listener)) {curElem = curElem.parentNode;}if (curElem && curElem.nodeType != 1) {curElem = null;}if (listener) {if (__gwt_makeJavaInvoke(1)(null, 393334, listener)) {__gwt_makeJavaInvoke(3)(null, 458830, evt, curElem, listener);}}}),[object HTMLButtonElement],[object Object])@LOCALHOST:18
@:0
(null,106,(function (evt) {var listener, curElem = this;while (curElem && !(listener = curElem.__listener)) {curElem = curElem.parentNode;}if (curElem && curElem.nodeType != 1) {curElem = null;}if (listener) {if (__gwt_makeJavaInvoke(1)(null, 393334, listener)) {__gwt_makeJavaInvoke(3)(null, 458830, evt, curElem, listener);}}}),[object HTMLButtonElement],[object Object])@LOCALHOST/clariti-gwt/alert/hosted.html?alert:56
([object MouseEvent])@LOCALHOST:43
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.Window.alert(Window.java)
at com.energyintellect.alert.client.AlertView$1.onClick(AlertView.java:23)
at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:54)
at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)
at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:204)
at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:96)
at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:107)
at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:155)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1264)
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.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
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.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
at java.lang.Thread.run(Thread.java:619)