title: GWT RPC cannot compile the project
body: <p>This question is an extension of previous question. <a href="https://stackoverflow.com/questions/9117072/gwt-cannot-compile-the-project/9117396">GWT Cannot compile the project</a></p>
  
  <p>Please have a look and tell me what's wrong with it.</p>
  
  <p><strong>Client side.</strong></p>
  
  <p>Twitter.java</p>
  
  <pre><code>package in.isuru.twitter.client;
  
  import java.util.ArrayList;
  
  import twitter4j.Tweet;
  
  import com.google.gwt.core.client.EntryPoint;
  import com.google.gwt.core.client.GWT;
  import com.google.gwt.user.client.rpc.AsyncCallback;
  import com.google.gwt.user.client.ui.FlexTable;
  import com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter;
  import com.google.gwt.user.client.ui.HasHorizontalAlignment;
  import com.google.gwt.user.client.ui.RootPanel;
  
  /**
   * Entry point classes define &lt;code&gt;onModuleLoad()&lt;/code&gt;.
  */
  public class Twitter implements EntryPoint {
  
  
  private final TwitterServiceAsync searchService = GWT.create(TwitterService.class);
  
  public void onModuleLoad() {
  
       // Create a Flex Table
      final FlexTable flexTable = new FlexTable();
      FlexCellFormatter cellFormatter = flexTable.getFlexCellFormatter();
      flexTable.addStyleName("cw-FlexTable");
      flexTable.setWidth("32em");
      flexTable.setCellSpacing(5);
      flexTable.setCellPadding(3);
  
      // Add some text
      cellFormatter.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT);
      cellFormatter.setColSpan(0, 0, 2);
  
      searchService.search("love", new AsyncCallback&lt;ArrayList&lt;Tweet&gt;&gt;() {
  
          @Override
          public void onFailure(Throwable caught) {
              //Not yet completed.
  
          }
  
          @Override
          public void onSuccess(ArrayList&lt;Tweet&gt; result) {
              for (int i=0 ; i &lt;result.size() ; i++) {
                  Tweet tweet = result.get(i);
                  String user = tweet.getFromUser();
                  String status = tweet.getText();
                  addRow(flexTable, user);
                  addRow(flexTable, status);
  
          }
  
  
      }});
  
  
      flexTable.ensureDebugId("cwFlexTable");
      RootPanel.get().add(flexTable);
    }
  
    /**
     * Add a row to the flex table.
     */
    private void addRow(FlexTable flexTable, String status) {
      int numRows = flexTable.getRowCount();
      flexTable.setText(numRows, 0, status);
      flexTable.getFlexCellFormatter().setRowSpan(0, 1, numRows + 1);
    }
  
    /**
     * Remove a row from the flex table.
     */
    private void removeRow(FlexTable flexTable) {
      int numRows = flexTable.getRowCount();
      if (numRows &gt; 1) {
        flexTable.removeRow(numRows - 1);
        flexTable.getFlexCellFormatter().setRowSpan(0, 1, numRows - 1);
      }
  
  }
  }
  </code></pre>
  
  <p>TwitterService.java</p>
  
  <pre><code>package in.isuru.twitter.client;
  
  import java.util.ArrayList;
  
  import twitter4j.Tweet;
  
  import com.google.gwt.user.client.rpc.RemoteService;
  import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
  
  @RemoteServiceRelativePath("search")
   public interface TwitterService extends RemoteService {
  ArrayList&lt;Tweet&gt; search(String searchTerm) throws IllegalArgumentException;
  }
  </code></pre>
  
  <p>TwitterServiceAsync.java</p>
  
  <pre><code>package in.isuru.twitter.client;
  
  import java.util.ArrayList;
  
  import twitter4j.Tweet;
  
  import com.google.gwt.user.client.rpc.AsyncCallback;
  
  public interface TwitterServiceAsync {
  
  void search(String searchTerm, AsyncCallback&lt;ArrayList&lt;Tweet&gt;&gt; callback) throws llegalArgumentException;
  }
  </code></pre>
  
  <p><strong>Server Side</strong></p>
  
  <pre><code>package in.isuru.twitter.server;
  
  import java.util.ArrayList;
  
  import twitter4j.Query;
  import twitter4j.QueryResult;
  import twitter4j.Tweet;
  import twitter4j.Twitter;
  import twitter4j.TwitterException;
  import twitter4j.TwitterFactory;
  import in.isuru.twitter.client.TwitterService;
  
  import com.google.gwt.user.server.rpc.RemoteServiceServlet;
  
  public class TwitterServiceImpl extends RemoteServiceServlet implements TwitterService {
  
  /**
   * 
   */
  private static final long serialVersionUID = 1L;
  
  ArrayList&lt;Tweet&gt; tweets = new ArrayList&lt;Tweet&gt;();
  
  @Override
  public ArrayList&lt;Tweet&gt; search(String searchTerm) {
      // The factory instance is re-useable and thread safe.
      Twitter twitter = new TwitterFactory().getInstance();
      Query query = new Query(searchTerm);
      QueryResult result = null;
      try {
          result = twitter.search(query);
      } catch (TwitterException e) {
          e.printStackTrace();
      }
      for (Tweet tweet : result.getTweets()) {
          //System.out.println(tweet.getFromUser() + ":" + tweet.getText());
          tweets.add(tweet);
  
      }
  
      return tweets;
  }
  
   }
  </code></pre>
  
  <p>Twitter.gwt.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;module rename-to='twitter'&gt;
   &lt;!-- Inherit the core Web Toolkit stuff.                        --&gt;
   &lt;inherits name='com.google.gwt.user.User'/&gt;
  
   &lt;!-- Inherit the default GWT style sheet.  You can change       --&gt;
   &lt;!-- the theme of your GWT application by uncommenting          --&gt;
   &lt;!-- any one of the following lines.                            --&gt;
   &lt;inherits name='com.google.gwt.user.theme.clean.Clean'/&gt;
   &lt;!-- &lt;inherits name='com.google.gwt.user.theme.standard.Standard'/&gt; --&gt;
   &lt;!-- &lt;inherits name='com.google.gwt.user.theme.chrome.Chrome'/&gt; --&gt;
   &lt;!-- &lt;inherits name='com.google.gwt.user.theme.dark.Dark'/&gt;     --&gt;
  
  
   &lt;!-- Other module inherits                                      --&gt;
  
   &lt;!-- Specify the app entry point class.                         --&gt;
   &lt;entry-point class='in.isuru.twitter.client.Twitter'/&gt;
  
   &lt;!-- Specify the paths for translatable code                    --&gt;
   &lt;source path='client'/&gt;
  &lt;source path='shared'/&gt;
  
  &lt;/module&gt;
  </code></pre>
  
  <p>Error is </p>
  
  <blockquote>
    <p>[DEBUG] [twitter] - Validating newly compiled units [TRACE] [twitter]<br>
    - Finding entry point classes     [ERROR] [twitter] - Errors in 'file:/E:/workspace/Twitter/src/in/isuru/twitter/client/Twitter.java'<br>
          [ERROR] [twitter] - Line 43: No source code is available for type<br>
    twitter4j.Tweet; did you forget to inherit a required module?     [ERROR]<br>
    [twitter] - Errors in<br>
    'file:/E:/workspace/Twitter/src/in/isuru/twitter/client/TwitterServiceAsync.java'<br>
          [ERROR] [twitter] - Line 11: No source code is available for type<br>
    twitter4j.Tweet; did you forget to inherit a required module?     [ERROR]<br>
    [twitter] - Unable to find type 'in.isuru.twitter.client.Twitter'<br>
          [ERROR] [twitter] - Hint: Previous compiler errors may have made<br>
    this type unavailable         [ERROR] [twitter] - Hint: Check the<br>
    inheritance chain from your module; it may not be inheriting a<br>
    required module or a module may not be adding its source path entries<br>
    properly [ERROR] [twitter] - Failed to load module 'twitter' from user<br>
    agent 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.7 (KHTML, like<br>
    Gecko) Chrome/16.0.912.77 Safari/535.7' at 127.0.0.1:7901  </p>
  </blockquote>