2

将我的开发环境转移到一台新的笔记本电脑上并遇到以下错误(这绝不是一个轻松的过程)。所以,我所拥有的是:Windows 8、Intellij Idea 12、GWT 2.5.1,配置了一个只产生“ GWT compile output”的简单工件:

Information: Compilation completed with 6 errors and 0 warnings in 25 sec
Information: 6 errors
Information: 0 warnings
Error: GWT Compiler: The import com.google.gwt.user.client.UserAgentAsserter cannot be resolved
Error: GWT Compiler: UserAgentProperty cannot be resolved to a type
Error: GWT Compiler: The method create(Class<?>) from the type GWT refers to the missing type UserAgentProperty
Error: GWT Compiler: UserAgentProperty cannot be resolved to a type
Error: GWT Compiler: UserAgentProperty cannot be resolved to a type
<-> D:\Projects\MyProject\src\main\java\com\myproject\RichClient.gwt.xml
     Error: GWT Compiler: Aborting compile due to errors in some input files

在旧笔记本电脑上构建工作正常(Win7 上的环境相同),尽管我在 gwt.xml 文件中看不到任何差异。也许缺少手动添加到旧配置而不是通过存储库签出的东西,但现在我只能猜测。我试图从 client.gwt.xml 中删除/注释与user.agent属性设置相关的所有行,例如

<set-property name="user.agent" value="gecko1_8,safari"/>

但没有任何变化,我仍然看到相同的“6 个错误”消息。

我将不胜感激有关为什么会出现此错误的任何线索。谢谢。

UPD。 将我的 RichClient.gwt.xml 文件的代码减少到

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='richclient'>
    <!-- Inherit the core Web Toolkit stuff. -->
    <inherits name='com.google.gwt.user.User' />
</module>

(没有设置入口点)并且仍然得到相同的错误。

4

1 回答 1

0

后来发现这个。未包含在原始项目的 lib 路径中但设法潜入新配置的过时 jar。

 Validating units:
      [ERROR] Errors in 'jar:file:/D:/Projects/myProject/src/main/webapp/WEB-INF/lib/css3pie-0.1.jar!/com/google/gwt/user/client/UserAgentInfo.java'
         [ERROR] Line 19: The import com.google.gwt.user.client.UserAgentAsserter cannot be resolved
         [ERROR] Line 23: UserAgentProperty cannot be resolved to a type
         [ERROR] Line 23: The method create(Class<?>) from the type GWT refers to the missing type UserAgentProperty
         [ERROR] Line 23: UserAgentProperty cannot be resolved to a type
         [ERROR] Line 26: UserAgentProperty cannot be resolved to a type
         [ERROR] Line 26: UserAgentProperty cannot be resolved to a type
         [ERROR] Line 40: UserAgentProperty cannot be resolved to a type

取下罐子就可以了。

于 2013-11-12T10:08:04.287 回答