Announcement Announcement Module
No announcement yet.
STS 2.8.1, ROO and GWT hickups Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • STS 2.8.1, ROO and GWT hickups

    In my quest to get STS 2.8.1, ROO and GWT working (see this thread for my first post on this topic) I have come up with the following problem. I have a simple roo script:

    // Simple roo GWT program
    persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
    entity --class ~.server.domain.Person
    field string --fieldName name
    field number --fieldName age --type java.lang.Integer
    entity --class ~.server.domain.Team
    field string --fieldName name
    field reference --fieldName captain --type ~.server.domain.Person
    gwt setup
    I start STS on a new workspace, create a new Spring Roo Project, then I invoke the script command to run this simple script from the roo shell.

    When all the compilation and validation and maven work is all done and said, I am left with 1 Java error on the PersonEditView on the Markers tab:

    The type javax.validation.ConstraintViolation cannot be resolved. It is indirectly referenced from required .class files

    Three other interesting facts:
    1. In the pom file generated by Roo, two entries are found for the validation-api artifactId. The second one has a sources classifier.
    2. The appearance of the sources classifier seem to cause maven to copy the following two jars from the maven repository to the project target folder:
      Repository filename Target folder filename
      validation-api.1.0.0.GA.jar validation-api.1.0.0.GA-sources.jar
      validation-api.1.0.0.GA-sources.jar javax.validation-validation-api.1.0.0.GA-sources.jar
      And the javax.validation-validation-api.1.0.0.GA-sources.jar is added to the maven dependencies container. This is really odd because this file only contains the source java files and the first file (validation-api.1.0.0.GA-sources.jar) contains the compiled class files even though its name suggest otherwise.
    3. Invoking the dev mode with mvn gwt:run does not seem to be affected by this behavior. In this mvn invoked case, upon closer inspection, the classpath actually contains the two original files from the maven repository and not the target folder version. I am not even sure if they would be copied by the mvn gwt:run (I did not test this).

    Can anyone help to solve this? I am truly amazed this has not been reported. At least I searched and did not find it. I am wondering if this a "feature" of the new m2e plugin?

  • #2
    I tried this but it did not work
    • I added the validation-api.1.0.0.GA-sources.jar from the target folder as a jar to the build path. The java error disappeared after a clean build of the project.
    • I added a field on field on Team with minimum size of 3.
    • I ran the web application in dev mode and added a person with a non numeric age, I got a red validation error. I changed it to numeric and proceeded
    • I added a team but I made sure that the new field which requires a minimum of 3 characters had less and click the save button. Nothing happened with no error messages anywhere

    Any help please. I still cannot believe no-one has run into this. I am not doing anything fancy. I guess no one has created a Roo GWT project in STS 2.8.1 yet!


    • #3
      Did you try the maven eclipse plugin, ie mvn eclipse:clean eclipse:eclipse ?


      • #4

        I just did mvn eclipse:clean eclipse:eclipse and this did the following:

        • removed the maven nature of the eclipse project (i.e. eclipse m2e plugin not used)
        • added both the validation-api.1.0.0.GA.jar validation-api.1.0.0.GA-sources.jar from the maven repository to the referenced libraries
        • All other dependencies from the maven repository were added as referenced libraries
        • Since m2e is not running (see this post for details) then no specific GWT SDK is created by maven based on the maven repository and an error appears. One would need to figure out which version is required (if you read the thread where the previous linked post is found you will find out the details of how I found out) and download and created a specific SDK definition in the Google Plugin for Eclipse GWT settings page.

        After creating the 2.3.0 SDK definition and building I ran the application using STS run as web application command and I get exactly the same validation behavior as before: invalid numeric value got an error and string field to small silently ignored. Did I make a gross mistake because this is such simple functionality that it should work?



        • #5
          I believe that the javax.validation.ConstraintViolation error in the first post of this thread is a bug in m2e. Should I open an STS bug on this? I know that m2e is not part of STS but it is integrated. Also, I would like to have a working solution.


          • #6

            If it is a m2e problem, please report to the m2e project at Eclipse.



            • #7
              I just filed a bug with m2e. Here it is



              • #8
                Thanks for reporting and for adding the link here!



                • #9
                  As it turns out, the problem does not exist in Eclipse 3.7.1 with Maven Integration for Eclipse version which is the same version in STS.

                  As can be seen from the Eclipse 3.7.1 screen shot of the maven dependencies library list (top and bottom highlighted libraries), both the class and source libraries are defined by m2e as maven dependencies from the maven repository:


                  This demonstrates this is a STS problem and I will open a JIRA against it.
                  Attached Files


                  • #10
                    Hi Mario!

                    Thanks for putting in the JIRA. I guess it is this one:

                    (just for others to know where to navigate)



                    • #11
                      Seems to be an issue with the Maven WTP integration that is shipped with STS. See

                      We should move to the 0.15 version when it is available.