作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将我的 PubSub-Maven 项目部署到 Appengine。部署成功,但登录后出现错误:
Error for /
java.lang.NoClassDefFoundError: com/google/api/services/pubsub/PubsubScopes
at com.wi.pubsubtest.util.PubsubUtils.getClient(PubsubUtils.java:80)
at de.com.wi.pubsubtest.util.PubsubUtils.getClient(PubsubUtils.java:60)
.....
对于包装,我使用这个 pom:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml>
<appengine.maven.plugin>1.3.1</appengine.maven.plugin>
<jetty.maven.plugin>9.4.3.v20170317</jetty.maven.plugin>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-core</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
<version>0.6.1</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>0.6.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>0.17.2-alpha</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-datastore</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.21.0</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client-appengine</artifactId>
<version>1.21.0</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client-servlet</artifactId>
<version>1.21.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.maven.plugin}</version>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.maven.plugin}</version>
<configuration>
<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion> </configuration>
</plugin>
</plugins>
</build>
最佳答案
com.google.api.services.pubsub
包通过 google-api-services-pubsub
dependency 导出。所以你必须将它添加到你的项目中。
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-pubsub</artifactId>
<version>v1-rev356-1.22.0</version>
</dependency>
关于java - 错误/java.lang.NoClassDefFoundError : com/google/api/services/pubsub/PubsubScopes,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44474055/
我正在尝试将我的 PubSub-Maven 项目部署到 Appengine。部署成功,但登录后出现错误: Error for / java.lang.NoClassDefFoundError: com
我是一名优秀的程序员,十分优秀!