title: GWT RequestFactory Error when firing request : org.springframework.beans.factory.NoSuchBeanDefinitionException
body: <p>I have a maven+spring+gwt project in which i want to use request factory. I just can't figure out why I get this exception.</p>
  
  <p>Request factory:  </p>
  
  <pre><code>   public interface StarRequestFactory extends RequestFactory {
  
  @Service(value = RaduService.class, locator = GWTServiceLocator.class)
  public interface RaduRequestContext extends RequestContext {
         Request&lt;Void&gt; save( );
      }
  
  RaduRequestContext raduRequestcontext();
  }
  </code></pre>
  
  <p>Service : </p>
  
  <pre><code>public class RaduService {
  
    public void save(){
      System.out.println("You have saved.");
    }
  
  } 
  </code></pre>
  
  <p>Locator : </p>
  
  <pre><code>public class GWTServiceLocator implements ServiceLocator,
      ApplicationContextAware {
    private ApplicationContext context;
  
    @Override
    public Object getInstance(Class&lt;?&gt; clazz) {
      return context.getBean(clazz);
    }
  
    @Override
    public void setApplicationContext(ApplicationContext context)
          throws BeansException {
      this.context = context;
    }
  
  }
  </code></pre>
  
  <p>In my entrypoint class i make the request :</p>
  
  <pre><code>requestFactory.raduRequestcontext().save().fire(new Receiver&lt;Void&gt;() {
  
          @Override
          public void onSuccess(Void response) {
              System.out.println("Success");
  
          }
      });
  </code></pre>
  
  <p>On this request i get the following error : </p>
  
  <p>[ERROR] Iul 25, 2012 3:35:36 PM com.google.web.bindery.requestfactory.server.RequestFactoryServlet doPost
  [ERROR] SEVERE: Unexpected error
  [ERROR] org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.base.star.shared.services.StarRequestFactory$RaduRequestContext] is defined: expected single bean but found 0: 
  [ERROR]     at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:269)
  [ERROR]     at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1083)
  [ERROR]     at com.base.star.server.integration.GWTServiceLocator.getInstance(GWTServiceLocator.java:25)
  [ERROR]     at com.base.star.server.integration.GWTServiceLayerDecorator.createServiceInstance(GWTServiceLayerDecorator.java:43)
  [ERROR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [ERROR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  [ERROR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [ERROR]     at java.lang.reflect.Method.invoke(Method.java:601)
  [ERROR]     at com.google.web.bindery.requestfactory.server.ServiceLayerCache.getOrCache(ServiceLayerCache.java:233)
  [ERROR]     at com.google.web.bindery.requestfactory.server.ServiceLayerCache.createServiceInstance(ServiceLayerCache.java:117)
  [ERROR]     at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.processInvocationMessages(SimpleRequestProcessor.java:451)
  [ERROR]     at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:225)
  [ERROR]     at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:127)
  ..........................................................</p>
  
  <p>Does anyone know what is this about ?</p>
  
  <p>I can post the pom if needed.</p>