facebook

GWT Scaffolding for GWT 2.4 SDK Users

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #320058 Reply

    jkennedy
    Member

    Following the release of MyEclipse for Spring 9.1 Google released the GWT 2.4 update.

    With this release, there are two changes that MyEclipse users need to be aware of:
    1. The RequestFactory packag at the old GWT location has been removed (it was deprecated)
    2. A new requirement for validations to be run on RequestFactory projects has been added which requires that you manually configure your Annotation processing in the IDE.

    While our code generator automatically detects the GWT version and emits the RequestFactory package at the correct location in the code, we missed a location in the web.xml file. You will need to manually change the package there to com.google.web.bindery.requestfactory.server.RequestFactoryServlet from its previous location.

    If you try to run your project you will receive errors saying that the RequestFactory validation needs to be run.
    Follow the steps here from Google to correct this issue:
    http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation
    You only need to perform the steps under the Eclipse section.
    Generally, you are just letting the Google Annotation processor run on their annotations here.

    We have verified that a basic scaffold works on GWT 2.4.

    Thanks,
    Jack

    #320943 Reply

    tiramakantraore
    Participant

    HI,.
    can you develop the second point:

    2. A new requirement for validations to be run on RequestFactory projects has been added which requires that you manually configure your Annotation processing in the IDE.
    how do i “manually configure your Annotation processing in the IDE”.
    I follow the instruction detailed in http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation
    but when i click on the button:”view gwt scaffolding” i get this message
    9 nov. 2011 05:57:01 com.google.web.bindery.requestfactory.server.RequestFactoryServlet doPost
    GRAVE: Unexpected error
    java.lang.RuntimeException: The RequestFactory ValidationTool must be run for the gwt.client.managed.request.ApplicationRequestFactory RequestFactory type
    at com.google.web.bindery.requestfactory.vm.impl.Deobfuscator$Builder.load(Deobfuscator.java:59)
    at com.google.web.bindery.requestfactory.server.ResolverServiceLayer.updateDeobfuscator(ResolverServiceLayer.java:43).
    It seem i miss something.
    Excuse my english, i am not a native and i am a newbe in myeclipse development

    #320960 Reply

    cconway
    Member

    If your’e having difficulty understanding the google documentation, follow these step by step instructions to configure RequestFactory validation for GWT 2.4:

    1. When you create your Web Project in MyEclpse, select the “Java EE 6.0” radio button on the first page of the New Web Project wizard. If you’re not using a Web Project, at least ensure that your java compliance is set to 1.6 on the Project Properties > Java Compiler page.

    2. Download the GWT 2.4 SDK zip file from this location and unzip it on your machine: http://code.google.com/webtoolkit/versions.html

    3. Right-click on your project and select Properties to open the project properties dialog.

    4. Expand the Java Compiler node on the left and select “Annotation Processing”.

    5. Click the checkbox to “Enable project specific settings”. Once checked, that should enable the rest of the screen and the “Enable annotation processing” and “Enable processing in editor” boxes should both be checked. “.apt_generated” should be in the “Generated source directory:” box. Add a new Key/Value pair (verbose, false) using the “New…” button.

    6. Expand the “Annotation Processing” node on the left side of the properties dialog and select the “Factory Path” node.

    7. Select “Enable project specific settings”

    8. Press the “Add External JARs” button and use the dialog that appears to select the “requestfactory-apt.jar” file from the GWT 2.4 SDK that you unzipped earlier.

    9. When you press Ok on the properties dialog, you’ll be prompted to rebuild (you may be prompted twice). Always say Yes to those prompts.

    #320989 Reply

    bahaamohamad
    Participant

    @cconway wrote:

    If your’e having difficulty understanding the google documentation, follow these step by step instructions to configure RequestFactory validation for GWT 2.4:

    1. When you create your Web Project in MyEclpse, select the “Java EE 6.0” radio button on the first page of the New Web Project wizard. If you’re not using a Web Project, at least ensure that your java compliance is set to 1.6 on the Project Properties > Java Compiler page.

    2. Download the GWT 2.4 SDK zip file from this location and unzip it on your machine: http://code.google.com/webtoolkit/versions.html

    3. Right-click on your project and select Properties to open the project properties dialog.

    4. Expand the Java Compiler node on the left and select “Annotation Processing”.

    5. Click the checkbox to “Enable project specific settings”. Once checked, that should enable the rest of the screen and the “Enable annotation processing” and “Enable processing in editor” boxes should both be checked. “.apt_generated” should be in the “Generated source directory:” box. Add a new Key/Value pair (verbose, false) using the “New…” button.

    6. Expand the “Annotation Processing” node on the left side of the properties dialog and select the “Factory Path” node.

    7. Select “Enable project specific settings”

    8. Press the “Add External JARs” button and use the dialog that appears to select the “requestfactory-apt.jar” file from the GWT 2.4 SDK that you unzipped earlier.

    9. When you press Ok on the properties dialog, you’ll be prompted to rebuild (you may be prompted twice). Always say Yes to those prompts.

    #320991 Reply

    bahaamohamad
    Participant

    Dear Cindy,
    I followed your steps but still have the same problem.

    #321063 Reply

    avishnev
    Member

    I have the same issue as well. Is there a solution?

    #321082 Reply

    cconway
    Member

    If someone can export a simple project that shows the error and either attach it to this thread or send it to me via attachment, I can try to see what’s wrong.

    #321104 Reply

    avishnev
    Member

    it seems that adding requestfactory-apt.jar as you indicated does not actually copy the file into the project tree. I manually copied the file into WebRoot/WEB_INF/lib, but still did not help. Attaching the project will not work as it created 46MB war file in my case. Any suggestions are welcome. Here is the error

    Attachments:
    You must be logged in to view attached files.
    #321105 Reply

    avishnev
    Member

    Also, please note that the class system fails to load per my earlier post is java.lang.ClassNotFoundException: com.google.gwt.requestfactory.server.RequestFactoryServlet. However that class is not in requestfactory-apt.jar. Similar class,but different package, is found in gwt-servlet.jar
    maverick:lib alex9134$ jar tvf gwt-servlet.jar | grep RequestFactoryServlet
    5456 Mon Aug 29 13:17:38 EDT 2011 com/google/web/bindery/requestfactory/server/RequestFactoryServlet.class

    So something is wrong somewhere in the configuration.

    #321134 Reply

    avishnev
    Member

    Ahhh… I finally got it. As per my earlier post, the class that the web server is trying to load is not found in any of gwt-2.4.0 jar files. Using the path from factoryrequest-apt.jar, i changed web.xml in WebRoot/WEB-INF directory. Now scaffold is working properly. I am still testing, but no longer getting the exception as mentioned on this list. Trial and error method shows that requestfactory-apt.jar needs to be copied into the same directory. these together make scaffolding work. Now, it would be awesome if MyEclipse can make a change where manual operations like these are not needed. BTW, if someone using MySQL or other JDBC drivers, they also need to be copied into WebRoot/WEB-NF directory

    #321139 Reply

    cconway
    Member

    Hi avishnev,

    I’m happy to see that you figured out the problem but I’m afraid you’ve found a bug in MyEclipse for Spring 9.1 that is separate from the RequestFactory validation procedure. I think I can summarize this thread (and add an alternate fix) as follows:

    This original sticky post is referring to a problem where Google released a new version of their plugin that requires a manual step of configuring your project so that Request Factory interfaces are validated. The steps outlined by Jack and myself do indeed describe the steps necessary to configure the validator. The symptom that you need to perform the RequestFactory validation is a message like this in your server console when you try to run the application:

    java.lang.RuntimeException: The RequestFactory ValidationTool must be run for the gwt.client.managed.request.ApplicationRequestFactory RequestFactory type 
    at com.google.web.bindery.requestfactory.vm.impl.Deobfuscator$Builder.load(Deobfuscator.java:59) 
    at com.google.web.bindery.requestfactory.server.ResolverServiceLayer.updateDeobfuscator(ResolverServiceLayer.java:43) 
    at com.google.web.bindery.requestfactory.server.ResolverServiceLayer.resolveRequestFactory(ResolverServiceLayer.java:176) 

    The problem reported in the follow-on posts are not the request factory validation issue. There was a bug in MyEclipse for Spring 9.x that we have fixed in MyEclipse for Spring 10 where an incorrect RequestFactoryServlet package name is emitted into the web.xml when using the Google Plugin version 2.4. The symptom of that error is this message in your server console:

    java.lang.ClassNotFoundException: com.google.gwt.requestfactory.server.RequestFactoryServlet 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) 
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1083) 

    The correct fix for MyEclipse for Spring 9.1 to use the Google Plugin version 2.4 is to change the web.xml to use the correct RequestFactoryServlet which is:

    com.google.web.bindery.requestfactory.server.RequestFactoryServlet

    instead of the incorrectly emitted one that is valid for Google Plugin versions prior to 2.3:

    com.google.gwt.requestfactory.server.RequestFactoryServlet

    In MyEclipse for Spring 10, you should not have to manually modify the web.xml, but you will still need to perform the RequestFactory validation as described at the start of this thread and in my detailed steps. I have successfully deployed and run scaffolded GWT applications without copying the requestfactory-apt.jar into the project so with the correct RequestFactoryServlet in web.xml I believe you should not need to perform the step of copying the requestfactory-apt.jar into your project.

    Hopefully this post will help to clarify the web.xml bug and GWT validation for other readers.

    #321152 Reply

    avishnev
    Member

    Where is MyEclipse 10 for Spring. Can I upgrade?

    #321155 Reply

    cconway
    Member

    MyEclipse for Spring 10 is in the process of being promoted to the downloads page. The downloads should be available tomorrow (11/17/2011) at the latest. It is currently available in Pulse.

    From a technical standpoint, since 10 is based on Indigo instead of Helios your current install will not upgrade, you’ll have to install a new instance.

    From a subscription standpoint, I unfortunately can’t answer upgrade questions with regard to licensing, but if you’ll contact sales at sales@genuitec.com they should be able to help you.

    #321172 Reply

    avishnev
    Member

    Thank you. I downloaded Eclipse 10 for Spring yesterday and installed it today. I followed the same instructions including on this post to update the configuration for Annotations, etc. After doing GWT2.1 scaffolding I now get the compile errors

    What’s wrong?

    Attachments:
    You must be logged in to view attached files.
    #321174 Reply

    avishnev
    Member

    I figured out the issue with my last error. During the scaffolding I picked only my parent class, but I was scaffolding all of my classes in the db. Based on the tutorials i though it was doable. When I re-run scaffolding with all classes and all classes as parent/main classes, the error went away. I am possibly confused on how to create 1:M relationships similar to the tutorial and how to get a layout as in the tutorial. please help with that.

Viewing 15 posts - 1 through 15 (of 16 total)
Reply To: GWT Scaffolding for GWT 2.4 SDK Users

You must be logged in to post in the forum log in