Advice needed - compile error while moving back to GWT 2.7 from 2.8.2

220 views
Skip to first unread message

Rachel

unread,
May 14, 2018, 9:06:09 AM5/14/18
to GWT Users
We have to move our project back to GWT 2.7 due to some java 1.8 issues. I've checked all my jar files to make sure they are 2.7 and no duplicate jars in the build path but am getting errors when I try to compile with Ant.
Any suggestions would be greatly appreciated. Thank you.

prepareGWT:

[delete] Deleting directory C:\Users\s235985\workspace\wkflw_test\Approval\gwt-unitCache

[java] Compiling module com.aep.mro.approval.approvalsystem

[java] Computing all possible rebind results for 'gwtupload.client.bundle.UploadCss'

[java] Rebinding gwtupload.client.bundle.UploadCss

[java] Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator

[java] Initializing ResourceGenerator

[java] [ERROR] Unable to determine default for GSS in UiBinder

[java] [ERROR] An internal compiler exception occurred

[java] com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.

[java] at com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:121)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:296)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)

[java] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128)

[java] at com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:67)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)

[java] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128)

[java] at com.google.gwt.dev.jjs.ast.JDeclarationStatement.traverse(JDeclarationStatement.java:49)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor$ListContext.traverse(JModVisitor.java:95)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:351)

[java] at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)

[java] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:149)

[java] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:145)

[java] at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:83)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)

[java] at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:600)

[java] at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:569)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)

[java] at com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:1505)

[java] at com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:870)

[java] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.unifyJavaAst(JavaToJavaScriptCompiler.java:1305)

[java] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.constructJavaAst(JavaToJavaScriptCompiler.java:1038)

[java] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.precompile(JavaToJavaScriptCompiler.java:954)

[java] at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.precompile(MonolithicJavaToJavaScriptCompiler.java:303)

[java] at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:38)

[java] at com.google.gwt.dev.Precompile.precompile(Precompile.java:286)

[java] at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)

[java] at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)

[java] at com.google.gwt.dev.Compiler.run(Compiler.java:206)

[java] at com.google.gwt.dev.Compiler.run(Compiler.java:158)

[java] at com.google.gwt.dev.Compiler$1.run(Compiler.java:120)

[java] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)

[java] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)

[java] at com.google.gwt.dev.Compiler.main(Compiler.java:127)

[java] Caused by: java.lang.NoSuchMethodError: com.google.gwt.util.tools.Utility.close(Ljava/lang/AutoCloseable;)V

[java] at com.google.gwt.resources.rg.ImageResourceGenerator.getContentLength(ImageResourceGenerator.java:623)

[java] at com.google.gwt.resources.rg.ImageResourceGenerator.prepare(ImageResourceGenerator.java:584)

[java] at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.initAndPrepare(AbstractClientBundleGenerator.java:1013)

[java] at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.initAndPrepare(AbstractClientBundleGenerator.java:1039)

[java] at com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator.generateIncrementally(AbstractClientBundleGenerator.java:419)

[java] at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:754)

[java] at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:160)

[java] at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79)

[java] at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276)

[java] at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265)

[java] at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:87)

[java] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createStaticRebindExpression(UnifyAst.java:485)

[java] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createRebindExpression(UnifyAst.java:443)

[java] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:576)

[java] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:306)

[java] at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:248)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)

[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)

[java] ... 40 more

[java] [ERROR] at UploadCss.java(9): GWT.create(UploadCss.class)

[java] com.google.gwt.dev.jjs.ast.JMethodCall

[java] [ERROR] at UploadCss.java(9): (UploadCss) GWT.create(UploadCss.class)

[java] com.google.gwt.dev.jjs.ast.JCastOperation

[java] [ERROR] at UploadCss.java(9): final static UploadCss INSTANCE = (UploadCss) GWT.create(UploadCss.class)

[java] com.google.gwt.dev.jjs.ast.JDeclarationStatement

[java] [ERROR] at UploadCss.java(8): {

[java] final static UploadCss INSTANCE = (UploadCss) GWT.create(UploadCss.class);

[java] }

[java] com.google.gwt.dev.jjs.ast.JBlock

[java] [ERROR] at UploadCss.java(8): {

[java] final static UploadCss INSTANCE = (UploadCss) GWT.create(UploadCss.class);

[java] }

[java] com.google.gwt.dev.jjs.ast.JMethodBody

[java] [ERROR] at UploadCss.java(8): private static final void $clinit();

[java] com.google.gwt.dev.jjs.ast.JMethod

BUILD FAILED

Thomas Broyer

unread,
May 14, 2018, 9:16:18 AM5/14/18
to GWT Users


On Monday, May 14, 2018 at 3:06:09 PM UTC+2, Rachel wrote:
We have to move our project back to GWT 2.7 due to some java 1.8 issues. I've checked all my jar files to make sure they are 2.7 and no duplicate jars in the build path but am getting errors when I try to compile with Ant.
Any suggestions would be greatly appreciated. Thank you.

[java] Caused by: java.lang.NoSuchMethodError: com.google.gwt.util.tools.Utility.close(Ljava/lang/AutoCloseable;)V

[java] at com.google.gwt.resources.rg.ImageResourceGenerator.getContentLength(ImageResourceGenerator.java:623)


So this means you have gwt-user from 2.8 and gwt-dev from 2.7 here.

Rachel

unread,
May 14, 2018, 9:37:34 AM5/14/18
to GWT Users
Thank you for responding. I'm looking at the build path and both gwt-user and gwt-dev jar files are from 2.7. Is there somewhere else I should look?

Thomas Broyer

unread,
May 14, 2018, 12:34:20 PM5/14/18
to GWT Users
Could one of your dependencies possibly "shadow" its own version of ImageResourceGenerator that had been compiled against GWT 2.8? You'd have to revert to an older version of that dependency then.

Rachel

unread,
May 23, 2018, 10:17:21 AM5/23/18
to GWT Users
That could definitely be the issue. Unfortunately, when we move back to a previous version of the project we still get the same error so we think it might be something with the eclipse environment and are going to try a new eclipse install.

JonL

unread,
May 24, 2018, 3:13:04 PM5/24/18
to GWT Users
We have seen similar issues with this when we were experimenting with some projects and upgrading to 2.8.2.  The things to double check are:

1. That there are no duplicate jars from different versions of GWT, as mentions by Thomas Broyer.
2. Delete any GWT generated folder such as the gwt-unitCache, and the script outputs in the war folder and also any GWT generated files in the temp folder.
3. If still running into problems, delete the Eclipse workspace .metadata folder, re-setup the workspace and import the existing projects into the cleaned workspace.

Due to GWT compilation caching, and Eclipse deployment caching, if files do not change during the modification process, they can still reference the the incorrect version of GWT, or the jars that are actually deployed to the location where the Jetty server is run from by eclipse may not be updated.

Ignacio Baca Moreno-Torres

unread,
May 24, 2018, 4:37:04 PM5/24/18
to GWT Users

I sometimes, when I'm a bit desperate, I debug the project, find some classes for the conflicting code using the "Thread.currentThread().getContextClassLoader().loadClass(...)", and use the variable inspector to find the class loader and the actual file that has been used to load the class. At least, you finally found where the hell was the cached class! ;) ... maybe the first time is a bit confusing, but after sometimes, you will solve those mixed/cached classpath problems much faster! 

Reply all
Reply to author
Forward
0 new messages