title: guice ignores providers?
body: <p>It seems Guice is ignoring my @Provider methods of my module.</p>
  
  <p>I have a class MyModule like this:</p>
  
  <pre><code>public class MyModule extends AbstractModule {
  
      protected void configure() {
  
          bindInterceptor(Matchers.any(), Matchers.annotatedWith(Timed.class), new GuiceEnabledLoggingInterceptor());
          bind(OneClass.class).to(OneClassImpl.class);
  
          // And more binding lines...
  
      }
  
      @Provides
      public AnotherClassInApi provideMyClass() {
          return AnotherClassInApi.getInstance();
      }
  
      // And more @Provides methods
  
  }
  </code></pre>
  
  <p>Main method is </p>
  
  <pre><code>public static void main(String[] args){
      ConfigHandler.getInstance().loadConfigWhenNotRunningInsideMicrocontainer();
      Injector INJECTOR = Guice.createInjector(new MyModule());
      // ...
  }
  </code></pre>
  
  <p>In some other part of the project I have class AnotherClassInApi, which is a very standard singleton plus one method:</p>
  
  <pre><code>public class AnotherClassInApi {
  
      private static final AnotherClassInApi INSTANCE = new AnotherClassInApi();
  
      private AnotherClassInApi() { }
  
      // ... more methods
  
      public static AnotherClassInApi getInstance() {
          return INSTANCE;
      }
  }
  </code></pre>
  
  <p>Well, I understand that should effectively bind any request for an AnotherClassInApi object to the getInstance() method, but it doesn't work. Funny thing, a breakpoint in the @Provide method is never reached while debugging, but one in the configure method is reached. It seems guice is ignoring my provider annotation, and I think <a href="http://code.google.com/p/google-guice/wiki/ProvidesMethods" rel="nofollow">I'm following exactly what Guice guide says about @Provider</a>, so I'm already stuck.</p>
  
  <p>I've been googling around, but can't find anything similar. Any help will be much appreciated.</p>
  
  <p>Thanks!</p>