如何使用 JHipster 在 Heroku 中调试响应"您的请求无法处理"的应用程序?



我在Heroku中部署JHipster时遇到了问题。我用 Jhipster 创建了一个新的项目,在我的本地主机中运行良好:

? Which *type* of application would you like to create? Monolithic application (recommended for simple projects)
? What is the base name of your application? herokutest2
? What is your default Java package name? heroku
? Do you want to use the JHipster Registry to configure, monitor and scale your application? No
? Which *type* of authentication would you like to use? HTTP Session Authentication (stateful, default Spring Security mechanism)
? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL)
? Which *production* database would you like to use? PostgreSQL
? Which *development* database would you like to use? H2 with in-memory persistence
? Do you want to use the Spring cache abstraction? Yes, with the Ehcache implementation (local cache, for a single node)
? Do you want to use Hibernate 2nd level cache? Yes
? Would you like to use Maven or Gradle for building the backend? Gradle
? Which other technologies would you like to use?
? Which *Framework* would you like to use for the client? Angular 5
? Would you like to enable *SASS* support using the LibSass stylesheet preprocessor? No
? Would you like to enable internationalization support? No
? Besides JUnit and Karma, which testing frameworks would you like to use?
? Would you like to install other generators from the JHipster Marketplace? No

所以我有一个运行良好的工作应用程序。然后我在 Heroku 中部署应用程序,而不对原始 Jhipster 项目进行任何更改。

