App Engine连接Android应用程序警告:您必须在服务器构建过程中运行ValidationTool

时间:2011-09-14 19:14:26

标签: java android google-app-engine gwt

我在创建新的App Engine Connected Android App后收到此警告:

Cannot fully validate context since domain type com.foo.server.HelloWorldService is not available.
You must run the ValidationTool as part of your server build process.

Add @SuppressWarnings("requestfactory") to dismiss.

由于这是在共享文件夹中,因此Android部件中有一个副本,App Engine部件中有一个副本。警告仅在Android部分中显示在接口方法的名称上:

package com.foo.client;

import com.google.web.bindery.requestfactory.shared.InstanceRequest;
import com.google.web.bindery.requestfactory.shared.Request;
import com.google.web.bindery.requestfactory.shared.RequestContext;
import com.google.web.bindery.requestfactory.shared.RequestFactory;
import com.google.web.bindery.requestfactory.shared.ServiceName;

import com.foo.shared.MessageProxy;
import com.foo.shared.RegistrationInfoProxy;

public interface MyRequestFactory extends RequestFactory {

  @ServiceName("com.foo.server.HelloWorldService")
  public interface HelloWorldRequest extends RequestContext {
    /**
     * Retrieve a "Hello, World" message from the server.
     */
    Request<String> getMessage();
  }

  @ServiceName("com.foo.server.RegistrationInfo")
  public interface RegistrationInfoRequest extends RequestContext {
    /**
     * Register a device for C2DM messages.
     */
    InstanceRequest<RegistrationInfoProxy, Void> register();

    /**
     * Unregister a device for C2DM messages.
     */
    InstanceRequest<RegistrationInfoProxy, Void> unregister();
  }

  @ServiceName("com.foo.server.Message")
  public interface MessageRequest extends RequestContext {
    /**
     * Send a message to a device using C2DM.
     */
    InstanceRequest<MessageProxy, String> send();
  }

  HelloWorldRequest helloWorldRequest();

  RegistrationInfoRequest registrationInfoRequest();

  MessageRequest messageRequest();
}

我正在使用Google在Eclipse Classic 3.7上提供的所有插件的最新(非测试版)(如建议的那样)。

验证工具是什么,如何运行它,以及此警告意味着什么?

1 个答案:

答案 0 :(得分:1)

这是GWT 2.4.0中的新功能,请参阅http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation

ValidationTool将生成com.foo.client.MyRequestFactoryDeobfuscatorBuilder类(或者,对于Android客户端,可能是com.foo.client.MyRequestFactoryDeobfuscatorBuilderLite),需要对上下文和代理类型进行编码和解码,以及来自/来自混淆的方法电线上的名字。