I have been struggling to get a working GWT 2.4 maven-based project to run/debug through sts/eclipse ever since GWT 2.4 came out with no luck so I had been stuck with GWT 2.3 until couple hours ago. There are plenty references regarding this issue (see references compiled here: https://issuetracker.springsource.com/browse/STS-2688).
I finally got it all working together so I decided to summarize my solution in a separate thread so I can point everyone to the same place (Thanks to both GWT and Roo folks).
The latest sts (sts-2.9.2.RELEASE, spring-roo-1.2.1.RELEASE, GWT 2.4): expense.roo pom.xml only needs the previously mentioned <pluginManagement> section (details: https://issuetracker.springsource.com/browse/STS-2688 ).
- run "mvn clean eclipse:clean"
- import as maven project in STS
NOTHING more is needed. you can run/debug your app via sts or mvn gwt:run. You can also deploy with GWT compile through sts (I have tested them all)
NOTE: if you are importing the project into previous versions of STS/Eclipse you may need to tweak your IDE.(dig into the references), I would totally recommend downloading the latest STS though.
I have also tested the latest expense.roo (spring-roo-1.2.1.RELEASE) with older version of sts/eclipse (sts-2.8.1.RELEASE); there you do need to add "validation-api-1.0.0.GA-sources.jar" manually. Simply add it to your project path and everything should go smoothly; including mvn gwt:run, running/debugging from sts/eclipse, and also deployment (GWT compile via sts/eclipse).
If you are upgrading from an older version of GWT: (YES, YOU CAN DO IT)
- get your pom.xml right (expense.roo will create a sufficient pom.xml to follow). Don't forget to include <pluginManagement> section.
- If your project is roo enabled or you have generated it via spring-roo previously, comment out the roo nature in your pom.xml (Roo has this annoying habit of overridding your code
I read in google forum that the most assuring process for clean dependencies is to delete the project from your IDE (not the source), run "mvn clean eclipse:clean" and import your maven project back. If your pom.xml marks your project as roo nature, then roo starts overriding your files.Code:<projectnature>com.springsource.sts.roo.core.nature</projectnature>
- If you will be importing your project in an older version of sts/eclipse make sure that validation-api is in your class path otherwise expect plenty validation constraints and annotations compile errors.
- If you are by any unlucky chance like mine, have a domain object called "Property" and in your proxies you have "setPropery(PropertyProxy proxy)", make sure that you rename the setter in both domain getters/setters and also in your proxyRequest. Failure to correct this, will cause a painful to debug issue in generated code by gwt. GWT compiler confuses this method with its own setProperty(String, whatever...)
http://code.google.com/p/google-web-...&ts=1339836131
- You have to import and use the proper paths to conform to gwt 2.4 packaging. The following commands does the majority of the replacement for you or at least give you a good jump start. These replace commands assume "src/" folder is where the commands are getting executed.
Code:find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.Request/com.google.web.bindery.requestfactory.shared.Request/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.EntityProxy/com.google.web.bindery.requestfactory.shared.EntityProxy/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.EntityProxyId/com.google.web.bindery.requestfactory.shared.EntityProxyId/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.Receiver/com.google.web.bindery.requestfactory.shared.Receiver/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.ProxyForName/com.google.web.bindery.requestfactory.shared.ProxyForName/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.ui.client.EntityProxyKeyProvider/com.google.web.bindery.requestfactory.gwt.ui.client.EntityProxyKeyProvider/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.event.shared.HandlerRegistration/com.google.web.bindery.event.shared.HandlerRegistration/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.client.RequestFactoryEditorDriver/com.google.web.bindery.requestfactory.gwt.client.RequestFactoryEditorDriver/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.ui.client.ProxyRenderer/com.google.web.bindery.requestfactory.gwt.ui.client.ProxyRenderer/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.LoggingRequest/com.google.web.bindery.requestfactory.shared.LoggingRequest/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.client.RequestFactoryLogHandler/com.google.web.bindery.requestfactory.gwt.client.RequestFactoryLogHandler/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.ServiceName/com.google.web.bindery.requestfactory.shared.ServiceName/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.InstanceRequest/com.google.web.bindery.requestfactory.shared.InstanceRequest/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.ServerFailure/com.google.web.bindery.requestfactory.shared.ServerFailure/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.Violation/com.google.web.bindery.requestfactory.shared.Violation/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.client.DefaultRequestTransport/com.google.web.bindery.requestfactory.gwt.client.DefaultRequestTransport/g' {} \; find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.WriteOperation/com.google.web.bindery.requestfactory.shared.WriteOperation/g' {} \;
- Modify your $MyProject$.gwt.xml file especially these lines: (I just copied them from generated expense.roo)
Code:<inherits name="com.google.web.bindery.requestfactory.RequestFactory"/> <source path="org/springsource/roo/extrack/client/request"/> (this is where you have your request files) <source path="org/springsource/roo/extrack/client/proxy"/> (this is where you have your proxy files) <source path="client"/> <source path="shared"/> <public path="public"/>
- If you have been using the older Roo versions to generated your code, there are two helpful classes added in the newer version: CustomRequestFactoryServlet and CustomServiceLayerDecorator. Copy and paste those files under .server package and then modify your web.xml to use them as request factory servlet (take a look at the generated lastest expense.roo project (spring-roo-1.2.1.RELEASE).



Reply With Quote
