将GWT升级到v2.4时出错

时间:2012-07-15 12:21:34

标签: java eclipse gwt ant compiler-errors

我正在尝试将GWT升级到v2.4。我遇到了问题。当Run As - > Ant Built(在升级项目之后),.xml文件丢失(未在项目中生成)并且项目构建成功,但是有一些奇怪的行为在控制台中显示错误。我将发布出现的错误(其中一些)。

我使用以下内容:

  • 操作系统是Windows。

  • 我将编译器设为jdk1.7而不是jre1.5。

  • 我在环境变量中设置了这些:classpath指向C:\ Program Files \ Documentum \ dctm.jar; C:\ Documentum \ config;%GWT_HOME%;%GWT_HOME%\ gwt-user.jar; %GWT_HOME%\ GWT-dev.jar;%GWT_HOME%\ GWT-的servlet.jar;%的junit%

  • GWT_HOME D:\ products \ DSS 2012 \ eclipse-jee-indigo-SR2-win32 \ eclipse \ plugins \ com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37 \ gwt-2.4 0.0

  • JAVA_HOME“C:\ Program Files \ Java \ jdk1.7.0_05”

  • junit%JUNIT_HOME%\ junit.jar

  • JUNIT_HOME D:\ products \ DSS 2012 \ eclipse-jee-indigo-SR2-win32 \ eclipse \ plugins \ org.junit_4.8.2.v4_8_2_v20110321-1705

在日食中 - >偏好 - > Java - >编译器 - >编译器合规性级别为1.7

在日食中 - >偏好 - > Java - >已安装的JRE - >将其设置为jdk1.7.0_05

这些是编译过程中出现的一些错误(我得到的结果已成功编译)

