validation-api not on Eclipse "Compile Vaadin Widgets" button classpath

I recently upgraded my Vaadin version in my pom file to 6.6.0. However, now that I try and recompile the widgets, I get errors similar to:

Compiling module com.repository.vaadin.widgetset.RepositoryWebApplicationWidgetset
Validating newly compiled units
[ERROR]
Errors in ‘jar:file:/Users/pclark/springsource/sts-2.6.0.RELEASE/configuration/com.vaadin.integration.eclipse/download/gwt-user/2.3.0/gwt-user.jar!/com/google/gwt/editor/client/EditorDriver.java’
[ERROR]
Line 20: The import javax.validation.ConstraintViolation cannot be resolved
[ERROR]
Line 97: ConstraintViolation cannot be resolved to a type

Computing all possible rebind results for ‘com.google.gwt.user.client.UserAgentAsserter’
Rebinding com.google.gwt.user.client.UserAgentAsserter
Checking rule
[WARN]
Detected warnings related to ‘com.google.gwt.editor.client.SimpleBeanEditorDriver’. Are validation-api-.jar and validation-api--sources.jar on the classpath?

In reading several posts about the problem, I need to put those two jars in the classpath. However, where can I do that? I have tried the system CLASSPATH, but that doesn’t seem to help. I have also attempted to manually add them to the project (so both through maven and through the eclipse project), but that doesn’t seem to work either.

Thanks,
Patrick

With Maven, this was discussed in
this thread
. What you need is (if I remember correctly) something like:

<dependencies>
    ...
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <version>2.3.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>1.0.0.GA</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>1.0.0.GA</version>
        <classifier>sources</classifier>
        <scope>provided</scope>
    </dependency>
    ...
</dependencies>

<build>
    ...
    <plugins>
        ...
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>2.2.0</version>
            <configuration>
                ...
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.google.gwt</groupId>
                    <artifactId>gwt-user</artifactId>
                    <version>2.3.0</version>
                </dependency>
                <dependency>
                    <groupId>com.google.gwt</groupId>
                    <artifactId>gwt-dev</artifactId>
                    <version>2.3.0</version>
                </dependency>
            </dependencies>
        </plugin>
        ...
    </plugins>
    ...
</build>

For compilation with Eclipse, you need to upgrade to the very latest Vaadin Plug-in for Eclipse which can automatically download those JARs and put them on the classpath.

Thanks, that did the trick. And for those maven users, once you upgrade your vaadin plugin it still wasn’t working. So in a similar process where a normal vaadin project you would downgrade and upgrade the version through the project preferences. Similarly I following this process.:

  1. downgrade your vaadin dependency in your pom file (to say 6.5.4)
  2. right click on your project, Maven | Update Dependencies
  3. right click on your project, Maven | Update Project Configuration
  4. clean and rebuild
  5. repeat after upgrading your vaadin dependency in your pom file to 6.6.0

And then the button on the eclipse toolbar worked.

Thanks for your help!

Patrick

How to do the same staff without maven ?

With the latest Eclipse plug-in (make sure you upgrade it first), just change the Vaadin version from an earlier one to 6.6.0 and all the dependencies should be loaded automatically. If you have switched your project to 6.6 before upgrading the plug-in, change Vaadin version to an older one after plug-in upgrade and then again to 6.6.0.

If not using Eclipse, make sure the validation JARs (including the source code) and the correct (2.3.0) GWT JARs are on the classpath of widgetset compilation.

Hi,
I have already don what you say but it doesn’t seem to works.
I have downgraded to 6.5.6 and compiled to check it.
Then I have upgraded but it hasn’t changed.
I have also manually added the missing jar in the WEB-INF/lib but I still get error.
Please help me.

Giancarlo

If you really are using the Vaadin Integration Plug-In for Eclipse version 2.0.0 (released Tuesday this week if I remember correctly), here is what you should see:

For a Vaadin 6.5 project:

  • WebContent/WEB-INF/lib should only contain vaadin-6.5.x.jar and your own JARs, no GWT JARs etc.
  • project build path should (automatically) contain 1) VAADIN_DOWNLOAD/gwt-dev/2.1.1/gwt-dev.jar 2) VAADIN_DOWNLOAD/gwt-user/2.1.1/gwt-user.jar - but no other GWT or Vaadin related JARs directly

When switching the Vaadin version in the project to 6.6.0 via “Project Properties → Vaadin”, these should automatically change to:

  • WebContent/WEB-INF/lib should only contain vaadin-6.6.x.jar and your own JARs, no GWT JARs etc.
  • project build path should (automatically) contain 1) VAADIN_DOWNLOAD/gwt-dev/2.3.0/gwt-dev.jar 2) VAADIN_DOWNLOAD/gwt-user/2.3.0/gwt-user.jar 3) VAADIN_DOWNLOAD/gwt-dependencies/2.3.0/validation-api-1.0.0.GA.jar 4) VAADIN_DOWNLOAD/gwt-dependencies/2.3.0/validation-api-1.0.0.GA-sources.jar

You should not add/modify these or add any other GWT related JARs etc. unless you know what you are doing (or at least have the basic setup working).

Hi Henri,
thank you for your suggestion.
I believe that something is gone wrong because I first upgrade the project to vaadin 6.6.0 and later I upgrade the plugin.
I fix the problem following this step :

  1. downgrade my project to 6.5.4
  2. uninstall the plugin
  3. reinstall the plugin
  4. upgrade my project to 6.6.0

Thank you very much for your support.

Giancarlo