how2code

cut and paste your problems away!

Error: The RequestFactory ValidationTool must be run for GWT 2.4

leave a comment »

When loading up the CloudTasks tutorial as downloaded from the Google website, I encountered the following Runtime error:

SEVERE: Unexpected error
java.lang.RuntimeException: The RequestFactory ValidationTool must be run for the com.cloudtasks.shared.CloudTasksRequestFactory RequestFactory type

I found this article:

http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation

Here’s an excerpt:

The RequestFactory annotation processor will validate the RequestFactory interface declarations and ensure that the mapping of proxy properties and context methods to their domain types is valid. The manner in which the errors are reported depends on the method by which the annotation processor is invoked.

In addition to validating the interfaces, the annotation processor also generates additional Java types which embed pre-computed metadata that is required by the RequestFactory server components. Users of RequestFactorySource must also run the annotation processor in order to provide the client code with obfuscated type token mappings. In the client-only case, the server domain types are not required.

If the validation process is not completed, a runtime error message will be generated:

The RequestFactory ValidationTool must be run for the com.example.shared.MyRequestFactory RequestFactory type

 

In GWT 2.4, RequestFactory interfaces must be validated before they can be used by the RequestFactory server code or JVM-based clients. I followed the instructions for Eclipse as follows:

  • Right-click on Project and select Properties > Java Compiler > Annotation Processing
  • Tick “Enable project specific settings”
  • Then make sure that both “Enable annotation processing” and “Enable processing in editor” are ticked.
  • Go to Factory Path underneath Annotation Processing in the left-hand menu
  • Click the button “Add External Jar”
  • Add the requestfactory-apt.jar file from your Eclipse distribution
  • Press Apply and the project will re-build.

The images on the above link ask you to add this file from GWT_TOOLS, but the text says to use your distribution. I found my file under:

C:\dev\eclipse-3.5.2\plugins\com.google.gwt.eclipse.sdkbundle_2.4.0.relr35v201110112027\gwt-2.4.0

About these ads

Written by how2code

December 2, 2011 at 15:54

Posted in Android

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: