1

Errai GWT アプリ (GWT バージョン: 2.5.1、Errai バージョン: 3.0.0.Final) が動作しており、gwt.xml に Errai Validation を追加するだけです (POM に依存関係を追加した後):

  <inherits name="org.hibernate.validator.HibernateValidator" />
  <inherits name="org.jboss.errai.validation.Validation" />

このエラーをスローします:

Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
   [ERROR] Errors in '/tmp/gwt-codeserver-2599039351007089711.tmp/com.myapp.App/compile-1/gen/org/jboss/errai/validation/client/ValidatorFactoryImpl.java'
      [ERROR] Line 9: The value for annotation attribute GwtValidation.groups must be an array initializer
      [ERROR] Line 9: The value for annotation attribute GwtValidation.value must be an array initializer
      See snapshot: /tmp/org.jboss.errai.validation.client.ValidatorFactoryImpl2638227711022430113.java
   [ERROR] Errors in 'com/google/gwt/validation/client/spi/GwtValidationProvider.java'
      [ERROR] Line 38: Rebind result 'org.jboss.errai.validation.client.ValidatorFactoryImpl' could not be found
[ERROR] Compiler returned false
4

1 に答える 1

1

「ネイティブ」GWT 検証と Errai 検証が混在していると思いますが、GWT 検証は hibernate-validator-4.1.0 でのみ機能します。

Errai では、独自の ValidationFactory を作成する必要はなく、Validator を @Inject するだけです。

于 2015-02-02T15:48:57.347 に答える