将spring boot应用程序部署到heroku-错误消息"App crash" [英] Deploying spring boot application to heroku - error message "App crashed"

查看:114
本文介绍了将spring boot应用程序部署到heroku-错误消息"App crash"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Spring boot Web应用程序(在IntelliJ IDEA中),该应用程序在本地运行没有问题.

I created a spring boot web application (in IntelliJ IDEA), which runs locally without problems.

我试图按照heroku在本演练中描述的确切步骤将应用程序部署到heroku:

I tried to deploy the app to heroku following exactly the steps described in this walkthrough by heroku: https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku

注意:本演练没有提到Procfile,所以我没有创建一个.

Note: the walkthrough does not mention a Procfile so I didn't create one.

在浏览器中打开应用程序的地址时,我遇到了应用程序错误".

When opening the app's address in the browser I faced an "Application error".

日志显示该应用显然已崩溃:

The logs show that apparently the app crashed:

2020-02-09T17:15:47.060408 + 00:00 heroku [web.1]:进程退出 状态1 2020-02-09T17:15:49.097143 + 00:00 heroku [router]:at = error 代码= H10 desc =应用程序崩溃"方法=获取路径="/" host = blooming-flowers-53454.herokuapp.com request_id = a1f16198-0b1d-4ef5-8fe4-46f7c5948230 fwd ="95.88.203.176" dyno = connect = service = status = 503字节= protocol = https

2020-02-09T17:15:47.060408+00:00 heroku[web.1]: Process exited with status 1 2020-02-09T17:15:49.097143+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=blooming-flowers-53454.herokuapp.com request_id=a1f16198-0b1d-4ef5-8fe4-46f7c5948230 fwd="95.88.203.176" dyno= connect= service= status=503 bytes= protocol=https

2020-02-09T17:15:50.127601 + 00:00 heroku [router]:at =错误代码= H10 desc =应用程序崩溃"方法=获取路径="/favicon.ico" host = blooming-flowers-53454.herokuapp.com request_id = c463c2ed-6660-429d-88fd-52172fcd5677 fwd ="95.88.203.176" dyno = connect = service = status = 503字节= protocol = https

2020-02-09T17:15:50.127601+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=blooming-flowers-53454.herokuapp.com request_id=c463c2ed-6660-429d-88fd-52172fcd5677 fwd="95.88.203.176" dyno= connect= service= status=503 bytes= protocol=https

为什么该应用程序在本地运行时没有问题,但是在heroku上崩溃了?

Why does the app run locally without problems but crashes on heroku?

推荐答案

更详细地研究了日志之后,我找出了引起问题的原因. 已为MySQL数据库(我在本地使用)配置了application.properties文件.

After studying the logs in more detail I found out what caused the problem. The file application.properties was configured for a MySQL database (which I used locally).

我更改了文件的内容,现在看起来如下:

I changed the content of the file, which now looks as follows:

spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.maxActive=10
spring.datasource.maxIdle=5
spring.datasource.minIdle=2
spring.datasource.initialSize=5
spring.datasource.removeAbandoned=true
spring.jpa.hibernate.ddl-auto=create

现在一切正常.

这篇关于将spring boot应用程序部署到heroku-错误消息"App crash"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