0

GWT を v2.4 にアップグレードしようとしています。私は問題に直面しています。Run As -> Ant Built (プロジェクトのアップグレード後) の場合、.xml ファイルが見つからず (プロジェクトで生成されず)、プロジェクトは正常にビルドされますが、コンソールにエラーが表示される奇妙な動作があります。表示されているエラーを投稿します(一部)。

私は以下を使用しています:

  • オペレーティング システムは Windows です。

  • コンパイラを jre1.5 ではなく jdk1.7 にします。

  • 環境変数でこれらを設定します: 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

  • 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

Eclipse --> 設定 --> Java --> コンパイラ --> コンパイラ準拠レベルを 1.7 に

Eclipse --> Preferences --> Java --> Installed JREs --> 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

どうすればいいのかわからない。助けてください。

よろしくお願いいたします。

アリ

4

2 に答える 2

3

クラスパスにvalidation-api-1.0.0.GA.jarandを追加する必要があります。validation-api-1.0.0.GA-sources.jar

ところで、これはandgwt-servlet.jarのサブセットであるため、クラスパスには必要ありません。また、GWT は (まだ) Java 7 機能をサポートしていないため、コンパイラ準拠レベルを 1.6 に設定する必要があります (JDK 7 を使用できますが、リクエスト ファクトリを使用する場合を除き、GWT 2.5.0-rc1 にアップグレードする必要があります)。 – ただし、コンパイラの準拠を 1.6 に維持するか、少なくとも Java 7 の機能 (ダイアモンド演算子、文字列のスイッチなど) を使用しないようにする必要があります。gwt-user.jargwt-dev.jar

于 2012-07-15T13:41:21.740 に答える
2

ポイントは 2 つあります。

  1. GWT 2.4 は (ソース) Java 6 とのみ互換性があります。したがって、Java 7 の機能は GWT コンパイラを使用してコンパイルされないため、使用できません。そのため、コンプライアンス レベルとして 1.6 を使用する必要があります。
  2. GWT 2.4 のエディター フレームワークが正しく機能するには、検証 API (javax.validation) が必要です。ダウンロードした GWT ディストリビューションには、validation-api-1.0.0.GA.jar と validation-api-1.0.0.GA-sources.jar が含まれている必要があります。それらをクラスパスに含めます。
于 2012-07-15T13:49:31.553 に答える