J'écris une application avec GWT et j'ai trouvé sur Internet qu'il y a une bibliothèque pour utiliser facilement les fonctionnalités gdata. En particulier, je dois utiliser l'intégration avec Google Agenda. J'ai suivi le guide officiel sur le site gwt-gdata pour faire l'authentification (http://code.google.com/p/gwt-gdata/wiki/GettingStarted) mais malheureusement, j'ai eu une erreur. C'est l'erreur:Gwt-gdata authentication
17:59:12.463 [ERROR] [testmappa] Unable to load module entry point class testMappa.client.TestMappa (see associated exception for details)
com.google.gwt.core.client.JavaScriptException:
(TypeError): $wnd.google.accounts is undefined
fileName: http://127.0.0.1:8888
lineNumber: 29
stack: ("http://www.google.com/calendar/feeds/")@http://127.0.0.1:8888:29
connect("http://127.0.0.1:8888/TestMappa.html?gwt.codesvr=127.0.0.1:9997","`gL1<a3s4B&Y{(Ci","127.0.0.1:9997","testmappa","2.0")@:0
((void 0),"testmappa","http://127.0.0.1:8888/testmappa/")@http://127.0.0.1:8888/testmappa/hosted.html?testmappa:264
z()@http://127.0.0.1:8888/testmappa/testmappa.nocache.js:2
(-2)@http://127.0.0.1:8888/testmappa/testmappa.nocache.js:8
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.accounts.client.User.login(User.java)
at testMappa.client.TestMappa.onModuleLoad(TestMappa.java:68)
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:369)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:185)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:380)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Thread.java:637)
Je ne suis pas capable de comprendre la raison de cette erreur. Mon code est simplement:
String scope = "http://www.google.com/calendar/feeds/";
User.login(scope);
Et autant que je sache, cela devrait fonctionner tel quel. Je ne sais pas quoi faire et je suis ici pour demander comment résoudre ce problème et si je peux utiliser directement la bibliothèque gdata native java, mais je crois que cette autre chose n'est pas possible pour le code gwt côté client (puisque le code va être converti en javascript).
Merci.
Cela semble fonctionner, mais je ne comprends pas, j'ai écrit la ligne ci-dessus juste après le code que vous avez collé ici et n'a pas fonctionné ... BTW, merci! – Raffo
Vous devez comprendre la nature asynchrone de javascript. Lire cet article - http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/faca1575f306ba0f –