Hi Thomas, thank you very much for your explanation, it is full and detailed. I have excluded maven-processor-plugin, add dependency to maven-compiler-plugin, and install m2e-apt connector. In eclipse, when i run development mode i catch execption: java.lang.RuntimeException: The RequestFactory ValidationTool must be run for the com.runetfind.webapp.shared.service.ServerRequestFactory RequestFactory type
do i need to configure annotation processing in project settings manually? And when i run mvn gwt:run from command line i got the same problem, what i`m doing wrong? Thank you пятница, 13 сентября 2013 г., 14:58:09 UTC+4 пользователь Thomas Broyer написал: > > > > On Friday, September 13, 2013 12:27:11 PM UTC+2, Сергей Устинкин wrote: >> >> Hi, i have a problem with gwt-maven-plugin. I have a project with >> objectify, request-factory and gwt. And i want use maven plugin to upload >> project to gae, but when i call mvn appengine:update, exception arise: >> >> ------------------------------------------------------- >> T E S T S >> ------------------------------------------------------- >> Running com.runetfind.webapp.client.SandboxJukitoTest >> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.514 sec >> >> Results : >> >> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 >> >> [INFO] >> [INFO] --- gwt-maven-plugin:2.5.1:compile (default) @ runetfind --- >> [INFO] Compiling module com.runetfind.webapp.Runetfind >> [INFO] Validating units: >> [INFO] [ERROR] Errors in >> 'file:/home/ustinkin/git/runetfind/runetfind/target/generated-sources/apt/com/runetfind/webapp/shared/service/ServerRequestFactoryDeobfuscatorBuilder.java' >> [INFO] [ERROR] Line 7: No source code is available for type >> com.google.web.bindery.requestfactory.vm.impl.Deobfuscator.Builder; did you >> forget to inherit a required module? >> [INFO] [ERROR] Line 9: No source code is available for type >> com.google.web.bindery.requestfactory.vm.impl.OperationKey; did you forget >> to inherit a required module? >> [INFO] [ERROR] Line 10: No source code is available for type >> com.google.web.bindery.requestfactory.vm.impl.OperationData.Builder; did >> you forget to inherit a required module? >> [INFO] [ERROR] Aborting compile due to errors in some input files >> >> >> Could someone help me to solve the problem? >> > > First, you have to understand why that happens. > > > 1. RequestFactory needs a Deobfuscator.Builder implementation for each > RequestFactory interface, for server-side use. That class is loaded using > a > naming convention: same name as the RF interface with a > "DeobfuscatorBuilder" suffix. That class is generally generated by an > annotation processor. > 2. In your case, the annotation processor is run by the > maven-processor-plugin in the generate-sources phase, so it generates the > source-code for that class. Another option is to have it run by 'javac' > (i.e. the maven-compiler-plugin), in which case it'll generally only > generate the *.class file (you can configure the maven-compiler-plugin to > also output the source file). Then the build-heper-maven-plugin in your > case adds the target/generated-sources/apt folder as a source folder; this > is so that your projects is easier to import in Eclipse (don't know about > other IDEs) and then run the DevMode from there (that way, you don't have > to configure the annotation processor in Eclipse, M2E will call the > generate-sources phase and will auto-configure the project using the > build-helper-maven-plugin configuration). > 3. The GWT compiler scans the entire classpath and tries to compile > every *.java file that's in the module's source path. Despite being > server-side code, the generated DeobfuscatorBuilder is in the source path > as it a) needs to be a sibling of the interface and b) has a *.java file > generated (in your case) by the maven-processor-plugin. > 4. And you have <strict>true</strict> in your gwt-maven-plugin which > tells GWT to fail the compilation if anything cannot be compiled, even if > it'll never be actually used by the app (file is in the source path but > never referenced transitively by the EntryPoint) > > So you have several options here: > > - don't use the maven-processor-plugin so you don't have a generated > *.java file; you'll have to install the m2e-apt connector from JBoss to > have annotation processing in Eclipse automatically configured from your > POM, though you'll have to enable it manually afterwards IIRC. See > > https://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation#Maven_builds > (and > follow the links) > - exclude the DeobfuscatorBuilder from the source-path by adding an > excludes="**/*DeobfuscatorBuilder.java" on your <source path="shared"/> in > your gwt.xml > - don't compile in "strict" mode > - split your project in several modules to clearly separate your > client-side and server-side code, with a shared module for shared code; > and > generate the DeobfuscatorBuilder in the server module. This is what I do: > > https://github.com/tbroyer/gwt-maven-archetypes/blob/master/modular-requestfactory/src/main/resources/archetype-resources/__rootArtifactId__-server/pom.xml#L48; > > I have no idea how it plays out with AppEngine though. > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
