Investigator
Investigator

Reputation: 1549

JHipster app does not work under prod mode

I have a monolith application that under dev mode everything works ok. When I package the application for production the front-end does not work. The back end runs ok. Do you have any suggestions/advices how to debug this? I have cleaned and reinstalled the node_modules and the yarn.lock file. No difference. Any advice would be really appreciated.

Using JHipster version installed locally in current project's node_modules Executing jhipster:info Options:  Welcome to the JHipster Information Sub-Generator

##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**


<details> <summary>.yo-rc.json file</summary> <pre> {   "generator-jhipster": {
    "promptValues": {
      "packageName": "---"
    },
    "jhipsterVersion": "4.14.0",
    "baseName": "devkit",
    "packageName": "---",
    "packageFolder": "---",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "no",
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "mssql",
    "prodDatabaseType": "mssql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "replaced-by-jhipster-info",
    "clientFramework": "angularX",
    "useSass": false,
    "clientPackageManager": "yarn",
    "applicationType": "monolith",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": false   } } </pre> </details>




##### **Environment and Tools**

java version "1.8.0_161" Java(TM) SE Runtime Environment (build
1.8.0_161-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

git version 2.15.0.windows.1

node: v8.9.4

npm: 5.6.0

yeoman: 2.0.1

yarn: 1.3.2

Docker version 18.03.0-ce, build 0520e24

docker-compose version 1.20.1, build 5d8c71b2

Congratulations, JHipster execution is complete!

enter image description here

enter image description here

Upvotes: 2

Views: 882

Answers (1)

Investigator
Investigator

Reputation: 1549

Trying to produce a jar instead of a war archive broke the application under prod mode. Changing the filename of the archive that will be produced is easy by simply including the <fileName> tag under the build tag but if you want to change the extensions then do not change the <packaging> tag since this will break the app under production.

UPDATE: I found that simply renaming the file from war to jar by hand (manually) breaks the front end with the previous described error.

Upvotes: 1

Related Questions