I'm not sure if this is a GWT-Designer issue or just a GWT issue. I did post this on the GWT developers list but got zero responses. So maybe it was mis-posted or maybe it just doesn't make any sense. In any event, I'm using GWT 1.5.1 (Mac OS X 10.5.4) with GWT-Designer 5.1.0 in Eclipse 3.4.
I have a Class of utility methods and other definitions that I want to
share across several different packages implementing GWT modules. The
Utils.java work fine if it is defined in the *.client.* package with
the other classes that reference it.
I am not able to move the Utils.java higher in the package structure
without either getting an error when I run in the hosted environment
or during build-time in eclipse.
The package structure is like:
- Code: Select all
org.tbrc.gwt.
Queries.java
Utils.java
person.
PersonViewer.gwt.xml
client.
PersonViewer.java
server.
work.
WorkViewer.gwt.xml
client.
WorkViewer.java
server.
So I have added to PersonViewer.gwt.xml and WorkViewer.gwt.xml:
- Code: Select all
<inherits name="org.tbrc.gwt.Utils"/>
and I have added org/tbrc/Utils.gwt.xml:
- Code: Select all
<module>
</module>
As described this builds fine in the eclipse configuration with GWT-
Designer and such but when I run in hosted mode I get:
[ERROR] Unable to find 'org/tbrc/gwt/Utils.gwt.xml' on your classpath;
could be a typo, or maybe you forgot to include a classpath entry for
source?
But if I put Utils.gwt.xml at 'org/tbrc/gwt/Utils.gwt.xml' then I get
a build-time error:
org.tbrc.gwt.Utils cannot be found in source packages. Check the
inheritance chain from your module; ...
I would appreciate any help on how to properly organize code to enable
such sharing. Obviously it is possible since the the GWT environment
appears to be based on such. I looked at some of the GWT source but
nothing popped out as the explanation of how to approach such sharing.
Hopefully what I am trying to do is clear.
Thank you,
Chris