Announcement Announcement Module
Collapse
No announcement yet.
GWT 2.4, maven, STS/Eclipse (especially if you are upgrading from an older gwt) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • GWT 2.4, maven, STS/Eclipse (especially if you are upgrading from an older gwt)

    I have been struggling to get a working GWT 2.4 maven-based project to run/debug through sts/eclipse ever since GWT 2.4 came out with no luck so I had been stuck with GWT 2.3 until couple hours ago. There are plenty references regarding this issue (see references compiled here: https://issuetracker.springsource.com/browse/STS-2688).
    I finally got it all working together so I decided to summarize my solution in a separate thread so I can point everyone to the same place (Thanks to both GWT and Roo folks).

    The latest sts (sts-2.9.2.RELEASE, spring-roo-1.2.1.RELEASE, GWT 2.4): expense.roo pom.xml only needs the previously mentioned <pluginManagement> section (details: https://issuetracker.springsource.com/browse/STS-2688 ).
    1. run "mvn clean eclipse:clean"
    1. import as maven project in STS
    NOTHING more is needed. you can run/debug your app via sts or mvn gwt:run. You can also deploy with GWT compile through sts (I have tested them all)

    NOTE: if you are importing the project into previous versions of STS/Eclipse you may need to tweak your IDE.(dig into the references), I would totally recommend downloading the latest STS though.

    I have also tested the latest expense.roo (spring-roo-1.2.1.RELEASE) with older version of sts/eclipse (sts-2.8.1.RELEASE); there you do need to add "validation-api-1.0.0.GA-sources.jar" manually. Simply add it to your project path and everything should go smoothly; including mvn gwt:run, running/debugging from sts/eclipse, and also deployment (GWT compile via sts/eclipse).

    If you are upgrading from an older version of GWT: (YES, YOU CAN DO IT)
    • get your pom.xml right (expense.roo will create a sufficient pom.xml to follow). Don't forget to include <pluginManagement> section.
    • If your project is roo enabled or you have generated it via spring-roo previously, comment out the roo nature in your pom.xml (Roo has this annoying habit of overridding your code
      Code:
      <projectnature>com.springsource.sts.roo.core.nature</projectnature>
      I read in google forum that the most assuring process for clean dependencies is to delete the project from your IDE (not the source), run "mvn clean eclipse:clean" and import your maven project back. If your pom.xml marks your project as roo nature, then roo starts overriding your files.
    • If you will be importing your project in an older version of sts/eclipse make sure that validation-api is in your class path otherwise expect plenty validation constraints and annotations compile errors.
    • If you are by any unlucky chance like mine, have a domain object called "Property" and in your proxies you have "setPropery(PropertyProxy proxy)", make sure that you rename the setter in both domain getters/setters and also in your proxyRequest. Failure to correct this, will cause a painful to debug issue in generated code by gwt. GWT compiler confuses this method with its own setProperty(String, whatever...)
      http://code.google.com/p/google-web-...&ts=1339836131
    • You have to import and use the proper paths to conform to gwt 2.4 packaging. The following commands does the majority of the replacement for you or at least give you a good jump start. These replace commands assume "src/" folder is where the commands are getting executed.
      Code:
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.Request/com.google.web.bindery.requestfactory.shared.Request/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.EntityProxy/com.google.web.bindery.requestfactory.shared.EntityProxy/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.EntityProxyId/com.google.web.bindery.requestfactory.shared.EntityProxyId/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.Receiver/com.google.web.bindery.requestfactory.shared.Receiver/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.ProxyForName/com.google.web.bindery.requestfactory.shared.ProxyForName/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.ui.client.EntityProxyKeyProvider/com.google.web.bindery.requestfactory.gwt.ui.client.EntityProxyKeyProvider/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.event.shared.HandlerRegistration/com.google.web.bindery.event.shared.HandlerRegistration/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.client.RequestFactoryEditorDriver/com.google.web.bindery.requestfactory.gwt.client.RequestFactoryEditorDriver/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.ui.client.ProxyRenderer/com.google.web.bindery.requestfactory.gwt.ui.client.ProxyRenderer/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.LoggingRequest/com.google.web.bindery.requestfactory.shared.LoggingRequest/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.client.RequestFactoryLogHandler/com.google.web.bindery.requestfactory.gwt.client.RequestFactoryLogHandler/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.ServiceName/com.google.web.bindery.requestfactory.shared.ServiceName/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.InstanceRequest/com.google.web.bindery.requestfactory.shared.InstanceRequest/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.ServerFailure/com.google.web.bindery.requestfactory.shared.ServerFailure/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.Violation/com.google.web.bindery.requestfactory.shared.Violation/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.client.DefaultRequestTransport/com.google.web.bindery.requestfactory.gwt.client.DefaultRequestTransport/g' {} \;
      
      find src/ -type f \( -name "*.java" -o -name "*.aj" \) -exec sed -i 's/com.google.gwt.requestfactory.shared.WriteOperation/com.google.web.bindery.requestfactory.shared.WriteOperation/g' {} \;
    • Modify your $MyProject$.gwt.xml file especially these lines: (I just copied them from generated expense.roo)
      Code:
      	<inherits name="com.google.web.bindery.requestfactory.RequestFactory"/>
      
      	<source path="org/springsource/roo/extrack/client/request"/>  (this is where you have your request files)
      	<source path="org/springsource/roo/extrack/client/proxy"/>  (this is where you have your proxy files)
          	<source path="client"/>
      	<source path="shared"/>
      	<public path="public"/>
    • If you have been using the older Roo versions to generated your code, there are two helpful classes added in the newer version: CustomRequestFactoryServlet and CustomServiceLayerDecorator. Copy and paste those files under .server package and then modify your web.xml to use them as request factory servlet (take a look at the generated lastest expense.roo project (spring-roo-1.2.1.RELEASE).

  • #2
    Hi,

    I am trying to get the expenses.roo project running under eclipse with STS 2.9.2, roo 1.2.1 and GWT 2.4 .. I believe I have followed all the steps above - but I keep getting the runtime error:

    com.google.web.bindery.requestfactory.server.Reque stFactoryServlet doPost
    SEVERE: Unexpected error
    java.lang.RuntimeException: The RequestFactory ValidationTool must be run for the org.springsource.roo.extrack.client.managed.reques t.ApplicationRequestFactory RequestFactory type
    at com.google.web.bindery.requestfactory.vm.impl.Deob fuscator$Builder.load(Deobfuscator.java:59)

    Any ideas?

    Thanks,

    Wade

    Comment


    • #3
      Run: mvn gwt:run once also compiler annotation processing and FactoryPaths are not set automatically by maven configuration in expense.roo (it does with dynaTablerf project from google)
      So make sure you have those set:
      http://code.google.com/p/google-web-...faceValidation

      Please let me know which one makes it work for you and I'll update my post

      Comment


      • #4
        Originally posted by arakhshan View Post
        Run: mvn gwt:run once also compiler annotation processing and FactoryPaths are not set automatically by maven configuration in expense.roo (it does with dynaTablerf project from google)
        So make sure you have those set:
        http://code.google.com/p/google-web-...faceValidation

        Please let me know which one makes it work for you and I'll update my post
        I am having the same issue for DAYS. All i want to do is use STS and GWT 2.4.0. I cannot believe this combinations is not usable any longer for mere mortals.
        "java.lang.RuntimeException: The RequestFactory ValidationTool must be run for the stest.client.managed.request.ApplicationRequestFac tory RequestFactory type" is all over over the place.

        mvn get:run works of course, but i want do debug my application in STS!? "Run as Web Application" always leads to ....
        "..The RequestFactory ValidationTool must be run...".

        Is there another way to debug my gwt application within my IDE?


        And i can tell you i am so sick of seeing Umbrella exceptions. Can you please tell me what _exactly_ to do have the The RequestFactory ValidationTool run?

        Setting it manually as decribed in http://code.google.com/p/google-web-...faceValidation
        has absolute ZERO effect.

        Comment


        • #5
          The following plugins are important in your pom.xml. I would suggest to upgrade to GWT 2.5-RC1 as well. I have not had that problem ever since I upgraded ( I have no clue why) Also make sure to delete your project from eclipse, run "mvn clean eclipse:clean" and import your project back as maven project.

          Code:
                      <plugin>
                          <groupId>org.codehaus.mojo</groupId>
                          <artifactId>gwt-maven-plugin</artifactId>
                          <version>2.2.0</version>
                          <configuration>
                              <logLevel>INFO</logLevel>
                              <style>PRETTY</style>
                              <runTarget>/ApplicationScaffold.html</runTarget>
                              <hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
                              <modules>
                                  <module>${project.groupId}.ApplicationScaffold</module>
                              </modules>
                              <copyWebapp>true</copyWebapp>
                          </configuration>
                          <executions>
                              <execution>
                                  <id>gwtcompile</id>
                                  <phase>prepare-package</phase>
                                  <goals>
                                      <goal>compile</goal>
                                  </goals>
                              </execution>
                          </executions>
                          <dependencies>
                              <dependency>
                                  <groupId>com.google.gwt</groupId>
                                  <artifactId>gwt-dev</artifactId>
                                  <version>${gwtVersion}</version>
                              </dependency>
                              <dependency>
                                  <groupId>com.google.gwt</groupId>
                                  <artifactId>gwt-user</artifactId>
                                  <version>${gwtVersion}</version>
                              </dependency>
                          </dependencies>
                      </plugin>
                  <plugin>
                          <groupId>org.codehaus.mojo</groupId>
                          <artifactId>exec-maven-plugin</artifactId>
                          <version>1.2</version>
                          <executions>
                              <execution>
                                  <phase>process-classes</phase>
                                  <goals>
                                      <goal>exec</goal>
                                  </goals>
                                  <configuration>
                                      <id>VerifyRequestFactoryInterfaces</id>
                                      <executable>java</executable>
                                      <arguments>
                                          <argument>-cp</argument>
                                          <classpath/>
                                          <argument>com.google.web.bindery.requestfactory.apt.ValidationTool</argument>
                                          <argument>${project.build.outputDirectory}</argument>
                                          <argument>${project.groupId}.client.managed.request.ApplicationRequestFactory</argument>
                                      </arguments>
                                  </configuration>
                              </execution>
                          </executions>
                      </plugin>

          Comment


          • #6
            Spring Roo automatically added the mentioned plugins to my pom.xml. GWT 2.5 did not change anything.
            The only solution i came up is using mvn gwt:debug instead of gwt:run and then debugging in Eclipse by choosing Remote Java Application as additional debug configuration.

            Although this works more or less, it is very awkward and i find it very unfortunate that this issue still cannot be handled (STS, Roo, GWT) consistently although it came up many months ago. I am already pretty fed up and would recommend "STS, Roo, GWT" only to my arch-enemies. (And still feel pretty bad about it)

            Comment


            • #7
              A gold star award to arakhshan
              I too was about to give up on Spring+Roo. As Yppolitia implies above, and I concur, it's an atrocious flaky system.
              Then the magic !!!DO THIS FIRST before importing into eclipse!!!
              mvn clean eclipse:clean
              and all is well.
              I can run/debug inside elipse, I can run/debug outside of eclipse.
              spring is happy, GWT is happy, me too :-)

              Comment

              Working...
              X