I have a problem with JHipster. I cannot import any JDL Files in projects just created from scratch. Even the jdl-samples from JHipster don't work. I always get the same error:
events.js:182
throw er; // Unhandled 'error' event
^
Error: ERROR!
Error while parsing entities from JDL
at Environment.error (/project/node_modules/yeoman-environment/lib/environment.js:140:40)
at constructor.error (/project/node_modules/generator-jhipster/generators/generator-base.js:1686:18)
at constructor.parseJDL (/project/node_modules/generator-jhipster/generators/import-jdl/index.js:108:22)
at Object.<anonymous> (/project/node_modules/yeoman-generator/lib/index.js:417:23)
at /project/node_modules/run-async/index.js:25:25
at Promise (<anonymous>)
at /project/node_modules/run-async/index.js:24:19
at /project/node_modules/yeoman-generator/lib/index.js:418:9
at runCallback (timers.js:781:20)
at tryOnImmediate (timers.js:743:5)
With --debug option: Command:
yo jhipster:import-jdl ~/Downloads/example.jh
Output:
The jdl is being parsed.
DEBUG! Error:
{ name: 'NoSQLModelingException',
message: 'NoSQL entities don\'t have relationships.',
prototype: Error
at new BuildException (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/jhipster-core/lib/exceptions/exception_factory.js:42:25)
at checkNoSQLModeling (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/jhipster-core/lib/parser/entity_parser.js:70:11)
at Object.parse [as convertToJHipsterJSON] (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/jhipster-core/lib/parser/entity_parser.js:40:5)
at constructor.parseJDL (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/generator-jhipster/generators/import-jdl/index.js:93:42)
at Object.<anonymous> (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/yeoman-generator/lib/index.js:417:23)
at /Users/jega/projects/owcHandwerker/plattformapp/node_modules/run-async/index.js:25:25
at Promise (<anonymous>)
at /Users/jega/projects/owcHandwerker/plattformapp/node_modules/run-async/index.js:24:19
at /Users/jega/projects/owcHandwerker/plattformapp/node_modules/yeoman-generator/lib/index.js:418:9
at runCallback (timers.js:781:20) }
Error jhipster:import-jdl /Users/jega/Downloads/example.jh --debug
Error: ERROR!
Error while parsing entities from JDL
at Environment.error (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:157:40)
at constructor.error (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/generator-jhipster/generators/generator-base.js:1686:18)
at constructor.parseJDL (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/generator-jhipster/generators/import-jdl/index.js:108:22)
at Object.<anonymous> (/Users/jega/projects/owcHandwerker/plattformapp/node_modules/yeoman-generator/lib/index.js:417:23)
at /Users/jega/projects/owcHandwerker/plattformapp/node_modules/run-async/index.js:25:25
at Promise (<anonymous>)
at /Users/jega/projects/owcHandwerker/plattformapp/node_modules/run-async/index.js:24:19
at /Users/jega/projects/owcHandwerker/plattformapp/node_modules/yeoman-generator/lib/index.js:418:9
at runCallback (timers.js:781:20)
at tryOnImmediate (timers.js:743:5)
The JDL File I tried is from the JHipster Blog-Example found here: https://github.com/jhipster/jdl-samples/blob/master/blog.jh
You are trying to generate entities that use relationships in a NoSQL project. Relations are not supported by JHipster for NoSQL projects. For more information on how JHipster handles relationships, see the docs on Managing Relationships:
Relationships only work when JPA is used. If you choose to use Cassandra or MongoDB, they won’t be available.
Removing the relationships allows the JDL to be imported. You can also try with a project using an SQL database option.
The JDL error message is more verbose in future versions of JHipster (v4.10.0+) so you won't need to use the --debug
flag in the future.