Announcement Announcement Module
Collapse
No announcement yet.
Can't compile with GWT 2.4 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can't compile with GWT 2.4

    I've scoured the net and have done everything I can think of to convert the Roo expenses sample to GWT 2.4 and it simply won't work. The problem I'm experiencing is with the new 2.4 Request Factory annotation validation. I'm detailing all of my steps here. Please comment if you've been able to run a Roo generated project with 2.4 + request factory - I'm starting to think that it might not be possible.

    Toolchain: STS 2.7.2, GWT 2.4, Maven 2.2.1, m2e 1.0, Roo 1.2.0.M1

    First I updated all the GWT dependencies in my pom.xml to use 2.4 instead of the 2.3 that is automatically used by the scaffolded expenses application.

    I then re-factored all of the RequestFactory references to use the new web.bindery packages.

    All of that works fine. The challenging part is getting the new 2.4 Request Factory validation tool to run with maven.
    I followed the directions religiously from http://code.google.com/p/google-web-...faceValidation

    This included downloading the m2e connector for build-helper-maven-plugin and adding the following to my pom.xml:
    <!-- requestfactory-apt runs an annotation processor (APT) to
    instrument its service interfaces so that
    RequestFactoryServer can decode client requests. Normally
    you would just have a dependency on requestfactory-apt
    with <scope>provided</scope>, but that won't work in
    eclipse due to m2e bug
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=335036 -->
    <plugin>
    <groupId>org.bsc.maven</groupId>
    <artifactId>maven-processor-plugin</artifactId>
    <version>2.0.5</version>
    <executions>
    <execution>
    <id>process</id>
    <goals>
    <goal>process</goal>
    </goals>
    <phase>generate-sources</phase>
    </execution>
    </executions>
    <dependencies>
    <dependency>
    <groupId>com.google.web.bindery</groupId>
    <artifactId>requestfactory-apt</artifactId>
    <version>2.4.0</version>
    </dependency>
    <dependency>
    <groupId>com.google.web.bindery</groupId>
    <artifactId>requestfactory-server</artifactId>
    <version>2.4.0</version>
    </dependency>
    </dependencies>
    </plugin>

    <!-- Google Plugin for Eclipse (GPE) won't see the source
    generated above by requestfactory-apt unless it is exposed
    as an additional source dir-->
    <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <version>1.7</version>
    <executions>
    <execution>
    <id>add-source</id>
    <phase>generate-sources</phase>
    <goals>
    <goal>add-source</goal>
    </goals>
    <configuration>
    <sources>
    <source>${project.build.directory}/generated-sources/apt</source>
    </sources>
    </configuration>
    </execution>
    </executions>
    </plugin>

    As well as the lifecycle management bit:

    <pluginManagement>
    <plugins>
    <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
    <plugin>
    <groupId>org.eclipse.m2e</groupId>
    <artifactId>lifecycle-mapping</artifactId>
    <version>1.0.0</version>
    <configuration>
    <lifecycleMappingMetadata>
    <pluginExecutions>
    <pluginExecution>
    <pluginExecutionFilter>
    <groupId>org.bsc.maven</groupId>
    <artifactId>maven-processor-plugin</artifactId>
    <versionRange>(,)</versionRange>
    <goals>
    <goal>process</goal>
    </goals>
    </pluginExecutionFilter>
    <action>
    <execute />
    </action>
    </pluginExecution>
    </pluginExecutions>
    </lifecycleMappingMetadata>
    </configuration>
    </plugin>
    </plugins>
    </pluginManagement>

    I even enabled the annotation processing through the IDE (I think it would be great to get integrated errors when the RequestFactory implementations aren't correct)

    Another thing I had to do to my pom.xml was make sure I was pulling in the sources for javax validation:
    <dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>1.0.0.GA</version>
    </dependency>
    <dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>1.0.0.GA</version>
    <classifier>sources</classifier>
    <scope>provided</scope>
    </dependency>

    When I build my project the annotation processing prints out a bunch of [INFO] output complaining because it can't find the methods in the AspectJ files. That looks like this:
    10/29/11 4:26:59 PM MDT: [INFO] diagnostic /Developer/Code/Affluence/enterprise/src/main/java/affluence/dining/management/client/managed/request/DishProxy.java:11: Domain type affluence.dining.management.server.domain.dish.Dis h does not have a getVersion() method
    10/29/11 4:26:59 PM MDT: [INFO] diagnostic /Developer/Code/Affluence/enterprise/src/main/java/affluence/dining/management/client/managed/request/DishProxy.java:13: Could not find domain method similar to java.lang.Long getId()
    10/29/11 4:26:59 PM MDT: [INFO] diagnostic /Developer/Code/Affluence/enterprise/src/main/java/affluence/dining/management/client/managed/request/DishProxy.java:15: Could not find domain method similar to void setId(java.lang.Long)
    10/29/11 4:26:59 PM MDT: [INFO] diagnostic /Developer/Code/Affluence/enterprise/src/main/java/affluence/dining/management/client/managed/request/DishProxy.java:17: Could not find domain method similar to java.lang.Integer getVersion()
    10/29/11 4:26:59 PM MDT: [INFO] diagnostic /Developer/Code/Affluence/enterprise/src/main/java/affluence/dining/management/client/managed/request/DishProxy.java:19: Could not find domain method similar to void setVersion(java.lang.Integer)
    10/29/11 4:26:59 PM MDT: [INFO] diagnostic /Developer/Code/Affluence/enterprise/src/main/java/affluence/dining/management/client/managed/request/DishProxy.java:21: Could not find domain method similar to java.lang.String getName()

    Finally it prints out the error message:
    10/29/11 4:33:32 PM MDT: [ERROR] error on execute: error during compilation
    10/29/11 4:33:32 PM MDT: Build errors for enterprise; org.apache.maven.lifecycle.LifecycleExecutionExcep tion: Failed to execute goal org.bsc.maven:maven-processor-plugin:2.0.5rocess (process) on project AffluenceDining: Error executing

    And that's all I get. Please, I could really use some help on this. I'm completely blocked until I can get 2.4 working correctly. Any input would be greatly appreciated!

    Thank you

  • #2
    STS + ROO + GWT2.4 = request factory validation tool errors

    Got the same issue. Is there any solution ?
    - desactivate validation
    - shunt validation
    - validation based on compiled class

    In this post : http://stackoverflow.com/questions/7...for-aoped-code
    Loki2302 said "Solved by moving all AOPed code to another project."
    How to do that correcty in Eclipse (STS) ?

    Thanks,
    Best Regards.
    Pascal

    Comment


    • #3
      Do the quickfix for exec-maven-plugin, but then change the ignore to execute. After that I had to replace the gwt-servlet dependency with
      Code:
       
      <dependency>
         <groupId>com.google.web.bindery</groupId>
         <artifactId>requestfactory-server</artifactId>
         <version>2.4.0</version>
      </dependency>
      <dependency>
         <groupId>com.google.web.bindery</groupId>
         <artifactId>requestfactory-apt</artifactId>
         <version>2.4.0</version>
      </dependency>
      Also, Roo 1.2.0.M1 uses GWT 2.4 by default.

      Comment


      • #4
        Adding lifecycleMapingMetadata to exec-maven-plugin

        Hi Justin,

        I believe I had the same problem as you, here is how I solved:


        Just add the code below, inside the build section of your POM, but outside of the plugins one.

        Code:
               <pluginManagement>
                <plugins>
                    <!--This plugin's configuration is used to store Eclipse 
                        m2e settings only. It has no influence on the Maven build itself. -->
                    <plugin>
                        <groupId>org.eclipse.m2e</groupId>
                        <artifactId>lifecycle-mapping</artifactId>
                        <version>1.0.0</version>
                        <configuration>
                            <lifecycleMappingMetadata>
                                <pluginExecutions>
                                    <pluginExecution>
                                        <pluginExecutionFilter>
                                            <groupId>org.codehaus.mojo</groupId>
                                            <artifactId>exec-maven-plugin</artifactId>
                                            <versionRange>[1.2,)</versionRange>
                                            <goals>
                                                <goal>exec</goal>
                                            </goals>
                                        </pluginExecutionFilter>
                                        <action>
                                            <execute />
                                        </action>
                                    </pluginExecution>
                                </pluginExecutions>
                            </lifecycleMappingMetadata>
                        </configuration>
                    </plugin>
                </plugins>
            </pluginManagement>
        Note: I just adapted the steps detailed in here:
        http://wiki.magnolia-cms.com/display/DEV/Eclipse

        to the exec-maven-plugin.

        Another post regarding this issue can be find here:
        http://stackoverflow.com/questions/7...for-aoped-code



        An explanation of why this happened can be found in here:

        http://wiki.eclipse.org/M2E_plugin_e...te_plugin_goal


        and here:
        https://docs.sonatype.org/display/M2...ecycle+mapping

        Good luck!
        David
        Last edited by papirrin; Nov 11th, 2011, 01:58 PM.

        Comment


        • #5
          Not resolved yet

          I just tried to follow the above solution and I am getting the same issue:
          STS 2.8.1
          Roo 1.2.0 RC1

          Code:
          Starting Jetty on port 8888
             [WARN] EXCEPTION 
          java.lang.ClassNotFoundException: org.springsource.roo.extrack.server.CustomRequestFactoryServlet
          Thanks,
          Arash

          Comment


          • #6
            I still have not been able to make progress on this issue. I'm about ready to start from scratch. I've already tried creating a new expenses sample with Roo 1.2M1 and it has build problems out of the box. Can somebody pleeeease list a recipe for generating a buildable sample project with GWT 2.4? Roo is after all supposed to be able to generate projects that work out of the box without hours of tampering right? It seems that Roo was never able to deliver on this promise with GWT 2.4. Or maybe it's just difficult to test with all of the different tools available.

            At this point, I'm willing to use whatever tools I need to. If anybody has been successful in creating a buildable Roo sample expenses application with GWT 2.4 please tell us your recipe.

            Specifically:
            - IDE (w/version)
            - Roo version
            - Maven version
            - Additional plugins (lifecycle management stuff?)
            - If the process you followed was different than the process for creating a sample project in the documentation, please list the differences

            Thank you so much! I can't wait to get back to developing this project.
            Last edited by yanivtal; Dec 11th, 2011, 03:11 PM.

            Comment


            • #7
              Try using the latest snapshot build:
              http://static.springsource.org/downl...hp?project=ROO

              I raised a JIRA when I couldn't get GWT to work with Roo 1.2.0.RC1 that's has now been resolved:
              https://jira.springsource.org/browse/ROO-2931

              Comment


              • #8
                Five months on...

                ..and this exact issue persists in STS 2.9.1 (Eclipse 3.7.2 + Roo 1.2.1 + GWT 2.4.0 + m2e 1.0.100), without any obvious solution.

                Any/all ideas would be welcome.
                Last edited by eggyal; Apr 1st, 2012, 09:16 AM.

                Comment


                • #9
                  I have compiled a list of hints and pointers regarding this issue in the following STS issue tracker:

                  https://issuetracker.springsource.co...#comment-62000

                  Please visit, add your comments and vote for the issue to hopefully be resolved soon. It has been over a year since GWT 2.4 and I yet to run the expense.roo via STS

                  Comment


                  • #10
                    I have been struggling with similar issues and then some. I finally succeeded to make Maven, 2.4 and RF work all together. Here's the details. Hope it helps

                    http://forum.springsource.org/showth...166#post416166

                    Thanks,
                    Arash

                    Comment

                    Working...
                    X