title: RequestFactory fails with "UnexpectedException: No RequestContext for operation LPZEK7DlYkoG1$NQ5MjHlmuRChk="
body: <p>Could you guys please help me why I'm having this exception?</p>
  
  <p>I extracted RequestFactory proxies and context interfaces into separate jar so I can use it both in GWT client and Android client (details are <strong><a href="https://stackoverflow.com/questions/10185057/gwt-compiler-cant-find-sources-of-depending-module-in-intellij-idea">here</a></strong>)</p>
  
  <p>Unfortunately RF throws an exception on the server in very first call. The exception is:</p>
  
  <pre><code>com.google.web.bindery.requestfactory.server.UnexpectedException: No RequestContext for operation LPZEK7DlYkoG1$NQ5MjHlmuRChk=
      at com.google.web.bindery.requestfactory.server.ServiceLayerDecorator.die(ServiceLayerDecorator.java:216)
      at com.google.web.bindery.requestfactory.server.ResolverServiceLayer.resolveRequestContext(ResolverServiceLayer.java:154)
  </code></pre>
  
  <p>Below is my factory interface. As you can see I had to replace <code>Service</code> annotations with <code>ServiceName</code> because I didn't want to compile all custom locators with Guice injections to jar that will go on mobile devices.</p>
  
  <pre><code>public interface AdminRequestFactory extends RequestFactory
  {
      // @Service(value = UserServiceDao.class, locator = InjectingServiceLocator.class)
      @ServiceName(value = "com.blah.courierApp.server.dao.UserServiceDao", locator = "com.blah.courierApp.server.inject.InjectingServiceLocator")
      public interface GaeUserServiceContext extends RequestContext
      {
          public Request&lt;String&gt; createLogoutURL(String destinationURL);
          public Request&lt;GaeUser&gt; getCurrentUser();
      }
  
      // @Service(value = OrderDao.class, locator = InjectingServiceLocator.class)
      @ServiceName(value = "com.blah.courierApp.server.dao.OrderDao", locator = "com.blah.courierApp.server.inject.InjectingServiceLocator")
      public interface OrderRequestContext extends RequestContext
      {
          Request&lt;List&lt;OrderProxy&gt;&gt; listAll();
          Request&lt;Void&gt; delete(Long id);
          Request&lt;Void&gt; createOrder(OrderProxy order);
          Request&lt;OrderProxy&gt; findOrderById(long id);
          Request&lt;Void&gt; updateOrderState(long id, StateType newStateType);
      }
  
      GaeUserServiceContext contextUserService();
      OrderRequestContext contextOrder();
  }
  </code></pre>
  
  <p>When I compiled it RF Annotation Tool gave following warning:</p>
  
  <pre><code>Cannot fully validate context since domain type com.blah.courierApp.server.dao.UserServiceDao is not available.
  You must run the ValidationTool as part of your server build process.
  Add @SuppressWarnings("requestfactory") to dismiss.
  </code></pre>
  
  <p>So when the exception thrown under the debugger on the server I see that instance of   <code>com.google.web.bindery.requestfactory.vm.impl.Deobfuscator</code> has empty <code>operationData</code> field which is being initialized by <code>DeobfuscatorBuilder</code> class that was generated by RequestFactory annotation tool.</p>
  
  <p>So... I decompiled that class and found this:</p>
  
  <pre><code>public final class AdminRequestFactoryDeobfuscatorBuilder extends Deobfuscator.Builder
  {
    public AdminRequestFactoryDeobfuscatorBuilder()
    {
      withRawTypeToken("w1Qg$YHpDaNcHrR5HZ$23y518nA=", "com.google.web.bindery.requestfactory.shared.EntityProxy");
      withRawTypeToken("8KVVbwaaAtl6KgQNlOTsLCp9TIU=", "com.google.web.bindery.requestfactory.shared.ValueProxy");
      withRawTypeToken("FXHD5YU0TiUl3uBaepdkYaowx9k=", "com.google.web.bindery.requestfactory.shared.BaseProxy");
      withRawTypeToken("5vjE9LUy$l0uvi4kMYpS3JA1WEE=", "com.blah.shared.model.GaeUser");
      withRawTypeToken("8KVVbwaaAtl6KgQNlOTsLCp9TIU=", "com.google.web.bindery.requestfactory.shared.ValueProxy");
      withRawTypeToken("5a7OV4PSV$1xemsooKLfEQ4g5yY=", "com.blah.shared.proxies.OrderProxy");
      withRawTypeToken("neR_xIhE5oZsc0HbnkAMa8A88yw=", "com.blah.shared.proxies.OrderStateProxy");
      withRawTypeToken("t6gMQWDROJnYvqYhNURV8pd$sn4=", "com.blah.shared.proxies.OrganizationProxy");
      withRawTypeToken("1o45xgS$5bIkBKF4wlR8oMw_FSo=", "com.blah.shared.proxies.PersonProxy");
      withRawTypeToken("FXHD5YU0TiUl3uBaepdkYaowx9k=", "com.google.web.bindery.requestfactory.shared.BaseProxy");
    }
  }
  </code></pre>
  
  <p>It didn't generated tokens for factory. Therefore there are no calls to <code>Deobfuscator.Builder.withOperation</code> because of which my server can't find context when calls comes from the client.</p>
  
  <p><strong>Questions are:</strong></p>
  
  <ul>
  <li>Why doesn't RequestFactory Annotation Tool generate tokens for factory (operations) ?</li>
  <li>How can I fix it ?</li>
  </ul>