Google App Engine上的Spring Boot应用程序:无法找到主类

在8点:

我有一个在GCP上运行的Spring Boot应用程序(至今已有1年),我想对其进行更新,但是在mvn appengine:run本地运行时出现此错误:

[INFO] GCLOUD: INFOS: javax.servlet.ServletContext log: 2 Spring WebApplicationInitializers detected on classpath
[INFO] GCLOUD: java.lang.IllegalArgumentException: Unable to find the main class to restart
[INFO] GCLOUD:  at org.springframework.util.Assert.notNull(Assert.java:198)
[INFO] GCLOUD:  at org.springframework.boot.devtools.restart.Restarter.doStart(Restarter.java:277)
[INFO] GCLOUD:  at org.springframework.boot.devtools.restart.Restarter.start(Restarter.java:265)
[INFO] GCLOUD:  at org.springframework.boot.devtools.restart.Restarter.lambda$immediateRestart$0(Restarter.java:173)
[INFO] GCLOUD:  at org.springframework.boot.devtools.restart.Restarter$LeakSafeThread.run(Restarter.java:637)
[INFO] GCLOUD: d?c. 02, 2018 4:30:20 PM com.google.appengine.api.datastore.dev.LocalDatastoreService cleanupActiveServices
[INFO] GCLOUD: INFOS: scheduler shutting down.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  53.255 s
[INFO] Finished at: 2018-12-02T17:30:21+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:run (default-cli) on project sample-app: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:run failed: Non zero exit: 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:run (default-cli) on project tacos-time29: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.1:run failed: Non zero exit: 1
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)

主类有问题。在我的pom.xm中,我定义了以下内容:

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <appengine.maven.plugin>1.3.1</appengine.maven.plugin>
    <!--Definition of the main class-->
    <start-class>com.example.sample.Application</start-class>
</properties>

我还在spring-boot-plugin中定义了主类

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <mainClass>${start-class}</mainClass>
    </configuration>
</plugin>

并且/WEB-INF/appengine-web.xml文件的内容是基本的:

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <version>1</version>
    <threadsafe>true</threadsafe>
    <runtime>java8</runtime>
</appengine-web-app>

谢谢你的帮助

在8点:

我在这里找到了解决方案:https : //github.com/GoogleCloudPlatform/gradle-appengine-plugin/issues/294只需删除devtools依赖项即可。这是很奇怪的行为

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Google App Engine上的Spring Boot

Google App Engine中的Spring Boot应用程序无法连接到Cloud SQL

Google App Engine上的Spring Boot REST抛出502

在Django应用程序的Google App Engine上启用CORS

Google App Engine Java上的RESTful应用程序?

在Google App Engine上实施Spring Security

在 Google App Engine 上部署现有的 Spring Boot 应用程序

无法在我的自定义域上打开 Google App Engine 应用程序

KeystoneJS 应用程序无法在 Google App Engine 上部署

记录Google App Engine应用程序

Spring Boot的Google App Engine tomcat错误

如何通过PHP App Engine应用程序在Google Compute Engine实例上创建cron作业?

Google App Engine-Flask应用程序绕过Devserver上的标准Google Auth

从Google App Engine应用程序运行Google Dataflow管道?

Spring Hibernate在Google App Engine上给出LazyInitializationException

Google App Engine Go 1.11应用程序无法访问Google Spreadsheets

从开发者控制台读取 Google App Engine 上的应用程序日志

在多个客户域上运行Google App Engine应用程序

在Google的App Engine上使用Python,PHP和HTML制作应用程序

如何使网络应用程序自动下载 mp3 文件 [Google App Engine 上的 Flask]

CQRS是在Google App Engine上实现社交应用程序的好方法吗?

在 Google App Engine 上推送 AngularJs 应用程序时删除评论和日志

Google APP Engine PHP应用程序上的警告mkdir()权限被拒绝

在Google App Engine上运行的NextJs应用程序的正确配置是什么?

如何在Google App Engine上重新部署应用程序?

我可以在AWS Amazon上上传使用Google App Engine编程的网络应用程序吗?

通过appassembler-maven-plugin生成的脚本无法在Spring Boot应用程序中找到主类

在 google-app-engine 上部署的 sping-boot 应用程序中出现 413 错误

Google App Engine上的OSGI?