I have a GWT module which includes several DTOs that I wish to access on both the servlet and the client. While developing in Eclipse, I made the module a seperate project with a GWT xml:
<module rename-to='commonmodels'>
<source path="models"/>
</module>
I have another GWT project which contains UI, as well as servlet code. I included the commonmodels project (using Build Path->Projects->Add) and included the module include statement in my main project:
<inherits name="com.techflow.bcweb.common.CommonModels" />
Then, I make an RPC call which creates an object (which has its class defined in CommonModels) on the servlet and returns it to the client.
This all seems to work in GWT hosted mode, but when I run war it and deploy it on a server it throws a ClassDefNotFound exception. I checked the war and confirmed that the .class file from the included module is not present. My question is - how do I tell the GWT compiler to not only compile included module's classes into javascript, but also to make these classes accessible to the servlet? I know that in a GWT project, you can create a "shared" folder which makes its classes accessible to both the client and the servlet. Is there a way to mark the classes in a standalone module as "shared", so that any GWT modules that inherit it can access its classes in both client and servlet?
Thanks in advance for any help!