1
votes

all,

I need to refer to a package in a project other than the GWT project itself. Here is what I did.

The package I want to refer to is org.apache.lucene.analysis, and my entry point class is called PowerSearch.

In PowerSearch.gwt.xml:

<module rename-to='powersearch'>
<inherits name="com.google.gwt.user.User"/>
<inherits name="com.google.gwt.user.theme.standard.Standard"/>
<inherits name="com.gwtext.GwtExt"/>
<inherits name="org.apache.lucene"></inherits>
<entry-point class="com.powersearch.client.PowerSearch"/>
<stylesheet src="js/ext/resources/css/ext-all.css"/>
<script src="js/ext/adapter/ext/ext-base.js"/>
<script src="js/ext/ext-all.js"/>
</module>

Under org.apache.lucene, I created a xml file, called lucene.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<!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">
<module rename-to='lucene'>
<inherits name="com.google.gwt.user.User"/>
<source path="analysis"></source>
</module>

Under org.apache.lucene.analysis, I have a class called SearchResult

The program can be correctly compiled, but when running it as a web application, errors appear.

[ERROR] [powersearch] - Errors in 'file:/home/cshou/Java/power-search/power-search/src/com/powersearch/client/PowerSearch.java'

[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

I've been Google a lot, and tried a lot, but nothing worked. Can any one help me out? Thanks a lot!

1

1 Answers

0
votes

[ERROR] [powersearch] - Line 146: No source code is available for type org.apache.lucene.client.TweetResult; did you forget to inherit a required module?

Likely from the package name, there is a module that can be found at org.apache.lucene somewhere on your classpath - it will be a file ending in .gwt.xml. Add this to your own module file like this (assuming the file is called Lucene.gwt.xml):

<inherits name="org.apache.lucene.Lucene" />