title: GWT - how to refer to a package in another project (no source code is available for type)
body: <p>all,</p>
  
  <p>I need to refer to a package in a project other than the GWT project itself. Here is what I did.</p>
  
  <p>The package I want to refer to is <strong>org.apache.lucene.analysis</strong>, and my entry point class is called <strong>PowerSearch</strong>.</p>
  
  <p>In <strong>PowerSearch.gwt.xml</strong>:</p>
  
  <pre><code>&lt;module rename-to='powersearch'&gt;
  &lt;inherits name="com.google.gwt.user.User"/&gt;
  &lt;inherits name="com.google.gwt.user.theme.standard.Standard"/&gt;
  &lt;inherits name="com.gwtext.GwtExt"/&gt;
  &lt;inherits name="org.apache.lucene"&gt;&lt;/inherits&gt;
  &lt;entry-point class="com.powersearch.client.PowerSearch"/&gt;
  &lt;stylesheet src="js/ext/resources/css/ext-all.css"/&gt;
  &lt;script src="js/ext/adapter/ext/ext-base.js"/&gt;
  &lt;script src="js/ext/ext-all.js"/&gt;
  &lt;/module&gt;
  </code></pre>
  
  <p>Under <strong>org.apache.lucene</strong>, I created a xml file, called <strong>lucene.gwt.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd"&gt;
  &lt;module rename-to='lucene'&gt;
  &lt;inherits name="com.google.gwt.user.User"/&gt;
  &lt;source path="analysis"&gt;&lt;/source&gt;
  &lt;/module&gt;
  </code></pre>
  
  <p>Under <strong>org.apache.lucene.analysis</strong>, I have a class called <strong>SearchResult</strong></p>
  
  <p>The program can be correctly compiled, but when running it as a web application, errors appear.</p>
  
  <blockquote>
    <p>[ERROR] [powersearch] - Errors in 'file:/home/cshou/Java/power-search/power-search/src/com/powersearch/client/PowerSearch.java'</p>
    
    <blockquote>
      <p>[ERROR] [powersearch] - Line 146: No source code is available for type org.apache.lucene.client.TweetResult; did you forget to inherit a required module?
      [ERROR] [powersearch] - Errors in 'file:/home/cshou/Java/power-search/power-search/src/com/powersearch/client/PowerSearchServiceAsync.java'
      [ERROR] [powersearch] - Line 17: No source code is available for type org.apache.lucene.analysis.SearchResult; did you forget to inherit a required module?
      [ERROR] [powersearch] - Unable to find type 'com.powersearch.client.PowerSearch'
      [ERROR] [powersearch] - Hint: Previous compiler errors may have made this type unavailable
      [ERROR] [powersearch] - Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly</p>
    </blockquote>
  </blockquote>
  
  <p>I've been Google a lot, and tried a lot, but nothing worked. Can any one help me out? Thanks a lot!</p>