我> heroku 登录,>运行 jhipster heroku,在美国部署,使用 GIT(在 heroku 中编译(,所以最后我打开我的 heroku,主页 url 显示以下错误。

Your request cannot be processed
Sorry, an error has occurred.
Status: Not Found (Not Found)
Message: No message available

日志是这样说的:

module: @oclif/config@1.6.18
task: runHook prerun
plugin: heroku
root: C:Program Filesherokuclient
2018-05-23T08:54:09.105823+00:00 app[api]: Release v1 created by user ecorreos@hotmail.com
2018-05-23T08:54:09.105823+00:00 app[api]: Initial release by user ecorreos@hotmail.com
2018-05-23T08:54:09.419215+00:00 app[api]: Release v2 created by user ecorreos@hotmail.com
2018-05-23T08:54:09.419215+00:00 app[api]: Enable Logplex by user ecorreos@hotmail.com
2018-05-23T08:54:11.830176+00:00 app[api]: Release v3 created by user ecorreos@hotmail.com
2018-05-23T08:54:11.830176+00:00 app[api]: Attach DATABASE (@ref:postgresql-globular-46720) by user ecorreos@hotmail.com
2018-05-23T08:54:23.966535+00:00 app[api]: Release v4 created by user ecorreos@hotmail.com
2018-05-23T08:54:23.966535+00:00 app[api]: Set NPM_CONFIG_PRODUCTION config vars by user ecorreos@hotmail.com
2018-05-23T08:54:37.000000+00:00 app[api]: Build started by user ecorreos@hotmail.com
2018-05-23T08:57:51.024261+00:00 app[api]: Release v5 created by user ecorreos@hotmail.com
2018-05-23T08:57:51.024261+00:00 app[api]: Deploy ff0268cc by user ecorreos@hotmail.com
2018-05-23T08:57:51.038692+00:00 app[api]: Scaled to web@1:Free by user ecorreos@hotmail.com
2018-05-23T08:57:51.000000+00:00 app[api]: Build succeeded
2018-05-23T08:57:56.986887+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -Xmx256m -jar build/libs/*.war --spring.profiles.active=prod,heroku --server.port=39350`
2018-05-23T08:57:58.659062+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2018-05-23T08:57:58.662162+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -Dfile.encoding=UTF-8
2018-05-23T08:58:00.746362+00:00 app[web.1]:
2018-05-23T08:58:00.746408+00:00 app[web.1]: ██╗ ██╗   ██╗ ████████��� ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
2018-05-23T08:58:00.746410+00:00 app[web.1]: ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
2018-05-23T08:58:00.746414+00:00 app[web.1]: ██╗   ██║ ██╔═══██║    ██║    ██╔════╝   ╚═══██╗    ██║    ██╔═══╝   ██╔══██║
2018-05-23T08:58:00.746412+00:00 app[web.1]: ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝
2018-05-23T08:58:00.746418+00:00 app[web.1]: ╚═════╝  ╚═╝   ╚═╝ ╚═══════╝ ╚═╝       ╚═════╝     ╚═╝    ╚═══════╝ ╚═╝   ╚═╝
2018-05-23T08:58:00.746420+00:00 app[web.1]:
2018-05-23T08:58:00.746416+00:00 app[web.1]: ╚██████╔╝ ██║   ██║ ████████�� ██║       ██████╔╝    ██║    ████████╗ ██║  ╚██╗
2018-05-23T08:58:00.746422+00:00 app[web.1]: :: JHipster 🤓  :: Running Spring Boot 1.5.12.RELEASE ::
2018-05-23T08:58:00.746424+00:00 app[web.1]: :: http://www.jhipster.tech ::
2018-05-23T08:58:00.746435+00:00 app[web.1]:
2018-05-23T08:58:00.982003+00:00 app[web.1]: 2018-05-23 08:58:00.975  INFO 4 --- [           main] heroku.Herokutest2App                    : Starting Herokutest2App on 51c5056d-8cde-42cf-a075-924e1c710e21 with PID 4 (/app/build/libs/herokutest-2-0.0.1-SNAPSHOT.war started by u45925 in /app)2018-05-23T08:58:00.982623+00:00 app[web.1]: 2018-05-23 08:58:00.982  INFO 4 --- [           main] heroku.Herokutest2App                    : The following profiles are active: prod,heroku
2018-05-23T08:58:06.548212+00:00 app[web.1]: 2018-05-23 08:58:06.546  INFO 4 --- [           main] heroku.config.WebConfigurer              : Web application configuration, using profiles: prod
2018-05-23T08:58:06.557755+00:00 app[web.1]: 2018-05-23 08:58:06.557  INFO 4 --- [           main] heroku.config.WebConfigurer              : Web application fully configured
2018-05-23T08:58:08.442500+00:00 app[web.1]: 2018-05-23 08:58:08.442  WARN 4 --- [st-2-Executor-1] i.g.j.c.liquibase.AsyncSpringLiquibase   : Starting Liquibase asynchronously, your database might not be ready at startup!
2018-05-23T08:58:21.497048+00:00 app[web.1]: 2018-05-23 08:58:21.496  INFO 4 --- [           main] heroku.Herokutest2App                    : Started Herokutest2App in 21.894 seconds (JVM running for 22.834)
2018-05-23T08:58:21.497770+00:00 app[web.1]: 2018-05-23 08:58:21.497  INFO 4 --- [           main] heroku.Herokutest2App                    :
2018-05-23T08:58:21.497774+00:00 app[web.1]: ----------------------------------------------------------
2018-05-23T08:58:21.497776+00:00 app[web.1]: Application 'herokutest2' is running! Access URLs:
2018-05-23T08:58:21.497778+00:00 app[web.1]: Local:             http://localhost:39350
2018-05-23T08:58:21.497780+00:00 app[web.1]: External:  http://172.18.158.210:39350
2018-05-23T08:58:21.497783+00:00 app[web.1]: Profile(s):        [prod, heroku]
2018-05-23T08:58:21.497785+00:00 app[web.1]: ----------------------------------------------------------
2018-05-23T08:58:22.237880+00:00 heroku[web.1]: State changed from starting to up
2018-05-23T08:59:16.114847+00:00 heroku[router]: at=info method=GET path="/" host=herokutest-2.herokuapp.com request_id=b7c438e8-75d8-486b-9e8b-2bfeb33f5c93 fwd="95.18.239.39" dyno=web.1 connect=1ms service=616ms status=404 bytes=1813 protocol=https
2018-05-23T08:59:16.949795+00:00 heroku[router]: at=info method=GET path="/$%7BbaseUrl%7D/favicon.ico" host=herokutest-2.herokuapp.com request_id=dea0cb4b-9fb9-4885-9b79-569e9f24bd07 fwd="95.18.239.39" dyno=web.1 connect=1ms service=90ms status=404 bytes=571 protocol=https

PD:我把我的信用卡号码给了Heroku;-D

按照乔恩的指示,我尝试了这个:

D:BasuraTemporalBorrarBOOTSRAPJHispterherokugradleraro1>heroku config:set GRADLE_TASK="stage -Pprod" --app=herokugradleraro1
Setting GRADLE_TASK and restarting ⬢ herokugradleraro1... -
(node:15420) SyntaxError Plugin: heroku: C:UsersusuarioAppDataLocalherokuconfig.json: Unexpected string in JSON at position 72
module: @oclif/config@1.6.18
task: runHook prerun
plugin: heroku
Setting GRADLE_TASK and restarting ⬢ herokugradleraro1... !
!    Couldn't find that app.
D:BasuraTemporalBorrarBOOTSRAPJHispterherokugradleraro1>heroku config:set GRADLE_TASK="stage -Pprod" --app herokugradleraro1
Setting GRADLE_TASK and restarting ⬢ herokugradleraro1... -
(node:4544) SyntaxError Plugin: heroku: C:UsersusuarioAppDataLocalherokuconfig.json: Unexpected string in JSON at position 72
module: @oclif/config@1.6.18
task: runHook prerun
plugin: heroku
Setting GRADLE_TASK and restarting ⬢ herokugradleraro1... !
!    Couldn't find that app.

但它没有奏效。我想我会等待版本 5。

此问题的解决方法是为项目设置配置变量。 您可以通过 Heroku 仪表板或 Heroku CLI 执行此操作:

heroku config:set GRADLE_TASK="stage -Pprod" --app your-app-name-here

此修复程序在 v5.0.0-beta.2 及更高版本中不是必需的,由此拉取请求修复。

最新更新