Problème avec le déploiement de l'application Web Spring Boot: Aucune erreur, mais l'application ne fonctionne toujours pas

Fumée HHH:

Je suis en train d'exécuter une application Boot Spring sur Heroku. J'ai suivi leurs cours d'instruction et ont essayé de déployer mon application, mais pour une raison inconnue, il échoue après.

2019-11-08T12:23:50.484165+00:00 app[web.1]:
2019-11-08T12:23:50.484215+00:00 app[web.1]: .   ____          _            __ _ _
2019-11-08T12:23:50.484401+00:00 app[web.1]: /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
2019-11-08T12:23:50.484501+00:00 app[web.1]: ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2019-11-08T12:23:50.484593+00:00 app[web.1]: \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
2019-11-08T12:23:50.484680+00:00 app[web.1]: '  |____| .__|_| |_|_| |_\__, | / / / /
2019-11-08T12:23:50.484770+00:00 app[web.1]: =========|_|==============|___/=/_/_/_/
2019-11-08T12:23:50.486599+00:00 app[web.1]: :: Spring Boot ::        (v2.2.1.RELEASE)
2019-11-08T12:23:50.486673+00:00 app[web.1]:
2019-11-08T12:23:50.816454+00:00 app[web.1]: 2019-11-08 12:23:50.809  INFO 4 --- [           main] P.p.ProgresstrackerappApplication        : Starting ProgresstrackerappApplication v0.0.1-SNAPSHOT on 8f560338-e240-4b5d-afdf-be7d44992eb6 with PID 4 (/app/target/progresstrackerapp-0.0.1-SNAPSHOT.jar started by u28233 in /app)
2019-11-08T12:23:50.819527+00:00 app[web.1]: 2019-11-08 12:23:50.819  INFO 4 --- [           main] P.p.ProgresstrackerappApplication        : No active profile set, falling back to default profiles: default
2019-11-08T12:23:53.772610+00:00 app[web.1]: 2019-11-08 12:23:53.772  INFO 4 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2019-11-08T12:23:53.791185+00:00 app[web.1]: 2019-11-08 12:23:53.790  INFO 4 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-11-08T12:23:53.791563+00:00 app[web.1]: 2019-11-08 12:23:53.791  INFO 4 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.27]
2019-11-08T12:23:53.897317+00:00 app[web.1]: 2019-11-08 12:23:53.897  INFO 4 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-11-08T12:23:53.897452+00:00 app[web.1]: 2019-11-08 12:23:53.897  INFO 4 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2928 ms
2019-11-08T12:23:54.261713+00:00 app[web.1]: 2019-11-08 12:23:54.261  INFO 4 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-11-08T12:23:54.413274+00:00 app[web.1]: 2019-11-08 12:23:54.412  INFO 4 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
2019-11-08T12:23:54.709609+00:00 app[web.1]: 2019-11-08 12:23:54.709  INFO 4 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2019-11-08T12:23:54.715140+00:00 app[web.1]: 2019-11-08 12:23:54.714  INFO 4 --- [           main] P.p.ProgresstrackerappApplication        : Started ProgresstrackerappApplication in 5.801 seconds (JVM running for 6.938)
2019-11-08T12:24:00.589583+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=progresstrackerapp.herokuapp.com request_id=68c7754f-2c39-4cf8-b207-426af344f40c fwd="xxx.xxx.xxx.xxx" dyno= connect= service= status=503 bytes= protocol=https

J'edited mon IP du texte. Toute idée de ce qui pourrait provoquer le délai d'attente?

EDIT 1: Certaines choses que j'ai: j'ai ajouté le Procfile par moi-même dans le répertoire racine de l'application car sans elle, mon application plantait

web java -jar target/progresstrackerapp-0.0.1-SNAPSHOT.jar

Aussi pour les commandes que j'ai fait:

git add .
git commit -m "s1"
git push heroku master

La construction de l'application était bien et aucun problème est apparu il

heroku ps:scale:1 // this resulted in the problem

EDIT 2:

J'ai trouvé le problem.It semble que je devais spécifier un chemin variable d'environnement. Heroku a besoin de cette variable pour être en mesure de déployer sur lui car il est le travail du développeur de l'inclure. C'est ce qu'il fixe pour moi.

codefinger:

Assurez-vous de liaison au port correct en passant -Dserver.port=$PORTà votre Procfilecommande

Je suppose que tu aimes

Origine http://43.154.161.224:23101/article/api/json?id=362267&siteId=1
conseillé
Classement