title: Google Guice ProvisionException: Unable to provision. No implementation was bound
body: <p>New to DI and guice..</p>
  <p>I want to use a service (StoreLevelClient) This is a class defined by other team.</p>
  <p>I inject this class in my main file like this:</p>
  <pre><code>class ClientAccessor {
      companion object {
          private val LOGGER = KotlinLogging.logger { }
      }
  
      private val myStoreLevelClient: StoreLevelClient =
          Guice.createInjector(ServiceModule()).getInstance(StoreLevelClient::class.java)
  </code></pre>
  <p>And made a module file for the StoreLevelClient like below:</p>
  <pre><code>class ServiceModule : AbstractModule() {
  
      @Provides
      @Singleton
      fun getClient(myServiceClient : KasServiceClient): StoreLevelClient {
          return StoreLevelClient(myServiceClient, AppConfigObject.trackedDocument, AppConfigObject.appConfigFallback)
      }
  </code></pre>
  <p>It gave me errors:
  Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:
  3
  2022-05-20T18:27:50.800-07:00
  1) No implementation for com.kasservice.KasServiceClient was bound.
  4
  2022-05-20T18:27:50.800-07:00
  while locating com.kasservice.KasServiceClient
  5
  2022-05-20T18:27:50.800-07:00
  for the 1st parameter of com.myservice.dependency.ServiceModule.getClient</p>
  <p>The KasServiceClient is also from other's
  So I @Provides it in the ServiceModule as well:</p>
  <pre><code>@Provides
  @Singleton
  fun getService(
      cloudAuthCredentialVisitor: CloudAuthDefaultCredentialsVisitor,
      metricsAwareCallVisitor: MetricsAwareCallVisitor,
      @Named(BINGBONG_SERVICE_CLIENT_RETRY_STRATEGY)
      retryStrategy: RetryStrategy&lt;*&gt;
  ): KasServiceClient {
      val domain = AppConfig.findString(DOMAIN)
      val realm = AppConfig.getRealm().name()
      val qualifier = &quot;$domain.$realm&quot;
      return ClientBuilder()
              .remoteOf(KasServiceClient::class.java)
              .withConfiguration(qualifier)
              .withCallVisitors(cloudAuthCredentialVisitor, metricsAwareCallVisitor, CallAttachmentVisitor(Calls.retry(retryStrategy)))
              .newClient()
  }
  </code></pre>
  <p>But it gave me errors like below:</p>
  <pre><code>Could not find a suitable constructor in com.amazon.coral.client.cloudauth.CloudAuthDefaultCredentialsVisitor. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
  Could not find a suitable constructor in com.amazon.metrics.declarative.client.MetricsAwareCallVisitor. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
  </code></pre>
  <p>The CloudAuthDefaultCredentialsVisitor and MetricsAwareCallVisitor are use @Provides and instantiate already.
  So I don't know why guice can't find them...??</p>
  <p>Any idea for this?? I wonder I have some mistake when using Guice. But I have hard time to debug and find</p>