编译项目时,我得到了这个模糊的异常
Looking for precompiled archives. To disable, use -Dgwt.usearchives=false
Loading archived module: jar:file:<base>/.m2/repository/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar!/com/google/gwt/user/User.gwtar
[WARN] Unable to read: jar:file:<base>/.m2/repository/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar!/com/google/gwt/user/User.gwtar. Skipping: java.io.InvalidClassException: com.google.gwt.dev.util.DiskCacheToken; local class incompatible: stream classdesc serialVersionUID = 3824090149180578568, local class serialVersionUID = -2622986784335128516
Loading archived module: jar:file:<base>/.m2/repository/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar!/com/google/gwt/core/Core.gwtar
[WARN] Unable to read: jar:file:<base>/.m2/repository/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar!/com/google/gwt/core/Core.gwtar. Skipping: java.io.InvalidClassException: com.google.gwt.dev.util.DiskCacheToken; local class incompatible: stream classdesc serialVersionUID = 3824090149180578568, local class serialVersionUID = -2622986784335128516
Loading archived module: jar:file:<base>/.m2/repository/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar!/com/google/gwt/regexp/RegExp.gwtar
[WARN] Unable to read: jar:file:<base>/.m2/repository/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar!/com/google/gwt/regexp/RegExp.gwtar. Skipping: java.io.InvalidClassException: com.google.gwt.dev.util.DiskCacheToken; local class incompatible: stream classdesc serialVersionUID = 3824090149180578568, local class serialVersionUID = -2622986784335128516
Loading archived module: jar:file:<base>/.m2/repository/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar!/com/google/web/bindery/event/Event.gwtar
Loading archived module: jar:file:<base>/.m2/repository/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar!/com/google/gwt/xml/XML.gwtar
[WARN] Unable to read: jar:file:<base>/.m2/repository/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar!/com/google/gwt/xml/XML.gwtar. Skipping: java.io.InvalidClassException: com.google.gwt.dev.util.DiskCacheToken; local class incompatible: stream classdesc serialVersionUID = 3824090149180578568, local class serialVersionUID = -2622986784335128516
Loading archived module: jar:file:<base>/.m2/repository/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar!/com/google/gwt/json/JSON.gwtar
[WARN] Unable to read: jar:file:<base>/.m2/repository/com/google/gwt/gwt-user/2.5.0/gwt-user-2.5.0.jar!/com/google/gwt/json/JSON.gwtar. Skipping: java.io.InvalidClassException: com.google.gwt.dev.util.DiskCacheToken; local class incompatible: stream classdesc serialVersionUID = 3824090149180578568, local class serialVersionUID = -2622986784335128516
Found 0 cached/archived units. Used 0 / 4578 units from cache.
Compiling...
0% complete (ETR: 93 seconds)
10% complete (ETR: 56 seconds)
20% complete (ETR: 37 seconds)
30% complete (ETR: 25 seconds)
40% complete (ETR: 18 seconds)
50% complete (ETR: 14 seconds)
60% complete (ETR: 10 seconds)
70% complete (ETR: 7 seconds)
80% complete (ETR: 5 seconds)
90% complete (ETR: 2 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 28.40 seconds
[ERROR] Unexpected internal compiler error
java.lang.IncompatibleClassChangeError: class com.google.gwt.dev.javac.BytecodeSignatureMaker$CompileDependencyVisitor has interface com.google.gwt.dev.asm.ClassVisitor as super class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.google.gwt.dev.javac.BytecodeSignatureMaker.visitCompileDependenciesInBytecode(BytecodeSignatureMaker.java:217)
at com.google.gwt.dev.javac.BytecodeSignatureMaker.getCompileDependencySignature(BytecodeSignatureMaker.java:199)
at com.google.gwt.dev.javac.CompiledClass.getSignatureHash(CompiledClass.java:152)
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:311)
at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:511)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:434)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:420)
at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:485)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:241)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:223)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:139)
at com.google.gwt.dev.Compiler.run(Compiler.java:167)
at com.google.gwt.dev.Compiler.run(Compiler.java:132)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:99)
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:106)
Shutting down PersistentUnitCache thread
我可以从哪里开始寻找问题?
答案 0 :(得分:8)
请在删除所有生成的存根并再次重新编译项目后再次尝试。
我已经突出显示了需要删除的所有存根,如下面的快照所示。
以下是需要删除的文件夹列表(名称可能因GWT项目编译模块名称而异)。
答案 1 :(得分:5)
在我的情况下,我不得不从我的类路径中删除asm 3.1,并且有几个jar对asm 3.1有内部依赖。我不得不从我的pom中的依赖中排除。例如:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>2.7.18</version>
<exclusions>
<exclusion> <!-- exclude version 3 of asm -->
<groupId>asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
</exclusions>
</dependency>
还有其他具有此类内部依赖性的jar,使用maven依赖树来识别。并排除asm依赖。
注意:您甚至可以将这些罐升级到更高版本,这些版本实际上支持更高版本的ASM(> 4.0),这对于GWT 2.7或2.8应该没问题
答案 2 :(得分:4)
在我的情况下,我不得不排除来自hibernate验证器库的asm artefact,所以你可以在你的gwt模块的maven配置中排除任何asm artefact。
答案 3 :(得分:2)
当我在编译期间在我的类路径上有gwt-servlet.jar
时,这发生在我身上。如果使用maven,请将gwt-servlet.jar
的依赖关系标记(设置范围)为provided
答案 4 :(得分:1)
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>4.0</version>
</dependency>
我将asm版本迁移到4.0并解决了问题
答案 5 :(得分:1)
当我将gwt从2.6.1迁移到2.8时,我遇到了同样的问题。实际上这个错误是由asm依赖引起的。您的某些服务器依赖项对asm具有内部依赖性。在我的情况下它的cglib。所以我将cglib更改为cglib-nodep并且工作正常: - )
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>3.2.1</version>
</dependency>
答案 6 :(得分:0)
对我来说,我没有使用gwt-servlet.jar,依赖项引用它的旧版本。我添加了最新的(匹配我的gwt-user.jar)作为常规依赖项,然后Maven知道只使用最新版本。您可以使用 mvn dependency:tree -Dverbose
检查依赖关系树答案 7 :(得分:0)
在我的项目中,模块化GWT应用程序,我不得不将gwt-dev的依赖项添加到启动整个应用程序的模块中。
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<scope>provided</scope>
</dependency>