有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Vaadin 6 widgetset编译错误(maven依赖项)

我知道有很多关于这个话题的帖子,但大多数都是3-4岁的或者与我的问题无关。我甚至不知道是否有人在使用vaadin 6(vaadin 7似乎很流行)

我尝试过很多事情(向pom添加依赖项,从6.7.1升级vaadin版本,从facets升级到project)

我真的很感激关于解决方案的任何想法、想法,附上例外情况和pom。xml,如果需要更多信息,请不要犹豫

我已经花了将近一整天的时间来解决这个问题:

例外情况

Starting GWT compiler
Compiling module applicLiquidator.applicLiquidator.gwt.AppWidgetSet
   Validating newly compiled units
      [ERROR] Errors in 'jar:file:/C:/Users/Boss/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.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
      [ERROR] Errors in 'jar:file:/C:/Users/Boss/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/com/google/gwt/editor/client/impl/AbstractSimpleBeanEditorDriver.java'
         [ERROR] Line 28: Name clash: The method setConstraintViolations(Iterable<ConstraintViolation<?>>) of type BaseEditorDriver<T,E> has the same erasure as setConstraintViolations(Iterable<ConstraintViolation<?>>) of type EditorDriver<T> but does not override it
      [ERROR] Errors in 'jar:file:/C:/Users/Boss/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/com/google/gwt/editor/client/impl/BaseEditorDriver.java'
         [ERROR] Line 31: The import javax.validation.ConstraintViolation cannot be resolved
         [ERROR] Line 67: ConstraintViolation cannot be resolved to a type
      [ERROR] Errors in 'jar:file:/C:/Users/Boss/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/com/google/gwt/editor/client/impl/SimpleViolation.java'
         [ERROR] Line 25: The import javax.validation.ConstraintViolation cannot be resolved
         [ERROR] Line 40: ConstraintViolation cannot be resolved to a type
         [ERROR] Line 43: ConstraintViolation cannot be resolved to a type
         [ERROR] Line 44: Missing code implementation in the compiler
         [ERROR] Line 49: ConstraintViolation cannot be resolved to a type
         [ERROR] Line 49: Missing code implementation in the compiler
         [ERROR] Line 70: ConstraintViolation cannot be resolved to a type
         [ERROR] Line 72: ConstraintViolation cannot be resolved to a type
         [ERROR] Line 73: ConstraintViolation<?> cannot be resolved to a type
         [ERROR] Line 77: ConstraintViolation<capture#2-of ?> cannot be resolved to a type
         [ERROR] Line 81: ConstraintViolation<capture#3-of ?> cannot be resolved to a type
         [ERROR] Line 89: ConstraintViolation<capture#4-of ?> cannot be resolved to a type
         [ERROR] Line 93: ConstraintViolation<capture#5-of ?> cannot be resolved to a type
         [ERROR] Line 98: ConstraintViolation cannot be resolved to a type
      [ERROR] Errors in 'jar:file:/C:/Users/Boss/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/com/google/gwt/editor/client/testing/MockSimpleBeanEditorDriver.java'
         [ERROR] Line 26: The import javax.validation.ConstraintViolation cannot be resolved
         [ERROR] Line 35: The type MockSimpleBeanEditorDriver<T,E> must implement the inherited abstract method EditorDriver<T>.setConstraintViolations(Iterable<ConstraintViolation<?>>)
         [ERROR] Line 107: Name clash: The method setConstraintViolations(Iterable<ConstraintViolation<?>>) of type MockSimpleBeanEditorDriver<T,E> has the same erasure as setConstraintViolations(Iterable<ConstraintViolation<?>>) of type EditorDriver<T> but does not override it
         [ERROR] Line 108: ConstraintViolation cannot be resolved to a type
      [ERROR] Errors in 'jar:file:/C:/Users/Boss/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/javax/validation/super/javax/validation/Configuration.java'
         [ERROR] Line 93: TraversableResolver cannot be resolved to a type
         [ERROR] Line 105: ConstraintValidatorFactory cannot be resolved to a type
         [ERROR] Line 182: TraversableResolver cannot be resolved to a type
         [ERROR] Line 182: No source code is available for type TraversableResolver; did you forget to inherit a required module?
         [ERROR] Line 194: ConstraintValidatorFactory cannot be resolved to a type
         [ERROR] Line 194: No source code is available for type ConstraintValidatorFactory; did you forget to inherit a required module?
         [ERROR] Line 202: ValidatorFactory cannot be resolved to a type
         [ERROR] Line 202: No source code is available for type ValidatorFactory; did you forget to inherit a required module?
      [ERROR] Errors in 'jar:file:/C:/Users/Boss/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/javax/validation/ConstraintViolationException_CustomFieldSerializer.java'
         [ERROR] Line 30: ConstraintViolationException cannot be resolved to a type
         [ERROR] Line 34: ConstraintViolationException cannot be resolved to a type
         [ERROR] Line 34: No source code is available for type ConstraintViolationException; did you forget to inherit a required module?
         [ERROR] Line 39: ConstraintViolation cannot be resolved to a type
         [ERROR] Line 39: ConstraintViolation cannot be resolved to a type
         [ERROR] Line 40: ConstraintViolationException cannot be resolved to a type
         [ERROR] Line 44: ConstraintViolationException cannot be resolved to a type
      [ERROR] Errors in 'jar:file:/C:/Users/Boss/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/javax/validation/super/javax/validation/MessageInterpolator.java'
         [ERROR] Line 21: The import javax.validation.metadata cannot be resolved
         [ERROR] Line 66: ConstraintDescriptor cannot be resolved to a type
      [ERROR] Errors in 'jar:file:/C:/Users/Boss/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/javax/validation/super/javax/validation/constraints/Pattern.java'
         [ERROR] Line 30: The import javax.validation.Constraint cannot be resolved
         [ERROR] Line 31: The import javax.validation.Payload cannot be resolved
         [ERROR] Line 49: Constraint cannot be resolved to a type
         [ERROR] Line 49: The attribute validatedBy is undefined for the annotation type Constraint
         [ERROR] Line 75: Payload cannot be resolved to a type
      [ERROR] Errors in 'jar:file:/C:/Users/Boss/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar!/javax/validation/super/javax/validation/spi/ConfigurationState.java'
         [ERROR] Line 22: The import javax.validation.ConstraintValidatorFactory cannot be resolved
         [ERROR] Line 24: The import javax.validation.TraversableResolver cannot be resolved
         [ERROR] Line 93: ConstraintValidatorFactory cannot be resolved to a type
         [ERROR] Line 107: TraversableResolver 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 <generate-with class='com.google.gwt.editor.rebind.SimpleBeanEditorDriverGenerator'/>
            [WARN] Detected warnings related to 'com.google.gwt.editor.client.SimpleBeanEditorDriver'.   Are validation-api-<version>.jar and validation-api-<version>-sources.jar on the classpath?
            [WARN] Unknown type 'com.google.gwt.editor.client.SimpleBeanEditorDriver' specified in deferred binding rule

pom。xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>applicLiquidator</groupId>
    <artifactId>applicLiquidator</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>Vaadin JPAContainer Web Application</name>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <vaadin.version>6.8.13</vaadin.version>
        <jpacontainer.version>2.0.0</jpacontainer.version>
        <gwt.version>2.3.0</gwt.version>
        <gwt.plugin.version>2.3.0-1</gwt.plugin.version>
    </properties>
    <repositories>
        <repository>
            <id>vaadin-addons</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>
        <repository>
            <id>vaadin-snapshots</id>
            <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>EclipseLink Repo</id>
            <url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>com.vaadin.addon</groupId>
            <artifactId>jpacontainer-addon-agpl-3.0</artifactId>
            <version>${jpacontainer.version}</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>customfield</artifactId>
            <version>0.9.3</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin.addon</groupId>
            <artifactId>beanvalidation-addon</artifactId>
            <version>1.0.0</version>
        </dependency>
            <dependency>
                <groupId>org.vaadin.addons</groupId>
                <artifactId>filteringtable</artifactId>
                <version>0.8.4</version>
        </dependency>
        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>popupbutton</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>eclipselink</artifactId>
            <version>2.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.3.160</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.2.0.Final</version>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwt.version}</version>
            <scope>provided</scope>
        </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-dev</artifactId>
        <version>${gwt.version}</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>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
     </dependency>
     <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymockclassextension</artifactId>
      <version>3.2</version>
     </dependency>
     <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-easymock</artifactId>
      <version>1.5.2</version>
     </dependency>
     <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <version>1.5.2</version>
     </dependency>
     <dependency>
      <groupId>org.vaadin.addon</groupId>
      <artifactId>confirmdialog</artifactId>
      <version>1.2.1</version>
     </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

共 (1) 个答案

  1. # 1 楼答案

    我觉得这是我读过的最完整的疑难解答(简短且非常精确/专业)。我向所有似乎陷入困境的人推荐:

    在我的特殊情况下,第一个问题是我的网络中有两个应用程序。xml:(只接受第二个未在参数中设置小部件的参数:

    无论如何,通过从命令提示符安装和运行mvn,编译/依赖性问题得到了解决 (但命令相同,但环境不同)