Heroku spring应用构建成功,但运行失败



我使用Spring构建了一个web应用程序,它在本地主机上工作。当我将它部署到heroku并使用以下日志

时,构建成功了。
-----> Building on the Heroku-18 stack
-----> Java app detected
-----> Installing JDK 11... done
-----> Executing Maven
$ ./mvnw -DskipTests clean dependency:list install
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------------< sg.edu.iss:mytrial >-------------------------
[INFO] Building mytrial 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ mytrial ---
[INFO] 
[INFO] --- maven-dependency-plugin:3.1.2:list (default-cli) @ mytrial ---
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ mytrial ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 27 resources
[INFO] The encoding used to copy filtered properties files have not been set. This means that the same encoding will be used to copy filtered properties files as when copying other filtered resources. This might not be what you want! Run your build with --debug to see which files might be affected. Read more at https://maven.apache.org/plugins/maven-resources-plugin/examples/filtering-properties-files.html
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ mytrial ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 57 source files to /tmp/build_901df98b/target/classes
[INFO] /tmp/build_901df98b/src/main/java/sg/edu/iss/ca/controller/MyErrorController.java: /tmp/build_901df98b/src/main/java/sg/edu/iss/ca/controller/MyErrorController.java uses or overrides a deprecated API.
[INFO] /tmp/build_901df98b/src/main/java/sg/edu/iss/ca/controller/MyErrorController.java: Recompile with -Xlint:deprecation for details.
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ mytrial ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /tmp/build_901df98b/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ mytrial ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to /tmp/build_901df98b/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ mytrial ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ mytrial ---
[INFO] Building jar: /tmp/build_901df98b/target/mytrial-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.4.1:repackage (repackage) @ mytrial ---
[INFO] Replacing main artifact with repackaged archive
[INFO] 
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ mytrial ---
[INFO] Installing /tmp/build_901df98b/target/mytrial-0.0.1-SNAPSHOT.jar to /tmp/codon/tmp/cache/.m2/repository/sg/edu/iss/mytrial/0.0.1-SNAPSHOT/mytrial-0.0.1-SNAPSHOT.jar
[INFO] Installing /tmp/build_901df98b/pom.xml to /tmp/codon/tmp/cache/.m2/repository/sg/edu/iss/mytrial/0.0.1-SNAPSHOT/mytrial-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  11.243 s
[INFO] Finished at: 2021-03-10T02:49:37Z
[INFO] ------------------------------------------------------------------------
-----> Discovering process types
Procfile declares types     -> (none)
Default types for buildpack -> web
-----> Compressing...
Done: 102.6M
-----> Launching...
Released v30
https://cims-spring.herokuapp.com/ deployed to Heroku

然而,当我尝试运行应用程序时,在我的heroku日志中显示以下错误:

2021-03-10T02:51:20.125315+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=cims-spring.herokuapp.com request_id=e3bf1cbe-0a85-46a6-91c5-e9be443b8724 fwd="220.255.55.225" dyno= connect= service= status=503 bytes= protocol=https
2021-03-10T02:51:20.565627+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=cims-spring.herokuapp.com request_id=540479be-1d1b-4504-b2b2-90605841225f fwd="220.255.55.225" dyno= connect= service= status=503 bytes= protocol=https

代码的存储库可以在这里找到

请帮忙,我已经尝试了我能在谷歌找到的一切,我没有想法

Heroku默认使用OpenJDK 8运行您的应用程序,要更改版本,您必须添加一个名为system的文件。

在文件中设置属性java.runtime.version:

java.runtime.version=11

了解更多信息请点击这里https://devcenter.heroku.com/articles/java-support

如果可能的话,您可以将java版本11更改为8,这将更容易在默认情况下使用java 8在Heroku上部署应用程序。