I'm trying to inject Google App Engine's datastore via Guice into my service:
public class FooServiceImpl implements FooService {
private final DatastoreService datastoreService;
@Inject
public FooServiceImpl (DatastoreService datastoreService) {
this.datastoreService = datastoreService;
}
}
But when I try to run it, I get the following error:
No implementation for com.google.appengine.api.datastore.DatastoreService was bound.
Add @Provides
method to your module:
@Provides
DatastoreService provideDatastoreService(){
return DatastoreServiceFactory.getDatastoreService();
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.