Apr 29th, 2011, 09:43 AM
GWT Add-On Fails
Executed "web gwt setup" on a project yields errors for all domain objects:
GWT support requires that a proxied entity has an @Version field accessor method for type <my-domain-class>
I tried building a new project with the same database reverse engineer, did not manually alter anything, and got the same error. Original project worked great until trying to add the GWT Add-On. Browser shows only a blue box with "loading..." after executing "mvn gwt:run"
Attached my Roo console output.
Using 1.1.3.RELEASE [rev 4404ffb] inside STS 2.6.0.RELEASE Build Id: 201103161000.
Apr 30th, 2011, 07:04 AM
Do your tables have a column called "version". If so, DBRE will create the @Version field in your entities and GWT should then work OK
Apr 30th, 2011, 02:43 PM
No, my tables do not have a column for version. In order to work, every table in my DB has to have a version column? Is there another option? My intent is to use Roo + GWT with a legacy database.
Apr 30th, 2011, 08:12 PM
The current stipulation of GWT is that each entity is to have an @Version field. Thus the easiest way of doing this with DBRE is to have a column called 'version' in each table. Your entities probably have now @RooEntity(versionField = "'). Removing this attribute would create the version field, however, the ORM will complain if the column is missing
May 1st, 2011, 05:40 PM
Hm ok. I didn't notice having to create a Version field for entities in the tutorial. Since I'm working with a legacy DB, are there any alternatives to altering each table in the schema? If not, it seems like a pretty big barrier to entry for GWT.
May 2nd, 2011, 04:06 PM
Tried creating a new project from scratch using Hibernate and in-memory DB. I followed instructions similar to the Roo-GWT Tutorial pages and created one simple domain object, then executed "web gwt setup". No errors this time, but when I run the application in Tomcat, I get "loading" stuck again. Viewing source and drilling into applicationScaffold/applicationScaffold.nocache.js, I get a 404 error.
Roo console output is attached.
May 2nd, 2011, 05:02 PM
Use mvn gwt:run to run the application, not Tomcat
May 3rd, 2011, 09:46 AM
Got it, thanks. That seems to work.
My original problem remains, though. Is there another way to satisfy GWT's @Version field without having to add columns to all tables in my legacy Oracle DB?
I tried yet another project and added a getVersion and setVersion stub methods, but then I get errors like "ApplicationRequestFactory cannot be resolved to a type." I haven't yet found another workaround via web searches. Anyone have suggestions/advice?
Tags for this Thread