AppEngine standard with Java spring-boot and spring-boot-devtools

151 views
Skip to first unread message

Mustafa Paksoy

unread,
Mar 16, 2018, 8:14:27 PM3/16/18
to Google App Engine
Hi,

Trying to enable auto-restarts and class hot-reloading for a Java app by adding  spring-boot-devtools to an App Engine Standard Java 8 app. I get the following error when I run "mvn appengine:run":

[INFO] GCLOUD: java.lang.IllegalArgumentException: Unable to find the main class to restart
[INFO] GCLOUD: at org.springframework.util.Assert.notNull(Assert.java:134)
[INFO] GCLOUD: at org.springframework.boot.devtools.restart.Restarter.doStart(Restarter.java:285)
[INFO] GCLOUD: at org.springframework.boot.devtools.restart.Restarter.start(Restarter.java:273)
[INFO] GCLOUD: at org.springframework.boot.devtools.restart.Restarter$1.call(Restarter.java:174)
[INFO] GCLOUD: at org.springframework.boot.devtools.restart.Restarter$1.call(Restarter.java:170)
[INFO] GCLOUD: at org.springframework.boot.devtools.restart.Restarter$LeakSafeThread.run(Restarter.java:627)

The app starts fine if I remove the spring-boot-devtools dependency but then I have to restart the app manually every time I change something:

  <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-devtools</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-tomcat</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

Is there a ways to get spring-boot-devtools working with App Engine? What's the recommended way for hot-reloading/auto-restarts for App Engine Java applications?

Full codebase available here for reference: https://github.com/mustpax/appengine-java-spring-boot-test

Thanks!

Jordan (Cloud Platform Support)

unread,
Mar 17, 2018, 6:31:52 PM3/17/18
to Google App Engine
As per the Issue Tracker for the Google Cloud getting-started-java tutorial, it seem this is a known issue. The solution as per the Spring Boot Issue Tracker is to add <optional>true</optional> to your 'org.springframework.boot' dependency. 

- Note that Google Groups is reserved for general product discussions and not for technical support. If you require further technical support for this issue it is recommended to continue all conversations in the open issue report
Reply all
Reply to author
Forward
0 new messages