GWT + Spring托管模式不起作用 [英] GWT + Spring hosted mode not working

查看:149
本文介绍了GWT + Spring托管模式不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个下面的问题,可能有人可以帮助我吗?

我有一个Spring MVC应用程序,非常基本,有几个简单的jsp页面。 p>

另外我还安装了Spring Security。



现在我需要在一个页面中添加一些GWT小部件。到目前为止没有问题,我已经添加< div>



当我编译GWT,然后将应用程序部署到tomcat时 - 一切正常,我打开应用程序,登录到页面,添加GWT模块,所有需要的GWT逻辑。它打开我的页面并查看GWT UI组件。



现在我想以托管模式打开我的应用程序。有问题开始。

当我启动托管模式时,Jetty启动,Spring框架初始化,然后我的jsp(翻译为.htm)在没有托管模式参数的情况下打开?gwt.codesvr = 127.0。 0.1:9997。



当我手动添加?gwt.codesvr = 127.0.0.1:9997托管模式启动和GWT模块开始加载。这是当我得到一个错误:


12:57:15.589 [错误] [rehabrental]未能加载模块'testmodule'
from user agent'Mozilla / 5.0(Windows; U; Windows NT 6.1; ru;
rv:1.9.2.23)Gecko / 20110920 Firefox / 3.6.23'at 127.0.0.1:63260



java.lang.NoSuchFieldError:warningThreshold at
com.google.gwt.dev.javac.JdtCompiler.getCompilerOptions(JdtCompiler.java:413)
at
com.google.gwt.dev.javac.JdtCompiler $ CompilerImpl。< init>(JdtCompiler.java:228)
at
com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler .java:700)

at
com.google.gwt.dev.javac.CompilationStateBuilder $ CompileMoreLater.compile(CompilationStateBuilder.java:235)
at
com。
at
com.got.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:447)
com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:370)

com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:360)
at
com.google.gwt.dev.DevModeBase $ UiBrowserWidgetHostImpl.createModuleSpaceHost(DevModeBase.java:110)$
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:197)
at java.lang.Thread.run(Unknown Source)



解决方案

你使用eclipse吗?如果是这样,您需要重新安排导出的模块,因为JDT类会导致GWT编译器出现问题。请参阅此 GWT问题中的第7条关于将GWT依赖关系推到其他位置之上的评论#7 ,以便编译器首先获取它们。


I have a following problem, probably somebody can help me?

I had an Spring MVC application, quite basic one, with a few simple jsp pages.

Also I had an Spring Security integrated with it.

Now I need to add some GWT widget to one page. No problem so far, I've added <div> to the page, added GWT module, all all needed GWT logic.

When I compile GWT and then deploy application to tomcat - everything works perfectly, I open app, login into it, open my page and see GWT UI components.

Now I want to open my application in hosted mode. There problems begin.

When I start hosted mode, Jetty starts, Spring framework initialize, and then my jsp (translated as .htm) open without hosted mode param ?gwt.codesvr=127.0.0.1:9997. After opening my page I see nothing if I delete compiled gwt code.

When I manually add "?gwt.codesvr=127.0.0.1:9997" hosted mode start and GWT module begin to load. This is when I get an error:

12:57:15.589 [ERROR] [rehabrental] Failed to load module 'testmodule' from user agent 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23' at 127.0.0.1:63260

java.lang.NoSuchFieldError: warningThreshold at com.google.gwt.dev.javac.JdtCompiler.getCompilerOptions(JdtCompiler.java:413) at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.<init>(JdtCompiler.java:228) at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:700)
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:235) at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:447) at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:370) at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:360) at com.google.gwt.dev.DevModeBase$UiBrowserWidgetHostImpl.createModuleSpaceHost(DevModeBase.java:110) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:197) at java.lang.Thread.run(Unknown Source)

解决方案

Do you use eclipse ?. If so you need rearrange your exported modules as JDT classes causes problems with the GWT compiler. See comment #7 in this GWT issue about pushing GWT dependencies above others, so that they are picked up first by the compiler.

这篇关于GWT + Spring托管模式不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