title: GWT Initialize ClientBundle With Multiple CssResources
body: <p>I'm working on updating some legacy code to GWT 2 and I'm running into some odd behaviour. I have a custom interface that extends ClientBundle as per the gwt docs. Within that bundle I define several CssResources to point to the various .css documents for my module. The problem comes when I go to actually initialize my module. I have some code in the initializer that gets the static reference to each CssResource and calls ensureInjected(). The problem is, only the first call actually does anything. Any subsequent calls seem to be getting ignored and the css styles are not getting added to the application. What do I need to do to work with multiple css documents for a single module?</p>
  <p><strong>CssBundle.java</strong></p>
  <pre><code>public interface CssBundle extends ClientBundle {
      public static final CssBundle INSTANCE = (CssBundle) GWT.create(CssBundle.class);
  
      /* CSS */
      @Source(&quot;mypath/public/Client.css&quot;)
      public ClientCss mainCSS();
  
      @Source(&quot;mypath/resources/css/mini/ext-all.css&quot;)
      public ExtAllCss extAllCSS();
  }
  </code></pre>
  <p><strong>ClientCss.java</strong></p>
  <pre><code>public interface ClientCss extends CssResource {
  
      String applicationTitle();
  
      String branding();
  
      String bugReportDirections();
  
      @ClassName(&quot;Caption&quot;)
      String caption();
  }
  </code></pre>
  <p><strong>ExtAllCss.java</strong></p>
  <pre><code>public interface ExtAllCss extends CssResource {
      @ClassName(&quot;close-icon&quot;)
      String closeIcon();
  
      @ClassName(&quot;close-over&quot;)
      String closeOver();
  
      @ClassName(&quot;col-move-bottom&quot;)
      String colMoveBottom();
  }
  </code></pre>
  <p><strong>MyModule.java</strong></p>
  <pre><code>public class MyModule extends Composite
  {
      public void initialize()
      {
          //this css shows up in the client
          CssBundle.INSTANCE.mainCSS().ensureInjected();
          //this does nothing
          CssBundle.INSTANCE.extAllCSS().ensureInjected();
      }
  }
  </code></pre>