[java] Loaded 2283 units from persistent store.
 [java]    Found 2215 cached units.  Used 2215 / 2215 units from cache.
 [java]    Added 0 units to persistent cache.
 [java]    Validating newly compiled units
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/editor/client/EditorDriver.java'
 [java]          Line 20: The import javax.validation.ConstraintViolation cannot be resolved
 [java]          Line 97: ConstraintViolation cannot be resolved to a type
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/editor/client/impl/AbstractSimpleBeanEditorDriver.java'
 [java]          Line 28: Name clash: The method setConstraintViolations(Iterable<ConstraintViolation<?>>) of type BaseEditorDriver<T,E> has the same erasure as setConstraintViolations(Iterable<ConstraintViolation<?>>) of type EditorDriver<T> but does not override it
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/editor/client/impl/BaseEditorDriver.java'
 [java]          Line 31: The import javax.validation.ConstraintViolation cannot be resolved
 [java]          Line 66: ConstraintViolation cannot be resolved to a type
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/editor/client/impl/SimpleViolation.java'
 [java]          Line 25: The import javax.validation.ConstraintViolation cannot be resolved
 [java]          Line 40: ConstraintViolation cannot be resolved to a type
 [java]          Line 43: ConstraintViolation cannot be resolved to a type
 [java]          Line 44: Missing code implementation in the compiler
 [java]          Line 49: ConstraintViolation cannot be resolved to a type
 [java]          Line 49: Missing code implementation in the compiler
 [java]          Line 70: ConstraintViolation cannot be resolved to a type
 [java]          Line 72: ConstraintViolation cannot be resolved to a type
 [java]          Line 73: ConstraintViolation<?> cannot be resolved to a type
 [java]          Line 78: ConstraintViolation<capture#2-of ?> cannot be resolved to a type
 [java]          Line 83: ConstraintViolation<capture#3-of ?> cannot be resolved to a type
 [java]          Line 92: ConstraintViolation<capture#4-of ?> cannot be resolved to a type
 [java]          Line 97: ConstraintViolation<capture#5-of ?> cannot be resolved to a type
 [java]          Line 102: ConstraintViolation cannot be resolved to a type
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/editor/client/testing/MockSimpleBeanEditorDriver.java'
 [java]          Line 26: The import javax.validation.ConstraintViolation cannot be resolved
 [java]          Line 35: The type MockSimpleBeanEditorDriver<T,E> must implement the inherited abstract method EditorDriver<T>.setConstraintViolations(Iterable<ConstraintViolation<?>>)
 [java]          Line 107: Name clash: The method setConstraintViolations(Iterable<ConstraintViolation<?>>) of type MockSimpleBeanEditorDriver<T,E> has the same erasure as setConstraintViolations(Iterable<ConstraintViolation<?>>) of type EditorDriver<T> but does not override it
 [java]          Line 108: ConstraintViolation cannot be resolved to a type
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/validation/client/AbstractGwtValidatorFactory.java'
 [java]          Line 21: The import javax.validation.ConstraintValidatorFactory cannot be resolved
 [java]          Line 23: The import javax.validation.TraversableResolver cannot be resolved
 [java]          Line 24: The import javax.validation.Validator cannot be resolved
 [java]          Line 25: The import javax.validation.ValidatorContext cannot be resolved
 [java]          Line 26: The import javax.validation.ValidatorFactory cannot be resolved
 [java]          Line 57: ValidatorFactory cannot be resolved to a type
 [java]          Line 67: ConstraintValidatorFactory cannot be resolved to a type
 [java]          Line 68: The method create(Class<?>) from the type GWT refers to the missing type ConstraintValidatorFactory
 [java]          Line 68: ConstraintValidatorFactory cannot be resolved to a type
 [java]          Line 75: TraversableResolver cannot be resolved to a type
 [java]          Line 76: The method create(Class<?>) from the type GWT refers to the missing type TraversableResolver
 [java]          Line 76: TraversableResolver cannot be resolved to a type
 [java]          Line 79: Validator cannot be resolved to a type
 [java]          Line 81: The method getConstraintValidatorFactory() from the type AbstractGwtValidatorFactory refers to the missing type ConstraintValidatorFactory
 [java]          Line 82: The method getTraversableResolver() from the type AbstractGwtValidatorFactory refers to the missing type TraversableResolver
 [java]          Line 91: ValidatorContext cannot be resolved to a type
 [java]          Line 92: The method create(Class<?>) from the type GWT refers to the missing type ValidatorContext
 [java]          Line 92: ValidatorContext cannot be resolved to a type
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/validation/client/BaseGwtConfiguration.java'
 [java]          Line 23: The import javax.validation.ConstraintValidatorFactory cannot be resolved
 [java]          Line 25: The import javax.validation.TraversableResolver cannot be resolved
 [java]          Line 26: The import javax.validation.ValidatorFactory cannot be resolved
 [java]          Line 27: The import javax.validation.spi.BootstrapState cannot be resolved
 [java]          Line 40: BootstrapState cannot be resolved to a type
 [java]          Line 43: BootstrapState cannot be resolved to a type
 [java]          Line 45: BootstrapState cannot be resolved to a type
 [java]          Line 53: ValidatorFactory cannot be resolved to a type
 [java]          Line 55: The method buildValidatorFactory(ConfigurationState) from the type GwtValidationProvider refers to the missing type ValidatorFactory
 [java]          Line 59: ConstraintValidatorFactory cannot be resolved to a type
 [java]          Line 64: ConstraintValidatorFactory cannot be resolved to a type
 [java]          Line 65: The method create(Class<?>) from the type GWT refers to the missing type ConstraintValidatorFactory
 [java]          Line 65: ConstraintValidatorFactory cannot be resolved to a type
 [java]          Line 72: TraversableResolver cannot be resolved to a type
 [java]          Line 73: The method create(Class<?>) from the type GWT refers to the missing type TraversableResolver
 [java]          Line 73: TraversableResolver cannot be resolved to a type
 [java]          Line 88: TraversableResolver cannot be resolved to a type
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/validation/client/BaseMessageInterpolator.java'
 [java]          Line 26: The import javax.validation.metadata cannot be resolved
 [java]          Line 41: ConstraintDescriptor cannot be resolved to a type
 [java]          Line 44: ConstraintDescriptor cannot be resolved to a type
 [java]          Line 45: ConstraintDescriptor<?> cannot be resolved to a type
 [java]          Line 49: ConstraintDescriptor cannot be resolved to a type
 [java]          Line 50: ConstraintDescriptor<capture#2-of ?> cannot be resolved to a type
 [java]          Line 134: The method getConstraintDescriptor() from the type MessageInterpolator.Context refers to the missing type ConstraintDescriptor
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/validation/client/GwtConstraintValidatorFactory.java'
 [java]          Line 18: The import javax.validation.ConstraintValidator cannot be resolved
 [java]          Line 19: The import javax.validation.ConstraintValidatorFactory cannot be resolved
 [java]          Line 46: ConstraintValidatorFactory cannot be resolved to a type
 [java]          Line 53: ConstraintValidator cannot be resolved to a type
 [java]          Line 55: ConstraintValidatorFactory cannot be resolved to a type
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/validation/client/GwtTraversableResolver.java'
 [java]          Line 20: The import javax.validation.Path cannot be resolved
 [java]          Line 21: The import javax.validation.Path cannot be resolved
 [java]          Line 22: The import javax.validation.TraversableResolver cannot be resolved
 [java]          Line 30: TraversableResolver cannot be resolved to a type
 [java]          Line 33: Node cannot be resolved to a type
 [java]          Line 34: Path cannot be resolved to a type
 [java]          Line 40: Node cannot be resolved to a type
 [java]          Line 41: Path cannot be resolved to a type
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/validation/client/GwtValidationProviderResolver.java'
 [java]          Line 24: The import javax.validation.ValidationProviderResolver cannot be resolved
 [java]          Line 25: The import javax.validation.spi.ValidationProvider cannot be resolved
 [java]          Line 35: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 37: ValidationProvider cannot be resolved to a type
 [java]          Line 38: The method createValidationProviderList() from the type GwtValidationProviderResolver refers to the missing type ValidationProvider
 [java]          Line 40: ValidationProvider cannot be resolved to a type
 [java]          Line 41: ValidationProvider cannot be resolved to a type
 [java]          Line 41: ValidationProvider cannot be resolved to a type
 [java]          Line 42: ValidationProvider cannot be resolved to a type
 [java]          Line 42: The method create(Class<?>) from the type GWT refers to the missing type ValidationProvider
 [java]          Line 42: ValidationProvider cannot be resolved to a type
 [java]          Line 47: ValidationProvider cannot be resolved to a type
 [java]          Line 48: Missing code implementation in the compiler
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/validation/client/GwtValidatorContext.java'
 [java]          Line 21: The import javax.validation.ConstraintValidatorFactory cannot be resolved
 [java]          Line 23: The import javax.validation.TraversableResolver cannot be resolved
 [java]          Line 24: The import javax.validation.Validator cannot be resolved
 [java]          Line 25: The import javax.validation.ValidatorContext cannot be resolved
 [java]          Line 26: The import javax.validation.ValidatorFactory cannot be resolved
 [java]          Line 34: ValidatorContext cannot be resolved to a type
 [java]          Line 36: ValidatorFactory cannot be resolved to a type
 [java]          Line 38: ConstraintValidatorFactory cannot be resolved to a type
 [java]          Line 38: The method getConstraintValidatorFactory() from the type AbstractGwtValidatorFactory refers to the missing type ConstraintValidatorFactory
 [java]          Line 40: TraversableResolver cannot be resolved to a type
 [java]          Line 40: The method getTraversableResolver() from the type AbstractGwtValidatorFactory refers to the missing type TraversableResolver
 [java]          Line 42: ValidatorContext cannot be resolved to a type
 [java]          Line 43: ConstraintValidatorFactory cannot be resolved to a type
 [java]          Line 45: ConstraintValidatorFactory cannot be resolved to a type
 [java]          Line 45: ConstraintValidatorFactory cannot be resolved to a type
 [java]          Line 47: ConstraintValidatorFactory cannot be resolved to a type
 [java]          Line 52: Validator cannot be resolved to a type
 [java]          Line 54: ConstraintValidatorFactory cannot be resolved to a type
 [java]          Line 55: TraversableResolver cannot be resolved to a type
 [java]          Line 59: ValidatorContext cannot be resolved to a type
 [java]          Line 69: ValidatorContext cannot be resolved to a type
 [java]          Line 70: TraversableResolver cannot be resolved to a type
 [java]          Line 72: TraversableResolver cannot be resolved to a type
 [java]          Line 72: TraversableResolver cannot be resolved to a type
 [java]          Line 74: TraversableResolver cannot be resolved to a type
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/validation/client/Validation.java'
 [java]          Line 23: The import javax.validation.ValidationException cannot be resolved
 [java]          Line 24: The import javax.validation.ValidationProviderResolver cannot be resolved
 [java]          Line 25: The import javax.validation.ValidatorFactory cannot be resolved
 [java]          Line 26: The import javax.validation.bootstrap cannot be resolved
 [java]          Line 27: The import javax.validation.bootstrap cannot be resolved
 [java]          Line 28: The import javax.validation.spi.BootstrapState cannot be resolved
 [java]          Line 29: The import javax.validation.spi.ValidationProvider cannot be resolved
 [java]          Line 93: GenericBootstrap cannot be resolved to a type
 [java]          Line 94: BootstrapState cannot be resolved to a type
 [java]          Line 96: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 97: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 100: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 100: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 101: The method getDefaultValidationProviderResolver() from the type Validation.GenericBootstrapImpl refers to the missing type ValidationProviderResolver
 [java]          Line 101: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 103: ValidationProvider cannot be resolved to a type
 [java]          Line 107: ValidationException cannot be resolved to a type
 [java]          Line 113: ValidationException cannot be resolved to a type
 [java]          Line 121: ValidationException cannot be resolved to a type
 [java]          Line 128: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 129: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 130: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 130: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 132: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 135: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 136: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 139: GenericBootstrap cannot be resolved to a type
 [java]          Line 139: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 140: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 147: ValidationProvider cannot be resolved to a type
 [java]          Line 148: ProviderSpecificBootstrap cannot be resolved to a type
 [java]          Line 150: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 166: ValidationException cannot be resolved to a type
 [java]          Line 171: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 172: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 172: The method getDefaultValidationProviderResolver() from the type Validation.GenericBootstrapImpl refers to the missing type ValidationProviderResolver
 [java]          Line 175: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 178: ValidationProvider cannot be resolved to a type
 [java]          Line 180: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 182: ValidationException cannot be resolved to a type
 [java]          Line 186: ValidationProvider cannot be resolved to a type
 [java]          Line 190: ValidationProvider cannot be resolved to a type
 [java]          Line 190: ValidationProvider cannot be resolved to a type
 [java]          Line 194: ValidationException cannot be resolved to a type
 [java]          Line 206: ProviderSpecificBootstrap cannot be resolved to a type
 [java]          Line 207: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 208: ValidationProviderResolver cannot be resolved to a type
 [java]          Line 227: ValidatorFactory cannot be resolved to a type
 [java]          Line 228: The method byDefaultProvider() from the type Validation refers to the missing type GenericBootstrap
 [java]          Line 248: GenericBootstrap cannot be resolved to a type
 [java]          Line 276: ValidationProvider cannot be resolved to a type
 [java]          Line 277: ProviderSpecificBootstrap cannot be resolved to a type
 [java]          Line 278: Bound mismatch: The type U is not a valid substitute for the bounded parameter <U extends ValidationProvider<T>> of the type Validation.ProviderSpecificBootstrapImpl<T,U>
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/validation/client/constraints/AbstractDecimalMaxValidator.java'
 [java]          Line 20: The import javax.validation.ConstraintValidator cannot be resolved
 [java]          Line 21: The import javax.validation.constraints.DecimalMax cannot be resolved
 [java]          Line 31: ConstraintValidator cannot be resolved to a type
 [java]          Line 31: DecimalMax cannot be resolved to a type
 [java]          Line 39: DecimalMax cannot be resolved to a type
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/validation/client/constraints/AbstractDecimalMinValidator.java'
 [java]          Line 20: The import javax.validation.ConstraintValidator cannot be resolved
 [java]          Line 21: The import javax.validation.constraints.DecimalMin cannot be resolved
 [java]          Line 30: ConstraintValidator cannot be resolved to a type
 [java]          Line 30: DecimalMin cannot be resolved to a type
 [java]          Line 34: DecimalMin cannot be resolved to a type
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/validation/client/constraints/AbstractDigitsValidator.java'
 [java]          Line 20: The import javax.validation.ConstraintValidator cannot be resolved
 [java]          Line 21: The import javax.validation.constraints.Digits cannot be resolved
 [java]          Line 30: ConstraintValidator cannot be resolved to a type
 [java]          Line 30: Digits cannot be resolved to a type
 [java]          Line 35: Digits cannot be resolved to a type
 [java]       Errors in 'jar:file:/D:/products/DSS%202012/eclipse-jee-indigo-SR2-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201205021203-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/gwt/validation/client/constraints/AbstractMaxValidator.java'
 [java]          Line 21: The import javax.validation.ConstraintValidator cannot be resolved
 [java]          Line 22: The import javax.validation.constraints.Max cannot be resolved
 [java]          Line 29: ConstraintValidator cannot be resolved to a type
 [java]          Line 29: Max cannot be resolved to a type
 [java]          Line 33: Max cannot be resolved to a type

我不知道该怎么办。请任何帮助。

谢谢和问候,

阿里

2 个答案:

答案 0 :(得分:3)

您必须将validation-api-1.0.0.GA.jarvalidation-api-1.0.0.GA-sources.jar添加到类路径中。

顺便说一句,您在类路径中不需要gwt-servlet.jar,因为它是gwt-user.jargwt-dev.jar的子集;并且你应该将编译器合规级别设置为1.6,因为GWT还没有(还)支持Java 7功能(你可以使用JDK 7 - 除非你使用请求工厂,否则你需要升级到GWT 2.5.0-rc1然后 - 但你必须保持编译器符合1.6,或者至少确保你不使用任何Java 7功能-diamond操作符,打开字符串等.-)。

答案 1 :(得分:2)

有两点:

  1. GWT 2.4(源代码)仅与Java 6兼容。因此,您无法使用Java 7功能,因为它们无法使用GWT编译器进行编译。这就是为什么你应该使用1.6作为合规级别。
  2. GWT 2.4的编辑器框架要求验证api(javax.validation)才能正常工作。 validation-api-1.0.0.GA.jar和validation-api-1.0.0.GA-sources.jar应包含在您下载的GWT发行版中。将它们包含在类路径中。