I've scoured the net and have done everything I can think of to convert the Roo expenses sample to GWT 2.4 and it simply won't work. The problem I'm experiencing is with the new 2.4 Request Factory annotation validation. I'm detailing all of my steps here. Please comment if you've been able to run a Roo generated project with 2.4 + request factory - I'm starting to think that it might not be possible.
Toolchain: STS 2.7.2, GWT 2.4, Maven 2.2.1, m2e 1.0, Roo 1.2.0.M1
First I updated all the GWT dependencies in my pom.xml to use 2.4 instead of the 2.3 that is automatically used by the scaffolded expenses application.
I then re-factored all of the RequestFactory references to use the new web.bindery packages.
All of that works fine. The challenging part is getting the new 2.4 Request Factory validation tool to run with maven.
I followed the directions religiously from http://code.google.com/p/google-web-...faceValidation
This included downloading the m2e connector for build-helper-maven-plugin and adding the following to my pom.xml:
<!-- requestfactory-apt runs an annotation processor (APT) to
instrument its service interfaces so that
RequestFactoryServer can decode client requests. Normally
you would just have a dependency on requestfactory-apt
with <scope>provided</scope>, but that won't work in
eclipse due to m2e bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=335036 -->
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.0.5</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.google.web.bindery</groupId>
<artifactId>requestfactory-apt</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.google.web.bindery</groupId>
<artifactId>requestfactory-server</artifactId>
<version>2.4.0</version>
</dependency>
</dependencies>
</plugin>
<!-- Google Plugin for Eclipse (GPE) won't see the source
generated above by requestfactory-apt unless it is exposed
as an additional source dir-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/apt</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
As well as the lifecycle management bit:
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<versionRange>(,)</versionRange>
<goals>
<goal>process</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
I even enabled the annotation processing through the IDE (I think it would be great to get integrated errors when the RequestFactory implementations aren't correct)
Another thing I had to do to my pom.xml was make sure I was pulling in the sources for javax validation:
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<classifier>sources</classifier>
<scope>provided</scope>
</dependency>
When I build my project the annotation processing prints out a bunch of [INFO] output complaining because it can't find the methods in the AspectJ files. That looks like this:
10/29/11 4:26:59 PM MDT: [INFO] diagnostic /Developer/Code/Affluence/enterprise/src/main/java/affluence/dining/management/client/managed/request/DishProxy.java:11: Domain type affluence.dining.management.server.domain.dish.Dis h does not have a getVersion() method
10/29/11 4:26:59 PM MDT: [INFO] diagnostic /Developer/Code/Affluence/enterprise/src/main/java/affluence/dining/management/client/managed/request/DishProxy.java:13: Could not find domain method similar to java.lang.Long getId()
10/29/11 4:26:59 PM MDT: [INFO] diagnostic /Developer/Code/Affluence/enterprise/src/main/java/affluence/dining/management/client/managed/request/DishProxy.java:15: Could not find domain method similar to void setId(java.lang.Long)
10/29/11 4:26:59 PM MDT: [INFO] diagnostic /Developer/Code/Affluence/enterprise/src/main/java/affluence/dining/management/client/managed/request/DishProxy.java:17: Could not find domain method similar to java.lang.Integer getVersion()
10/29/11 4:26:59 PM MDT: [INFO] diagnostic /Developer/Code/Affluence/enterprise/src/main/java/affluence/dining/management/client/managed/request/DishProxy.java:19: Could not find domain method similar to void setVersion(java.lang.Integer)
10/29/11 4:26:59 PM MDT: [INFO] diagnostic /Developer/Code/Affluence/enterprise/src/main/java/affluence/dining/management/client/managed/request/DishProxy.java:21: Could not find domain method similar to java.lang.String getName()
Finally it prints out the error message:
10/29/11 4:33:32 PM MDT: [ERROR] error on execute: error during compilation
10/29/11 4:33:32 PM MDT: Build errors for enterprise; org.apache.maven.lifecycle.LifecycleExecutionExcep tion: Failed to execute goal org.bsc.maven:maven-processor-plugin:2.0.5:process (process) on project AffluenceDining: Error executing
And that's all I get. Please, I could really use some help on this. I'm completely blocked until I can get 2.4 working correctly. Any input would be greatly appreciated!
Thank you


Reply With Quote