如何解决,Gwt编译错误:是指我的playN项目中缺少类型“classname”?

时间:2012-03-23 09:49:23

标签: gwt maven compiler-errors playn

我在playN项目中收到了很多gwt编译错误。任何人都可以给我一个暗示吗?这些是maven项目。

[       'jar:file:/home/user/.m2/repository/com/google/gwt/gwt-user/2.4.0/gwt-user-2.4.0.jar!/ com / google / gwt / logging /中的错误服务器/ RemoteLoggingServiceUtil.java'

     Line 69: The method logRecordFromJson(String) from the type JsonLogRecordServerUtil refers to the missing type JSONException

  Errors in 'jar:file:/home/user/.m2/repository/com/google/gwt/gwt-user/2.4.0/gwt-user-2.4.0.jar!/com/google/gwt/logging/server/StackTraceDeobfuscator.java'

     Line 53: No source code is available for type java.util.regex.Pattern; did you forget to inherit a required module?

     Line 60: No source code is available for type java.io.File; did you forget to inherit a required module?

     Line 176: No source code is available for type java.io.InputStream; did you forget to inherit a required module?

     Line 180: No source code is available for type java.io.FileInputStream; did you forget to inherit a required module?

     Line 206: No source code is available for type java.io.BufferedReader; did you forget to inherit a required module?

     Line 207: No source code is available for type java.io.InputStreamReader; did you forget to inherit a required module?

     Line 239: No source code is available for type java.util.regex.Matcher; did you forget to inherit a required module?

  Errors in 'jar:file:/home/user/.m2/repository/com/google/gwt/gwt-user/2.4.0/gwt-user-2.4.0.jar!/com/google/gwt/place/rebind/PlaceHistoryGeneratorContext.java'

     Line 196: The method format(String, String, String) is undefined for the type String

     Line 202: The method format(String, String, String, String) is undefined for the type String

     Line 212: The method format(String, String, String, String) is undefined for the type String

     Line 285: The method getCanonicalName() is undefined for the type Class<capture#2-of ? extends PlaceTokenizer<?>>

     Line 289: The method getSimpleName() is undefined for the type Class<WithTokenizers>

     Line 290: The method getCanonicalName() is undefined for the type Class<capture#4-of ? extends PlaceTokenizer<?>>

3 个答案:

答案 0 :(得分:2)

GWT并不支持所有包java.io。

有关详细信息,请参阅JRE Emulation Reference

在浏览器中模拟文件/流是没有意义的。

答案 1 :(得分:2)

您正在使用未在GWT中启用的java.util.regex.Pattern等Java标准类。有关允许在GWT中使用哪些标准类的信息,请参阅the JRE-Emulation reference

编辑:如果此代码实际发生在普通服务器端类中,则GWT模块定义错误并包含服务器端代码。

答案 2 :(得分:0)

问题是我使用了一些不受支持的Java类。

但奇怪的是我没有直接使用它。我继承了一个纯GWT项目的类,它具有与标准Java项目相同的包声明。因此即使我没有使用GWT不支持的任何Java类,它也在编译我的Java项目中的所有代码。

[已解决]我刚刚将这两个项目的包名称不同(我继承的GWT项目和标准Java项目)。

似乎对其他人有帮助。