2011-01-31 2 views
0

Est-il possible d'ajouter/créer un nouveau jeton d'historique à partir de chaque classe? J'ai le problème, que j'obtiens NullPointerException si j'essaye de créer le nouveau jeton (History.newItem("infoTab")) en dehors de la classe principale (la classe principale contient la méthode onModuleLoad()). Voici le message d'erreur:GWT Problème d'historique

09:45:11.890 [ERROR] [com.mycompany.client.AdminInterface] Unable to load module entry 
point class com.mycompany.client.entries.MainEntry (see associated exception for details) 

modifier: la partie iframe n'a pas été ajouté dans le index.html. Après avoir ajouté, je reçois ce qui suit:

11:16:48.885 [ERROR] [com.mycompany.client.AdminInterface] Error while executing the JavaScript provider for property 'user.agent' 

com.google.gwt.core.client.JavaScriptException: (null): null 
    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.ModuleSpacePropertyOracle.computePropertyValue(ModuleSpacePropertyOracle.java:189) 
    at com.google.gwt.dev.shell.ModuleSpacePropertyOracle.getSelectionProperty(ModuleSpacePropertyOracle.java:127) 
    at com.google.gwt.dev.cfg.ConditionWhenPropertyIs.doEval(ConditionWhenPropertyIs.java:58) 
    at com.google.gwt.dev.cfg.Condition.isTrue(Condition.java:49) 
    at com.google.gwt.dev.cfg.ConditionAny.doEval(ConditionAny.java:37) 
    at com.google.gwt.dev.cfg.Condition.isTrue(Condition.java:49) 
    at com.google.gwt.dev.cfg.ConditionAll.doEval(ConditionAll.java:38) 
    at com.google.gwt.dev.cfg.Condition.isTrue(Condition.java:49) 
    at com.google.gwt.dev.cfg.Rule.isApplicable(Rule.java:36) 
    at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.tryRebind(StandardRebindOracle.java:98) 
    at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:54) 
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:154) 
    at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:119) 
    at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:531) 
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:414) 
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:39) 
    at com.google.gwt.core.client.GWT.create(GWT.java:98) 
    at com.google.gwt.user.client.ui.Hyperlink.<clinit>(Hyperlink.java:65) 
    at com.mycompany.client.entries.MainEntry.onModuleLoad(MainEntry.java:110) 
    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:662) 

Ligne 110 de MainEntry est:

searchButton = new Hyperlink("Search", SEARCH_ID); 

donc je ne peux pas vraiment comprendre, ce qui est mal ... whithout l'iframe je reçois cinq jetons d'histoire ajouté avec succès comme suit http://localhost:8080/client/index.html#token1.

Répondre

0

Fonctionne avec et sans la balise iframe dans mon index.html. Mon erreur était, que j'utilise les mauvais paramètres de requête d'url ... après le # :)