当我在添加新的vaadin插件后尝试编译窗口小部件时,出现以下错误
[ERROR] Unexpected internal compiler error
java.lang.NoClassDefFoundError: com/google/gwt/thirdparty/guava/common/collect/Queues
at com.google.gwt.dev.cfg.ModuleDef.computeLibraryDependencyGraph(ModuleDef.java:1045)
at com.google.gwt.dev.cfg.ModuleDef.normalize(ModuleDef.java:949)
at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:236)
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromResources(ModuleDefLoader.java:167)
at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:138)
at com.google.gwt.dev.Compiler.run(Compiler.java:156)
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)
at com.vaadin.tools.WidgetsetCompiler$1.run(WidgetsetCompiler.java:80)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.google.gwt.thirdparty.guava.common.collect.Queues
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
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)
... 12 more
Widgetset compilation failed
我检查了所有依赖项jar中是否没有名称为 com.google.gwt.thirdparty.guava.common.collect.Queues 的类。但是,当我检查方法 com.google.gwt.dev.cfg.ModuleDef.computeLibraryDependencyGraph 时,它实际上是指 com.google.common.collect.Queues 。那么,为什么类加载器尝试加载 com.google.gwt.thirdparty.guava.common.collect.Queues ?
Ivy.xml
<?xml version="1.0"?>
<!DOCTYPE ivy-module [
<!ENTITY vaadin.version "7.6.2">
]>
<ivy-module version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="com.example" module="v7proj" />
<configurations>
<!-- The default configuration, which should be deployed to the server -->
<conf name="default" />
<!-- A configuration only needed when compiling the widget set. Should
not be deployed to the server -->
<conf name="widgetset-compile" />
<!-- A configuration used in compilation of server side classes only.
Should be deployed to the server -->
<conf name="nodeploy" />
</configurations>
<dependencies defaultconf="default" defaultconfmapping="default->default">
<!-- The core server part of Vaadin -->
<dependency org="com.vaadin" name="vaadin-server" rev="&vaadin.version;" />
<!-- Vaadin themes -->
<dependency org="com.vaadin" name="vaadin-themes" rev="&vaadin.version;" />
<!-- Push support -->
<dependency org="com.vaadin" name="vaadin-push" rev="&vaadin.version;" />
<!-- Servlet 3.0 API -->
<dependency org="javax.servlet" name="javax.servlet-api" rev="3.0.1" conf="nodeploy->default" />
<!-- Precompiled DefaultWidgetSet -->
<dependency org="com.vaadin" name="vaadin-client-compiled"
rev="&vaadin.version;" />
<!-- Vaadin client side, needed for widget set compilation -->
<dependency org="com.vaadin" name="vaadin-client" rev="&vaadin.version;"
conf="widgetset-compile->default" />
<!-- Compiler for custom widget sets. Should not be deployed -->
<dependency org="com.vaadin" name="vaadin-client-compiler"
rev="&vaadin.version;" conf="widgetset-compile->default" />
</dependencies>
</ivy-module>
编辑:-
我检查了添加项的依赖关系,并找到了另一个已经存在的jar版本。添加新的jar之后,编译窗口小部件集时出现以下错误
[ERROR] Unexpected internal compiler error
java.lang.NoSuchMethodError: com.google.gwt.thirdparty.guava.common.io.Files.hash(Ljava/io/File;Lcom/google/gwt/thirdparty/guava/common/hash/HashFunction;)Lcom/google/gwt/thirdparty/guava/common/hash/HashCode;
at com.google.gwt.dev.javac.PersistentUnitCache.computePersistentCacheFilenamePrefix(PersistentUnitCache.java:480)
at com.google.gwt.dev.javac.PersistentUnitCache.<clinit>(PersistentUnitCache.java:116)
at com.google.gwt.dev.javac.UnitCacheSingleton.get(UnitCacheSingleton.java:61)
at com.google.gwt.dev.Compiler.getOrCreateUnitCache(Compiler.java:92)
at com.google.gwt.dev.Compiler.run(Compiler.java:189)
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)
at com.vaadin.tools.WidgetsetCompiler$1.run(WidgetsetCompiler.java:80)
at java.lang.Thread.run(Thread.java:745)
Widgetset compilation failed
相互依赖的依赖项是:guava-15.0和guava-16.0.1.vaadin1。