• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

GWT RequestFactory Error when firing request : org.springframework.beans.factory.NoSuchBeanDefinitio

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Request factory:


public interface StarRequestFactory extends RequestFactory {

@Service(value = RaduService.class, locator = GWTServiceLocator.class)
public interface RaduRequestContext extends RequestContext {
Request<Void> save( );
}

RaduRequestContext raduRequestcontext();
}

Service :

public class RaduService {

public void save(){
System.out.println("You have saved.");
}

}

Locator :

public class GWTServiceLocator implements ServiceLocator,
ApplicationContextAware {
private ApplicationContext context;

@Override
public Object getInstance(Class<?> clazz) {
return context.getBean(clazz);
}

@Override
public void setApplicationContext(ApplicationContext context)
throws BeansException {
this.context = context;
}

}



In my entrypoint class i make the request :

requestFactory.raduRequestcontext().save().fire(new Receiver<Void>() {

@Override
public void onSuccess(Void response) {
System.out.println("Success");

}
});

On this request i get the following error :


[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)
..........................................................

Does anyone know what is this about ?

I can post the pom if needed.
 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you found a solution? i have the same problem
 
BWA HA HA HA HA HA HA! Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!