Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JHipster cannot login after starting with yarn start (webpack)

I cannot login with default admin or test into the generated JHipster (4.2.0) monolithic app (maven, mysql on dev&prod, ES, Angular4 with i18n - no proxy set) after starting it with "yarn start" (works with "./mvnw" though).

Console log:

[HPM] Error occurred while trying to proxy request /api/profile-info from localhost:9060 to http://127.0.0.1:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors) [HPM] Error occurred while trying to proxy request /api/account from localhost:9060 to http://127.0.0.1:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors) [HPM] Error occurred while trying to proxy request /api/profile-info from localhost:9060 to http://127.0.0.1:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors) [HPM] Error occurred while trying to proxy request /api/authentication from localhost:9060 to http://127.0.0.1:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors) [HPM] Error occurred while trying to proxy request /api/logout from localhost:9060 to http://127.0.0.1:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)

Before start I ran a maven test with the wrapper and started the mysql & elasticsearch docker containers (generated in src/main/docker).

Any ideas would be greatly appreciated, thanks in advance.

like image 588
hypnus Avatar asked Dec 10 '22 12:12

hypnus


2 Answers

The error means that browsersync/webpack could not connect to the java backend on port 8080 for proxying API calls: the spring boot application must be running. You must run both "./mvnw" and "yarn start". See documentation and webpack/webpack.dev.js file

like image 62
Gaël Marziou Avatar answered Jan 02 '23 16:01

Gaël Marziou


You can also force maven/gradle to run the webpack:dev task while starting by passing the webpack profile like ./mvnw -Pdev,webpack or ./gradlew -Pdev -Pwebpack. This is especially helpful after running a clean task.

like image 39
manju mathew Avatar answered Jan 02 '23 16:01

manju mathew