GWT 2.6.1未知编译问题 [英] GWT 2.6.1 unknown compile issue

查看:204
本文介绍了GWT 2.6.1未知编译问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道其他人对GWT编译有问题,但在这种情况下我感到失落。
我正在使用GWT 2.6.1和相同版本的gwt-maven-plugin,2.6.1

I know other people have had issues with GWT compiles, but in this case I am at a loss. I am using GWT 2.6.1 and the same version of the gwt-maven-plugin, 2.6.1

首先GWT和/或SmartGWT是否支持JDK 1.8还是现在只有1.7?我正在使用jdk 1.7,但最终要尝试1.8。

First does GWT and/or SmartGWT support JDK 1.8 yet, or just 1.7 for now? I am using jdk 1.7, but would like to try 1.8 eventually.

其次,当我在eclipse内做一个maven构建时,我得到这个错误...
然而,当我从GWT Eclipse插件中进行GWT编译时,我右键单击该项目,并将其告知GWT Compile,并且没有问题。

Second, when I do a maven build within eclipse I get this error ... Yet, when I do a GWT compile from the GWT Eclipse Plugin, I right click on the project, and I tell it to GWT Compile and it does with no issues.

[INFO] --- gwt-maven-plugin:2.6.1:compile (default) @ rm-ui ---
[INFO] auto discovered modules [com.redi2.products.rm.RevenueManager]
[INFO] Compiling module com.redi2.products.rm.RevenueManager
[INFO] [ERROR] Unexpected internal compiler error
[INFO] java.lang.NoSuchFieldError: warningThreshold
[INFO]  at com.google.gwt.dev.javac.JdtCompiler$1.<init>(JdtCompiler.java:505)
[INFO]  at com.google.gwt.dev.javac.JdtCompiler.getStandardCompilerOptions(JdtCompiler.java:503)
[INFO]  at com.google.gwt.dev.javac.JdtCompiler.getCompilerOptions(JdtCompiler.java:533)
[INFO]  at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:878)
[INFO]  at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:284)
[INFO]  at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:511)
[INFO]  at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:434)
[INFO]  at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:420)
[INFO]  at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:495)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:241)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:223)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:139)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:167)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:132)
[INFO]  at com.google.gwt.dev.Compiler$1.run(Compiler.java:99)
[INFO]  at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[INFO]  at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[INFO]  at com.google.gwt.dev.Compiler.main(Compiler.java:106)

下一步是从eclipse出来,并从命令行尝试一个mvn构建,这不行。所以,我执行以下操作:

The next step was to go out of eclipse and try a mvn build from the command line, and that doesn't work. So, I do the following:

mvn clean  - and that correctly deletes my target directory and the gwt-unitCache.
mvn gwt:clean
mvn -X -e gwt:compile --debug

起初,它告诉我找不到我的:com.tholmes.products.App.gwt.xml
但是我知道它在那里,我甚至删除了该文件并重新添加了它。这是类路径的一部分,它在那里,并以正确的格式。

At first, it was telling me that it couldn't find my: com.tholmes.products.App.gwt.xml but I know it is there, I even deleted the file and re-added it. It is very much part of the classpath, and it is there, and in the right format.

所以,我做了一个:

mvn gwt:eclipse  
mvn gwt:eclipseTest

这似乎解决了找不到gwt.xml文件的问题。

This seemed to fix the issue that it could not find the gwt.xml file.

所以,现在我再试一次,这就是我得到所有的调试和堆栈跟踪。

So, now I try again, and this is what I get with all the debug and stack trace.

[INFO] Compiling module com.redi2.products.rm.RevenueManager
[INFO] [ERROR] Unexpected internal compiler error
[INFO] java.lang.NoSuchFieldError: warningThreshold
[INFO]  at com.google.gwt.dev.javac.JdtCompiler$1.<init>(JdtCompiler.java:505)
[INFO]  at com.google.gwt.dev.javac.JdtCompiler.getStandardCompilerOptions(JdtCompiler.java:503)
[INFO]  at com.google.gwt.dev.javac.JdtCompiler.getCompilerOptions(JdtCompiler.java:533)
[INFO]  at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:878)   
[INFO]  at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:284)
[INFO]  at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:511)
[INFO]  at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:434)
[INFO]  at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:420)
[INFO]  at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:495)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:241)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:223)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:139)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:167)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:132)
[INFO]  at com.google.gwt.dev.Compiler$1.run(Compiler.java:99)
[INFO]  at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[INFO]  at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[INFO]  at com.google.gwt.dev.Compiler.main(Compiler.java:106)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.522s
[INFO] Finished at: Fri Sep 05 11:00:36 EDT 2014
[INFO] Final Memory: 15M/222M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.6.1:compile (default-cli) on project rm-ui: Command [[

那么这里有一个巨大的类路径,结尾是:

then there is a huge classpath here ending with:

...\tholmes\.m2\repository\com\google\gwt\gwt-dev\2.6.1\gwt-dev-2.6.1.jar             
com.google.gwt.dev.Compiler -logLevel INFO -style OBF -war C:\Users\tholmes\git\rm_ui
\target\rm-ui-0.0.1-SNAPSHOT -localWorkers 4 -XfragmentCount -1 -sourceLevel auto -gen  C:\Users\tholmes\git\rm_ui\target\.generated com.redi2.products.rm.RevenueManager

]]
失败,状态1
在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
在org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java: 183)
在org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
在org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
在org.apache .maven.cli.MavenCli.doMain(MavenCli.java:214)
在org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang .reflect.Method.invoke(Method.java:606)
在org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
在org.codehaus.plexus.classworlds .launcher.Launcher.launch(Launcher.j ava:230)
在org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
在org.codehaus.plexus.classworlds.launcher.Launcher.main(启动器。 java:357)

]] failed with status 1 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214) at org.apache.maven.cli.MavenCli.main(MavenCli.java:158) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)

