Reputation: 579
In Eclipse, I have a maven project going on, and I'm adding GWT into it. (So this is not a Google Web Application project) I laid down the gwt parts, and the "GWT Compile..." command failed with message attached at the end. I found removing the tika artifact in maven, which has an asm dependency, helped to continue the gwt compiling.
Another issue was when I tried to start dev mode, the gwt sdk's JettyLauncher failed to start, I guess mainly due to the existence of jetty 9.3 in my pom.xml.
Does any eclipse user have a workaround for these kinds of errors? I think it'd be peaceful if there is a way to let gwt sdk run on its own dependency (both of these conflicts should not affect prod deployment, it's just google eclipse plugin tools somehow depend on the project's classpath).
I could separate the gwt part into a different project, but it's obviously much more convenient to have them together.
GWT Compile error:
[ERROR] Unexpected internal compiler error
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:78)
at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:63)
at com.google.gwt.dev.javac.BytecodeSignatureMaker$CompileDependencyVisitor.<init>(BytecodeSignatureMaker.java:59)
at com.google.gwt.dev.javac.BytecodeSignatureMaker.visitCompileDependenciesInBytecode(BytecodeSignatureMaker.java:227)
at com.google.gwt.dev.javac.BytecodeSignatureMaker.getCompileDependencySignature(BytecodeSignatureMaker.java:209)
at com.google.gwt.dev.javac.CompiledClass.getSignatureHash(CompiledClass.java:166)
at com.google.gwt.dev.javac.Dependencies$Ref.<init>(Dependencies.java:42)
at com.google.gwt.dev.javac.Dependencies$Ref.<init>(Dependencies.java:37)
at com.google.gwt.dev.javac.Dependencies.resolve(Dependencies.java:114)
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:366)
at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:580)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:513)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:499)
at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:668)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:255)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
at com.google.gwt.dev.Compiler.run(Compiler.java:206)
at com.google.gwt.dev.Compiler.run(Compiler.java:158)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:120)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
at com.google.gwt.dev.Compiler.main(Compiler.java:127)
Error when starting dev mode:
Exception in thread "main" java.lang.NoSuchMethodError: org.eclipse.jetty.server.AbstractConnector: method <init>()V not found
at org.eclipse.jetty.server.nio.AbstractNIOConnector.<init>(AbstractNIOConnector.java:30)
at org.eclipse.jetty.server.nio.SelectChannelConnector.<init>(SelectChannelConnector.java:82)
at com.google.gwt.dev.shell.jetty.JettyLauncher.getConnector(JettyLauncher.java:803)
at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:729)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:632)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1054)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)
at com.google.gwt.dev.DevMode.main(DevMode.java:413)
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:78)
at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:63)
at com.google.gwt.dev.javac.BytecodeSignatureMaker$CompileDependencyVisitor.<init>(BytecodeSignatureMaker.java:59)
at com.google.gwt.dev.javac.BytecodeSignatureMaker.visitCompileDependenciesInBytecode(BytecodeSignatureMaker.java:227)
at com.google.gwt.dev.javac.BytecodeSignatureMaker.getCompileDependencySignature(BytecodeSignatureMaker.java:209)
at com.google.gwt.dev.javac.CompiledClass.getSignatureHash(CompiledClass.java:166)
at com.google.gwt.dev.javac.Dependencies.validateClass(Dependencies.java:178)
at com.google.gwt.dev.javac.Dependencies.validate(Dependencies.java:135)
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.removeInvalidCachedUnitsAndRescheduleCorrespondingBuilders(CompilationStateBuilder.java:430)
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:369)
at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:580)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:513)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:499)
at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:668)
at com.google.gwt.dev.codeserver.Recompiler.initWithoutPrecompile(Recompiler.java:200)
at com.google.gwt.dev.codeserver.Outbox.maybePrecompile(Outbox.java:82)
at com.google.gwt.dev.codeserver.Outbox.<init>(Outbox.java:61)
at com.google.gwt.dev.codeserver.CodeServer.makeOutboxes(CodeServer.java:156)
at com.google.gwt.dev.codeserver.CodeServer.start(CodeServer.java:118)
at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:91)
at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.google.gwt.dev.shell.SuperDevListener$1.run(SuperDevListener.java:84)
Upvotes: 3
Views: 2448
Reputation: 579
So, after some digging, I found workarounds for both 2 issues.
1) GWT compile error:
I go through all hidden asm-* dependencies, and found one (asm-debug-all) used by tika (1.9 in my case) is 4.x.x, while all other asm-dependencies are 5.0.3. I specified an explicit dependency of 5.0.3 of asm-debug-all, and the gwt compiler was happy.
2) GWT's DevMode launch:
After reading https://github.com/gwtproject/gwt/issues/8712, I was pretty sure the jetty in DevMode should be an old version (it is a 8.x.y as I got from the log, for gwt 2.7.0). Unable to run mavenized GWT application in eclipse with embedded Tomcat suggested overriding ServletContainerLauncher, which I have no idea how to achieve, and running a separate Tomcat server to serve as a host for the codeserver. After tinkering with the launch profile, I learned the order of the libs in classpath could be altered, so I moved gwt-dev above the project's src classpath, and bingo, the DevMode runs smoothly!
note: adding gwt-codeserver dependency in maven, and make it above jetty entry would also let DevMode work, but with that the real Jetty needed will also run with the 8.x.y version.
Upvotes: 3