My handler class:
public class Handler {
private final IStore dataStore;
@Inject
@Singleton
public Handler(IStore dataStore) {
this.dataStore = dataStore;
}
}
}
My interface class:
public interface IStore {}
My Impl class:
public class DataStoreImpl implements IStore {
private final JooqTransacter transacter;
@Inject
public DataStoreImpl(@Named("XXX") JooqTransacter transacter) {
this.transacter = transacter;
}
}
My module class to bind:
public class StoreImplModule extends AbstractModule {
@Override protected void configure() {
bind(IStore.class).to(DataStoreImpl.class);
}
}
When I ran it, I keep getting this error:
com.google.inject.ConfigurationException: Guice configuration errors:
1) No implementation for com.xx.store.IStore was bound.
while locating xxx.IStore
for the 1st parameter of Handler.<init>(Handler.java:99)
while locating com.xx.handlers.Handler
Any insights would be greatly appreciated!