views:

196

answers:

3

My project contains 2 source folder, one is generic J2EE application another is smartCleintGWT,

I want to use some already existing DTO classes from first source folder (src)

Note that class used on client side and on server side of GWT project!

When I do that I getting error

[ERROR] Errors in 'file:/C:/..Projects/Admin/DMX/src_console/com/ho/nod/client/AdminRPC.java'
[ERROR] Line 7: No source code is available for type com.dmx.synch.server.descriptors.DMXLicense; did you forget to inherit a required module?

Source is available obviously; is there any way to import all that into GWT?

PS In the future 2 source folder will be separated into 2 projects...I hope it wont be that complicated as well.

A: 

Most RPC problems are related to Serializablity of the DTO in question, can you need to ensure that the classes have default constructor and also check if the Module definition file i.e. .gwt.xml file has source element pointing to these packages.

questzen
A: 

GWT only looks for source code in the client package by default, so if you have added new packages you must specify this in your *.gwt.xml file. Add something like: source path='your_top_dir' in XML format.

Andreas Borglin
+1  A: 

You can find in the good docs:

Modules can specify which subpackages contain translatable source, causing the named package and its subpackages to be added to the source path. Only files found on the source path are candidates to be translated into JavaScript, making it possible to mix client-side and server-side code together in the same classpath without conflict. When module inherit other modules, their source paths are combined so that each module will have access to the translatable source it requires.

To add another subpackage add <source path="package"/> in your host file (*.gwt.xml). From the log you posted, it seems you have to add source from the com.dmx.synch.server package.

Igor Klimer