generator-jhipster: Couldn't build monolithic JHipster app for production

Overview of the issue

Couldn’t build monolithic JHipster app for production running

./mvnw -Pprod package

Error log:

[arjuna@arjuna spm]$ ./mvnw -Pprod  package
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< br.ufpa.labes.spm:spm >------------------------
[INFO] Building Spm 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:copy-resources (default-resources) @ spm ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 255 resources
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ spm ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 255 resources
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-versions) @ spm ---
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.2:prepare-agent (pre-unit-tests) @ spm ---
[INFO] argLine set to -javaagent:/home/arjuna/.m2/repository/org/jacoco/org.jacoco.agent/0.8.2/org.jacoco.agent-0.8.2-runtime.jar=destfile=/home/arjuna/Documentos/Algoritmos/JHipster/spm/target/test-results/coverage/jacoco/jacoco.exec -Djava.security.egd=file:/dev/./urandom -Xmx256m
[INFO] 
[INFO] --- git-commit-id-plugin:2.2.5:revision (default) @ spm ---
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.0.8.RELEASE:build-info (default) @ spm ---
[INFO] 
[INFO] --- frontend-maven-plugin:1.6:install-node-and-npm (install node and npm) @ spm ---
[INFO] Node v10.15.0 is already installed.
[INFO] NPM 6.4.1 is already installed.
[INFO] 
[INFO] --- frontend-maven-plugin:1.6:npm (npm install) @ spm ---
[INFO] Running 'npm install' in /home/arjuna/Documentos/Algoritmos/JHipster/spm
[WARNING] npm WARN acorn-dynamic-import@4.0.0 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ajv-keywords@3.4.0 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN bootstrap@4.2.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN bootstrap@4.2.1 requires a peer of popper.js@^1.14.6 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ngx-webstorage@2.0.1 requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
[ERROR] 
[INFO] audited 62948 packages in 13.788s
[INFO] found 74 vulnerabilities (73 low, 1 moderate)
[INFO]   run `npm audit fix` to fix them, or `npm audit` for details
[INFO] 
[INFO] --- frontend-maven-plugin:1.6:npm (webpack build dev) @ spm ---
[INFO] npm not inheriting proxy config from Maven
[INFO] Running 'npm run webpack:build' in /home/arjuna/Documentos/Algoritmos/JHipster/spm
[INFO] 
[INFO] > spm@0.0.0 webpack:build /home/arjuna/Documentos/Algoritmos/JHipster/spm
[INFO] > npm run cleanup && npm run webpack:build:main
[INFO] 
[INFO] 
[INFO] > spm@0.0.0 cleanup /home/arjuna/Documentos/Algoritmos/JHipster/spm
[INFO] > rimraf target/{aot,www}
[INFO] 
[INFO] 
[INFO] > spm@0.0.0 webpack:build:main /home/arjuna/Documentos/Algoritmos/JHipster/spm
[INFO] > npm run webpack -- --config webpack/webpack.dev.js --env.stats=minimal
[INFO] 
[INFO] 
[INFO] > spm@0.0.0 webpack /home/arjuna/Documentos/Algoritmos/JHipster/spm
[INFO] > node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.dev.js" "--env.stats=minimal"
[INFO] 
[INFO] Webpack: Starting ...
[INFO] Starting type checking service...
Webpack: Starting ...
[INFO] 
[INFO]    ✔ Compile modules
[INFO]    ✔ Build modules
[INFO]    ✔ Optimize modules
[INFO]    ✔ Emit files
[INFO] 
[INFO] Webpack: Finished after 29.438 seconds.
[INFO] 
[INFO]  DONE  Compiled successfully in 29455ms22:59:03
[INFO] 
[INFO]    2567 modules
[INFO] 
[INFO] --- frontend-maven-plugin:1.6:npm (webpack build prod) @ spm ---
[INFO] npm not inheriting proxy config from Maven
[INFO] Running 'npm run webpack:prod' in /home/arjuna/Documentos/Algoritmos/JHipster/spm
[INFO] 
[INFO] > spm@0.0.0 webpack:prod /home/arjuna/Documentos/Algoritmos/JHipster/spm
[INFO] > npm run cleanup && npm run webpack:prod:main && npm run clean-www
[INFO] 
[INFO] 
[INFO] > spm@0.0.0 cleanup /home/arjuna/Documentos/Algoritmos/JHipster/spm
[INFO] > rimraf target/{aot,www}
[INFO] 
[INFO] 
[INFO] > spm@0.0.0 webpack:prod:main /home/arjuna/Documentos/Algoritmos/JHipster/spm
[INFO] > npm run webpack -- --config webpack/webpack.prod.js --profile
[INFO] 
[INFO] 
[INFO] > spm@0.0.0 webpack /home/arjuna/Documentos/Algoritmos/JHipster/spm
[INFO] > node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.prod.js" "--profile"
[INFO] 
[ERROR] (node:2238) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
[INFO] 
[INFO] <--- Last few GCs --->
[INFO] 
[INFO] [2238:0x2548ab0]   470274 ms: Mark-sweep 3629.4 (4166.2) -> 3628.0 (4155.8) MB, 1390.0 / 0.0 ms  (average mu = 0.111, current mu = 0.062) allocation failure scavenge might not succeed
[INFO] [2238:0x2548ab0]   470302 ms: Scavenge 3637.5 (4155.8) -> 3637.0 (4163.2) MB, 16.5 / 0.0 ms  (average mu = 0.111, current mu = 0.062) allocation failure 
[INFO] [2238:0x2548ab0]   470331 ms: Scavenge 3646.6 (4163.2) -> 3646.2 (4170.8) MB, 17.2 / 0.0 ms  (average mu = 0.111, current mu = 0.062) allocation failure 
[INFO] 
[INFO] 
[INFO] <--- JS stacktrace --->
[INFO] 
[INFO] ==== JS stack trace =========================================
[INFO] 
[INFO] Security context: 0x15015109e6e1 <JSObject>
[INFO]     0: builtin exit frame: stringify(this=0x150151091a19 <Object map = 0xebe44f042a9>,0x1288ae2026f1 <undefined>,0x1288ae2026f1 <undefined>,0x0ad82e4581d9 <Object map = 0x1581a5b7c8b1>,0x150151091a19 <Object map = 0xebe44f042a9>)
[INFO] 
[INFO]     1: arguments adaptor frame: 1->3
[ERROR] FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
[INFO]     2: /* anonymous */(aka /* anonymous */) [0xb7d55eccf09] [/home/arjuna/Documentos/Algoritmos/JHipster/spm/node_modules/webpack-...
[INFO] 
[ERROR]  1: 0x8db900 node::Abort() [node]
[ERROR]  2: 0x8db94c  [node]
[ERROR]  3: 0xad6c1e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
[ERROR]  4: 0xad6e54 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
[ERROR]  5: 0xec44e2  [node]
[ERROR]  6: 0xec45e8 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
[ERROR]  7: 0xed06c2 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
[ERROR]  8: 0xed0ff4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
[ERROR]  9: 0xed3c61 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
[ERROR] 10: 0xea38ab v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [node]
[ERROR] 11: 0x11d3200 v8::internal::IncrementalStringBuilder::Extend() [node]
[ERROR] 12: 0xf97d0e v8::internal::JsonStringifier::SerializeString(v8::internal::Handle<v8::internal::String>) [node]
[ERROR] 13: 0xf9815b v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
[ERROR] 14: 0xf9d26d v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
[ERROR] 15: 0xf9d8be v8::internal::JsonStringifier::SerializeArrayLikeSlow(v8::internal::Handle<v8::internal::JSReceiver>, unsigned int, unsigned int) [node]
[ERROR] 16: 0xf99f66 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
[ERROR] 17: 0xf9d26d v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
[ERROR] 18: 0xf9d8be v8::internal::JsonStringifier::SerializeArrayLikeSlow(v8::internal::Handle<v8::internal::JSReceiver>, unsigned int, unsigned int) [node]
[ERROR] 19: 0xf99f66 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
[ERROR] 20: 0xf9d26d v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
[ERROR] 21: 0xf9dfc9 v8::internal::JsonStringifier::Stringify(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [node]
[ERROR] 22: 0xba5a21 v8::internal::Builtin_JsonStringify(int, v8::internal::Object**, v8::internal::Isolate*) [node]
[ERROR] 23: 0x2b30828dbf7d 
[ERROR] /home/arjuna/Documentos/Algoritmos/JHipster/spm/node/npm, linha 34:  2227 Abortado                (imagem do núcleo gravada)"$NODE_EXE" "$NPM_CLI_JS" "$@"
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 134
[ERROR] npm ERR! spm@0.0.0 webpack:prod:main: `npm run webpack -- --config webpack/webpack.prod.js --profile`
[ERROR] npm ERR! Exit status 134
[ERROR] npm ERR! 
[ERROR] npm ERR! Failed at the spm@0.0.0 webpack:prod:main script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[ERROR] 
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR!     /home/arjuna/.npm/_logs/2019-02-24T02_07_38_454Z-debug.log
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 134
[ERROR] npm ERR! spm@0.0.0 webpack:prod: `npm run cleanup && npm run webpack:prod:main && npm run clean-www`
[ERROR] npm ERR! Exit status 134
[ERROR] npm ERR! 
[ERROR] npm ERR! Failed at the spm@0.0.0 webpack:prod script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[ERROR] 
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR!     /home/arjuna/.npm/_logs/2019-02-24T02_07_38_747Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  09:30 min
[INFO] Finished at: 2019-02-23T23:07:38-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:npm (webpack build prod) on project spm: Failed to run task: 'npm run webpack:prod' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 134 (Exit value: 134) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Motivation for or Use Case

This could be a bug. I’ve tested just by creating my project but without importing the JDL file to project. It has a very large number of entities and relationships.

Reproduce the error
  1. Create project using jhipster
  2. Imported my JDL file (https://drive.google.com/open?id=1NRKJiZs3T-ipKaCondRlp2fjQIxQVobX) to project
  3. Ran/tested my app (It works fine)
  4. Ran ./mvnw -Pprod package and got the bug
Related issues

Couldn’t find a related issue.

Suggest a Fix

I can’t figure out a solution for my problem.

JHipster Version(s)

Welcome to JHipster v5.8.1

JHipster configuration
{
    "generator-jhipster": {
        "promptValues": {
            "packageName": "br.ufpa.labes.spm",
            "nativeLanguage": "pt-br"
        },
        "jhipsterVersion": "5.8.1",
        "applicationType": "monolith",
        "baseName": "spm",
        "packageName": "br.ufpa.labes.spm",
        "packageFolder": "br/ufpa/labes/spm",
        "serverPort": "8080",
        "authenticationType": "jwt",
        "cacheProvider": "ehcache",
        "enableHibernateCache": true,
        "websocket": false,
        "databaseType": "sql",
        "devDatabaseType": "h2Disk",
        "prodDatabaseType": "mysql",
        "searchEngine": false,
        "messageBroker": false,
        "serviceDiscoveryType": false,
        "buildTool": "maven",
        "enableSwaggerCodegen": false,
        "jwtSecretKey": "secret_key",
        "clientFramework": "angularX",
        "useSass": true,
        "clientPackageManager": "npm",
        "testFrameworks": [],
        "jhiPrefix": "jhi",
        "entitySuffix": "",
        "dtoSuffix": "DTO",
        "otherModules": [],
        "enableTranslation": true,
        "nativeLanguage": "pt-br",
        "languages": ["pt-br", "en"]
    }
}

Also, jhipster info shows up a lot of info about my entities and I can’t anything like that here.

Entity configuration(s) entityName.json files generated in the .jhipster directory

This information is shared with the mentioned link before.

Browsers and Operating System

Manjaro Linux x86_64, Dell Inspiron 15 5000, Kernel: 4.20.10-1-MANJARO

  • Checking this box is mandatory (this is just to show you read everything)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 26 (16 by maintainers)

Most upvoted comments

Hello, @gmarziou, sorry for late response. Currently I’m testing your suggestion. The previous value for the two occurences of --max_old_space_size in package.json was 4096. I increased it up to 8192. Now, command (./mvnw|mvn) -Pprod package hangs at this line:

[ERROR] (node:6782) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead

I can’t say when it’s gonna stop. Thank you all for replying!