成功部署了Spring引导应用程序后出现的Heroku H10错误

时间:2020-07-14 17:16:48

标签: java mysql spring heroku thymeleaf

我已经在SO上搜索了此错误,但是似乎有很多原因可以导致出现此错误,而且似乎与我的相似。

我是Heroku的新手,这实际上是我在该平台上的首次部署。我创建了一个带有百里香和mysql数据库的Spring引导应用程序。我正在使用herokus自己的ClearDB云数据库,该数据库已成功连接到本地rdbms。该应用已在平台上与git存储库同步。

该应用程序可在localhost上正常运行,并且已按照平台说明已成功部署在heroku上。每次尝试从heroku启动应用程序时,都会收到应用程序错误。日志显示以下内容:

2020-07-14T14:13:38.972105+00:00 app[web.1]: Error: Could not create the Java Virtual Machine.
2020-07-14T14:13:38.972108+00:00 app[web.1]: Error: A fatal exception has occurred. Program will exit.
2020-07-14T14:13:39.017969+00:00 heroku[web.1]: Process exited with status 1
2020-07-14T14:13:39.062501+00:00 heroku[web.1]: State changed from starting to crashed
2020-07-14T14:15:20.313138+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=roommanager1.herokuapp.com request_id=35122073-efb5-4244-852d-cdf1778cf919 fwd="86.124.21.129" dyno= connect= service= status=503 bytes= protocol=https
2020-07-14T14:15:20.848774+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=roommanager1.herokuapp.com request_id=b9e45355-eb87-4a0f-8528-b47b5eaffdab fwd="86.124.21.129" dyno= connect= service= status=503 bytes= protocol=https
2020-07-14T14:15:59.976811+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=roommanager1.herokuapp.com request_id=939747d9-8e28-40b2-81aa-bcfebbfa3241 fwd="86.124.21.129" dyno= connect= service= status=503 bytes= protocol=https
2020-07-14T14:16:00.206366+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=roommanager1.herokuapp.com request_id=43ee5528-26ee-4668-a226-504f8f7636d1 fwd="86.124.21.129" dyno= connect= service= status=503 bytes= protocol=https
2020-07-14T14:33:14.438079+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=roommanager1.herokuapp.com request_id=7d9e0f13-badd-4579-aab8-5b48bd5f0cb5 fwd="86.124.21.129" dyno= connect= service= status=503 bytes= protocol=https
2020-07-14T14:33:14.947903+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=roommanager1.herokuapp.com request_id=0030f545-f148-4dc8-a256-cca5a0abbbc0 fwd="86.124.21.129" dyno= connect= service= status=503 bytes= protocol=https
2020-07-14T14:38:51.155083+00:00 heroku[web.1]: State changed from crashed to starting
2020-07-14T14:38:54.791871+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS - jar target/roomManager-0.0.1-SNAPSHOT.jar -Dserver.port=#PORT $JAR_OPTS`
2020-07-14T14:38:56.104659+00:00 heroku[web.1]: Process exited with status 1
2020-07-14T14:38:56.126096+00:00 heroku[web.1]: State changed from starting to crashed
2020-07-14T14:38:56.065158+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-07-14T14:38:56.068366+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8 
2020-07-14T14:38:56.068437+00:00 app[web.1]: Unrecognized option: -
2020-07-14T14:38:56.068438+00:00 app[web.1]: Error: Could not create the Java Virtual Machine.
2020-07-14T14:38:56.068440+00:00 app[web.1]: Error: A fatal exception has occurred. Program will exit.
2020-07-14T15:19:49.301124+00:00 heroku[web.1]: State changed from crashed to starting
2020-07-14T15:19:53.370758+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS - jar target/roomManager-0.0.1-SNAPSHOT.jar -Dserver.port=#PORT $JAR_OPTS`
2020-07-14T15:19:55.205516+00:00 heroku[web.1]: Process exited with status 1
2020-07-14T15:19:55.244509+00:00 heroku[web.1]: State changed from starting to crashed
2020-07-14T15:19:55.162382+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-07-14T15:19:55.166086+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8 
2020-07-14T15:19:55.166162+00:00 app[web.1]: Unrecognized option: -
2020-07-14T15:19:55.166163+00:00 app[web.1]: Error: Could not create the Java Virtual Machine.
2020-07-14T15:19:55.166163+00:00 app[web.1]: Error: A fatal exception has occurred. Program will exit.
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
Connection to log stream failed. Please try again later.

这是我的应用程序属性

spring.datasource.url=*
spring.datasource.username=*
spring.datasource.password=*

#Conflicts with heroku so have to comment out
#spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect
spring.jpa.hibernate.ddl-auto=update
#Change from never to always in order to add data from .sql to db
spring.datasource.initialization-mode=never
spring.data=data.sql
spring.datasource.max-active=3;
server.port=${PORT:8080}

这是我的procfile,位于应用程序根文件夹中

web: java $JAVA_OPTS - jar target/roomManager-0.0.1-SNAPSHOT.jar -Dserver.port=#PORT $JAR_OPTS

如何使我的应用正常运行?

0 个答案:

没有答案