然后它说:

Caused by: org.codehaus.mojo.gwt.shell.ForkedProcessExecutionException: Command [[

与一个巨大的类路径,最后以...结尾...

with a huge class path, and finally ending with ...

... \tholmes.m2\repository\com\google\gwt\gwt-dev\2.6 .1\gwt-dev-2.6.1.jar com.google.gwt.dev.Compiler
-logLevel INFO -style OBF
-war C:\Users\tholmes\git\\ \\ rm_ui\target\rm-ui-0.0.1-SNAPSHOT
-localWorkers 4 -XfragmentCount -1
-sourceLevel auto
-gen C:\Users\tholmes\ git\rm_ui\target.generated com.redi2.products.rm.RevenueManager
]]失败,状态1


org.codehaus.mojo.gwt.sh ell.AbstractGwtShellMojo $ JavaCommand.execute(AbstractGwtShellMojo.java:485)
在org.codehaus.mojo.gwt.shell.CompileMojo.compile(CompileMojo.java:446)
在org.codehaus.mojo。 gwt.shell.CompileMojo.doExecute(CompileMojo.java:351)
在org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute(AbstractGwtShellMojo.java:172)
在org.apache.maven。 plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
...另外19个

...\tholmes.m2\repository\com\google\gwt\gwt-dev\2.6.1\gwt-dev-2.6.1.jar com.google.gwt.dev.Compiler -logLevel INFO -style OBF -war C:\Users\tholmes\git\rm_ui\target\rm-ui-0.0.1-SNAPSHOT -localWorkers 4 -XfragmentCount -1 -sourceLevel auto -gen C:\Users\tholmes\git\rm_ui\target.generated com.redi2.products.rm.RevenueManager ]] failed with status 1 at
org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo$JavaCommand.execute(AbstractGwtShellMojo.java:485) at org.codehaus.mojo.gwt.shell.CompileMojo.compile(CompileMojo.java:446) at org.codehaus.mojo.gwt.shell.CompileMojo.doExecute(CompileMojo.java:351) at org.codehaus.mojo.gwt.shell.AbstractGwtShellMojo.execute(AbstractGwtShellMojo.java:172) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 19 more

 [ERROR]
 [ERROR]
 [ERROR] For more information about the errors and possible solutions, please read the  following articles:
 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

我花了两天时间,三人试图弄清楚这一点。

这是我们在当地的gi的一个项目t,而不是从头开始改变一个新的UI项目。

I've spent two days, and going on three trying to figure this out.
This is a project we have in our local git, and I'd rather not have to revuild a new UI project from scratch.

谢谢!

推荐答案


首先GWT和/或SmartGWT是否还支持JDK 1.8,还是现在只有1.7?我正在使用jdk 1.7,但最终要尝试1.8。

First does GWT and/or SmartGWT support JDK 1.8 yet, or just 1.7 for now? I am using jdk 1.7, but would like to try 1.8 eventually.

2.6中的GWT编译器不支持Java 1.8。 git当前版本的GWT也不是,但是还有一个维护的fork增加了支持。极短版本的问题:语言功能本身并不太糟糕(并且描述的叉已经拥有它们),但是新的JRE库功能也需要移植(并且合法!不能只从Oracle的代码,那就是诉讼)。

The GWT Compiler in 2.6 does not support Java 1.8. The current version of GWT in git does not either, but there is a fork being maintained that adds support. Extremely short version of the issues: The language features themselves aren't too bad too add (and the described fork already has them), but the new JRE library features need to be ported too (and legally! can't just copy from Oracle's code, that way lies lawsuits).

java.lang.NoSuchFieldError: warningThreshold

两个可能的问题可能导致这两个类路径相关。

Two possible issues can cause this, both classpath related.

第一个是gwt版本问题 - 您在某种程度上混合和匹配您的类路径中的GWT版本。看看完整的(但不包括在这个问题,所以我不能给你更多的细节),你可能会找到额外的GWT 2.5或2.4的副本在列出的地方。我怀疑这是最有可能的,因为它特别针对您的GWT升级。

The first is a gwt version issue - you are somehow mixing and matching versions of GWT on your classpath. Look through the full (but not included in this question, so I can't give you more specifics), and you'll likely find an extra copy of GWT 2.5 or 2.4 somewhere listed. I suspect this is the most likely since it tends to be specific to your GWT upgrade.

另一个选择是您的类路径上有另一个(很可能是较旧的)JDT (由于GWT 2.6更新为新的JDT版本)。请参阅相关问题 GWT + Spring托管模式不工作 - 这是在谈论dev模式,但它是一样的想法。这似乎不太可能,因为你应该使用相同的类路径,无论是在eclipse还是maven,但仍然是可能的。

Another option is that you have another (very likely older) JDT on your classpath somewhere (since GWT 2.6 updated to a new JDT version). See related question GWT + Spring hosted mode not working - this is talking about dev mode, but it is the same idea. This seems less likely to me since you should be using the same classpath whether in eclipse or maven, but is still possible.

这篇关于GWT 2.6.1未知编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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