2017-10-09 89 views
0

JHipster有問題。我無法從剛從頭開始創建的項目中導入任何JDL文件。即使JHipster的jdl樣本也不起作用。我總是得到同樣的錯誤:無法導入jdl文件

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) 

與--debug選項: 命令:

yo jhipster:import-jdl ~/Downloads/example.jh 

輸出:

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) 

我嘗試的JDL文件從JHipster Blog-示例在此處找到: https://github.com/jhipster/jdl-samples/blob/master/blog.jh

+0

http://idownvotedbecau.se/nocode/ – EJoshuaS

+0

使用'--debug'標誌運行以獲得更詳細的錯誤。也請添加你的JDL,所以我們可以幫助 –

+0

@JonRuddell我編輯了帖子並添加了信息 –

回答

0

您正在嘗試生成在NoSQL項目中使用關係的實體。 NoSQL項目的JHipster不支持關係。有關JHipster如何處理關係的詳細信息,請參閱Managing Relationships文檔:

Relationships only work when JPA is used. If you choose to use Cassandra or MongoDB, they won’t be available.

卸下關係使JDL進口。您還可以嘗試使用SQL數據庫選項進行項目。

未來版本的JHipster(v4.10.0 +)中的JDL錯誤消息更加冗長,因此將來不需要使用--debug標誌。

+0

非常感謝! –