roo 示例 gwtNoEntities 加载失败

发布于 2024-10-05 19:16:56 字数 1996 浏览 7 评论 0原文

我刚刚尝试了与 roo-1.1.0 捆绑在一起的 gwtNoEntities 示例。

当使用 tomcat:run 或 jetty:run 启动时,我只得到加载框。

在 GWT 托管模式下运行它时,我在客户端中报告了以下堆栈跟踪,
这似乎是与使用浏览器历史记录设置默认位置相关的错误,该位置为空。

解决这个问题的正确方法是什么?

stacktrace

    00:02:08.323 [ERROR] Unable to load module entry point class com.springsource.foo.client.scaffold.Scaffold (see associated exception for details)
    java.util.NoSuchElementException: null
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796)
at java.util.HashMap$KeyIterator.next(HashMap.java:828)
at com.springsource.foo.client.scaffold.ScaffoldDesktopApp.init(ScaffoldDesktopApp.java:139) 
at com.springsource.foo.client.scaffold.ScaffoldDesktopApp.run(ScaffoldDesktopApp.java:61)
at com.springsource.foo.client.scaffold.Scaffold.onModuleLoad(Scaffold.java:19)
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)

生成的有问题的代码

/* Browser history integration */
ScaffoldPlaceHistoryMapper mapper = GWT.create(ScaffoldPlaceHistoryMapper.class);
mapper.setFactory(placeHistoryFactory);
PlaceHistoryHandler placeHistoryHandler = new PlaceHistoryHandler(mapper);
/* 139 */ ProxyListPlace defaultPlace = getTopPlaces().iterator().next();
placeHistoryHandler.register(placeController, eventBus, defaultPlace);
placeHistoryHandler.handleCurrentHistory();

I've just tried the the gwtNoEntities sample that is bundled with roo-1.1.0.

when launching using tomcat:run, or jetty:run, I get only the loading box.

When running it in GWT hosted mode, I get the following stacktrace reported in the client,
this appears to be an error related to setting up the default place using browser history, which is empty.

What would be the correct way to go about fixing this?

stacktrace

    00:02:08.323 [ERROR] Unable to load module entry point class com.springsource.foo.client.scaffold.Scaffold (see associated exception for details)
    java.util.NoSuchElementException: null
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796)
at java.util.HashMap$KeyIterator.next(HashMap.java:828)
at com.springsource.foo.client.scaffold.ScaffoldDesktopApp.init(ScaffoldDesktopApp.java:139) 
at com.springsource.foo.client.scaffold.ScaffoldDesktopApp.run(ScaffoldDesktopApp.java:61)
at com.springsource.foo.client.scaffold.Scaffold.onModuleLoad(Scaffold.java:19)
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)

generated code in question

/* Browser history integration */
ScaffoldPlaceHistoryMapper mapper = GWT.create(ScaffoldPlaceHistoryMapper.class);
mapper.setFactory(placeHistoryFactory);
PlaceHistoryHandler placeHistoryHandler = new PlaceHistoryHandler(mapper);
/* 139 */ ProxyListPlace defaultPlace = getTopPlaces().iterator().next();
placeHistoryHandler.register(placeController, eventBus, defaultPlace);
placeHistoryHandler.handleCurrentHistory();

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

〆一缕阳光ご 2024-10-12 19:16:56

您可以将生成的代码替换为下面的 while 条件块(第 139 行),

    while (getTopPlaces().iterator().hasNext()) {
    ProxyListPlace defaultPlace = getTopPlaces().iterator().next();
    placeHistoryHandler.register(placeController, eventBus, defaultPlace);
    placeHistoryHandler.handleCurrentHistory();
}

使用 mvncompile 重新编译,使用 mvn gwt:run 重新启动。现在您应该没有错误,但页面为空。

gwtNoEntities.roo 示例没有数据。您可以尝试其他示例,例如费用.roo。生成的代码应该没问题。

如果答案有帮助请记得采纳。

谢谢。

You may replace the generated code with while condition block at the below (line 139)

    while (getTopPlaces().iterator().hasNext()) {
    ProxyListPlace defaultPlace = getTopPlaces().iterator().next();
    placeHistoryHandler.register(placeController, eventBus, defaultPlace);
    placeHistoryHandler.handleCurrentHistory();
}

recompile with mvn compile, restart with mvn gwt:run. Now you should have no error but with empty page.

The gwtNoEntities.roo example has no data. You may try other example like expenses.roo. The generated code should be okay.

Please remember to accept the answer if it helps.

Thanks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文