Saturday, November 23, 2013

Using RequestFactory in a new Eclipse project with the Google plugin is too much hassle

I have started using GWT for the first time. Everything has been smooth so far except for RequestFactory.

After following the official instructions: http://www.gwtproject.org/doc/latest/DevGuideRequestFactory.html

I had a few problems before I could get a working build using the 'out of the box' Eclipse Google App Engine + GWT new project tool.

First I was getting build errors because of a missing org.json dependency. After Googling the problem I discovered that gwt-servlet.jar (which is automatically added to your build path by the GWT plugin) needs gwt-servlet-deps.jar to also be in the build path.

Why does the plugin in not automatically include gwt-servlet-deps.jar when it includes gwt-servlet.jar?

Then it wasn't after Googling I found what the "The RequestFactory ValidationTool must be run for the foo RequestFactory type" error meant. That pointed me to https://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation which has the needed steps.

Why is this not mentioned in the official instructions, second why do I have to do this in the first place. The new Eclipse project tool should automatically set those settings and should also export requestfactory-apt.jar from the GWT plugin like Eclipse's built in org.eclipse.jst.ws.annotations.core plugin does.

Why do I need to either link to the file requestfactory-apt.jar directly (not portable across machines) or include an otherwise unnecessary file in my project folder.

Last after trying everything I can think of I still get these GWT build errors:
   Validating units:
      Errors in 'file:/C:/Users/blah...blah/.apt_generated/com/blah..blah/FooRequestFactoryDeobfuscatorBuilder.java'
         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?
         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?
         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?
   Removing invalidated units

According to http://groups.google.com/forum/#!topic/google-web-toolkit/h37UOiHUJFM " you can safely ignore this warning; this class is server-side only;"...

Why is the build chain including unnecessary server side Google classes into my client GWT build?

Please fix these problems for the next release, and please update your horribly outdated and hard to follow documentation.

--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment