gpt4 book ai didi

java - 无法运行 vaadin 的 java 教程 - 缺少类

转载 作者:行者123 更新时间:2023-12-02 02:23:58 28 4
gpt4 key购买 nike

我尝试通过 tutorial 进入 Vaadin .

我做了那里描述的所有事情,但我什至无法在没有构建失败的情况下运行它。我创建了一个新的 Maven 项目并选择 Vaadin 作为原型(prototype)。之后,我在我的项目上安装了 Maven,并成功完成。从那时起,我按照教程配置了调试设置并在 Debug模式下运行程序,但不幸的是我得到了以下错误,我不知道出了什么问题(教程中的图5-7)。

[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.3.9.v20160517:run (default-cli) on project app: Execution default-cli of goal org.eclipse.jetty:jetty-maven-plugin:9.3.9.v20160517:run failed: A required class was missing while executing org.eclipse.jetty:jetty-maven-plugin:9.3.9.v20160517:run: javax/servlet/http/HttpServletResponse
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.eclipse.jetty:jetty-maven-plugin:9.3.9.v20160517
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-maven-plugin/9.3.9.v20160517/jetty-maven-plugin-9.3.9.v20160517.jar
[ERROR] urls[1] = file:/C:/Users/User1/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.1.1/sisu-inject-bean-2.1.1.jar
[ERROR] urls[2] = file:/C:/Users/User1/.m2/repository/org/sonatype/sisu/sisu-guice/2.9.4/sisu-guice-2.9.4-no_aop.jar
[ERROR] urls[3] = file:/C:/Users/User1/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.6/plexus-utils-2.0.6.jar
[ERROR] urls[4] = file:/C:/Users/User1/.m2/repository/org/sonatype/aether/aether-util/1.11/aether-util-1.11.jar
[ERROR] urls[5] = file:/C:/Users/User1/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[6] = file:/C:/Users/User1/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[7] = file:/C:/Users/User1/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[8] = file:/C:/Users/User1/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[9] = file:/C:/Users/User1/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-tools-api/3.4/maven-plugin-tools-api-3.4.jar
[ERROR] urls[10] = file:/C:/Users/User1/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[11] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-util/9.3.9.v20160517/jetty-util-9.3.9.v20160517.jar
[ERROR] urls[12] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-webapp/9.3.9.v20160517/jetty-webapp-9.3.9.v20160517.jar
[ERROR] urls[13] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-xml/9.3.9.v20160517/jetty-xml-9.3.9.v20160517.jar
[ERROR] urls[14] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-servlet/9.3.9.v20160517/jetty-servlet-9.3.9.v20160517.jar
[ERROR] urls[15] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-quickstart/9.3.9.v20160517/jetty-quickstart-9.3.9.v20160517.jar
[ERROR] urls[16] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-jaas/9.3.9.v20160517/jetty-jaas-9.3.9.v20160517.jar
[ERROR] urls[17] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-security/9.3.9.v20160517/jetty-security-9.3.9.v20160517.jar
[ERROR] urls[18] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-plus/9.3.9.v20160517/jetty-plus-9.3.9.v20160517.jar
[ERROR] urls[19] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-jndi/9.3.9.v20160517/jetty-jndi-9.3.9.v20160517.jar
[ERROR] urls[20] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-server/9.3.9.v20160517/jetty-server-9.3.9.v20160517.jar
[ERROR] urls[21] = file:/C:/Users/User1/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar
[ERROR] urls[22] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-http/9.3.9.v20160517/jetty-http-9.3.9.v20160517.jar
[ERROR] urls[23] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-io/9.3.9.v20160517/jetty-io-9.3.9.v20160517.jar
[ERROR] urls[24] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-jmx/9.3.9.v20160517/jetty-jmx-9.3.9.v20160517.jar
[ERROR] urls[25] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-annotations/9.3.9.v20160517/jetty-annotations-9.3.9.v20160517.jar
[ERROR] urls[26] = file:/C:/Users/User1/.m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar
[ERROR] urls[27] = file:/C:/Users/User1/.m2/repository/org/ow2/asm/asm/5.0.1/asm-5.0.1.jar
[ERROR] urls[28] = file:/C:/Users/User1/.m2/repository/org/ow2/asm/asm-commons/5.0.1/asm-commons-5.0.1.jar
[ERROR] urls[29] = file:/C:/Users/User1/.m2/repository/org/ow2/asm/asm-tree/5.0.1/asm-tree-5.0.1.jar
[ERROR] urls[30] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/javax-websocket-server-impl/9.3.9.v20160517/javax-websocket-server-impl-9.3.9.v20160517.jar
[ERROR] urls[31] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/javax-websocket-client-impl/9.3.9.v20160517/javax-websocket-client-impl-9.3.9.v20160517.jar
[ERROR] urls[32] = file:/C:/Users/User1/.m2/repository/javax/websocket/javax.websocket-api/1.0/javax.websocket-api-1.0.jar
[ERROR] urls[33] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/websocket-server/9.3.9.v20160517/websocket-server-9.3.9.v20160517.jar
[ERROR] urls[34] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/websocket-common/9.3.9.v20160517/websocket-common-9.3.9.v20160517.jar
[ERROR] urls[35] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/websocket-api/9.3.9.v20160517/websocket-api-9.3.9.v20160517.jar
[ERROR] urls[36] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/websocket-client/9.3.9.v20160517/websocket-client-9.3.9.v20160517.jar
[ERROR] urls[37] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/websocket-servlet/9.3.9.v20160517/websocket-servlet-9.3.9.v20160517.jar
[ERROR] urls[38] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/apache-jsp/9.3.9.v20160517/apache-jsp-9.3.9.v20160517.jar
[ERROR] urls[39] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/toolchain/jetty-schemas/3.1/jetty-schemas-3.1.jar
[ERROR] urls[40] = file:/C:/Users/User1/.m2/repository/org/mortbay/jasper/apache-jsp/8.0.33/apache-jsp-8.0.33.jar
[ERROR] urls[41] = file:/C:/Users/User1/.m2/repository/org/mortbay/jasper/apache-el/8.0.33/apache-el-8.0.33.jar
[ERROR] urls[42] = file:/C:/Users/User1/.m2/repository/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.jar
[ERROR] urls[43] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/apache-jstl/9.3.9.v20160517/apache-jstl-9.3.9.v20160517.jar
[ERROR] urls[44] = file:/C:/Users/User1/.m2/repository/org/apache/taglibs /taglibs-standard-spec/1.2.5/taglibs-standard-spec-1.2.5.jar
[ERROR] urls[45] = file:/C:/Users/User1/.m2/repository/org/apache/taglibs/taglibs-standard-impl/1.2.5/taglibs-standard-impl-1.2.5.jar
[ERROR] urls[46] = file:/C:/Users/User1/.m2/repository/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: javax.servlet.http.HttpServletResponse

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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>my.vaadin</groupId>
<artifactId>app</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>app</name>

<prerequisites>
<maven>3</maven>
</prerequisites>

<properties>
<vaadin.version>8.0.0</vaadin.version>
<vaadin.plugin.version>8.0.0</vaadin.plugin.version>
<jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- If there are no local customisations, this can also be "fetch" or "cdn" -->
<vaadin.widgetset.mode>local</vaadin.widgetset.mode>
</properties>

<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- Exclude an unnecessary file generated by the GWT compiler. -->
<packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
<!-- Comment out compile-theme goal to use on-the-fly theme compilation -->
<goal>compile-theme</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<!-- Clean up also any pre-compiled themes -->
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/themes</directory>
<includes>
<include>**/styles.css</include>
<include>**/styles.scss.cache</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>

<!-- The Jetty plugin allows us to easily test the development build by
running jetty:run on the command line. -->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.plugin.version}</version>
<configuration>
<scanIntervalSeconds>2</scanIntervalSeconds>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<!-- Vaadin pre-release repositories -->
<id>vaadin-prerelease</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>

<repositories>
<repository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</pluginRepository>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

最佳答案

看起来一样error

检查您的 java 和 maven 版本并确保它们兼容。

关于java - 无法运行 vaadin 的 java 教程 - 缺少类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48063475/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com