GWT アプリケーション (GWT 2.4) で GIN とカスタム Bean バリデーターを組み合わせるのを手伝ってくれませんか?
GWT コンパイラで次のエラーが表示されます。
Rebind result 'javax.validation.ValidatorFactory' must be a class
Rebind result 'com.google.gwt.validation.client.ProviderValidationMessageResolver' must be a class
私のGINモジュールは次のようになります
@GinModules(ClientGinModule.class)
public interface ClientGinjector extends Ginjector
{
NewOrderView getOrderView();
}
NewOrderView
ちょうど伸びるところComposite
。
私.gwt.xml
のモジュールには、次の手順があります
<replace-with class="com.mine.courierApp.client.validation.ClientValidatorFactory">
<when-type-is class="javax.validation.ValidatorFactory"/>
</replace-with>
<replace-with class="com.mine.courierApp.client.validation.ClientValidationMessagesResolver">
<when-type-is class="com.google.gwt.validation.client.UserValidationMessagesResolver"/>
</replace-with>
だから、GINはJavaコードでこれを知りたがっているのではないかと思ったので、GINモジュールを変更しました。
public class ClientGinModule extends AbstractGinModule
{
protected void configure()
{
bind(javax.validation.ValidatorFactory.class).to(ClientValidatorFactory.class);
bind(com.google.gwt.validation.client.UserValidationMessagesResolver.class).to(ClientValidationMessagesResolver.class);
}
}
しかし、エラーメッセージが大きくなりましたが、役に立ちませんでした:
Rebind result 'javax.validation.ValidatorFactory' must be a class
Rebind result 'javax.validation.ValidatorFactory' must be a class
Cannot proceed due to previous errors
Rebind result 'com.google.gwt.validation.client.ProviderValidationMessageResolver' must be a class
更新: 詳細な GWT コンパイラ出力:
[ERROR] Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/com/google/gwt/validation/client/BaseMessageInterpolator.java'
[ERROR] Line 96: Rebind result 'com.google.gwt.validation.client.ProviderValidationMessageResolver' must be a class
[ERROR] Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/com/google/gwt/validation/client/GwtValidatorContext.java'
[ERROR] Line 36: Rebind result 'javax.validation.ValidatorFactory' must be a class
[ERROR] Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/com/google/gwt/validation/client/spi/GwtValidationProvider.java'
[ERROR] Line 39: Rebind result 'javax.validation.ValidatorFactory' must be a class
[ERROR] Cannot proceed due to previous errors
何をすればよいでしょうか ?