jhipster / jhipster-core

JHipster Domain Language, used by JHipster UML and JDL-Studio to generate entities
Apache License 2.0
345 stars 116 forks source link

TypeError: Cannot set property 'clientRootFolder' of undefined #466

Closed mmarimuthu closed 4 years ago

mmarimuthu commented 4 years ago

I created a microservice in jhipster create Application. Created a jdl and attached the same to it. When running the jhipster import-jdl it raninto issue. Checked the https://github.com/jhipster/jhipster-core/issues/252 but couldn't resolve it.

Attaching the yorc and jh file for reference jh.txt yo_rc.txt

Error:

image

Could not get an example with jdl for micoservice in official website.


edit

JDL:

application {
  config {
    packageName com.ecab.driver
    baseName driverService
    applicationType microservice
    serverPort 3020
    serviceDiscoveryType eureka
    authenticationType jwt
    buildTool maven
    cacheProvider no
    devDatabaseType postgresql
    prodDatabaseType postgresql
    skipClient true
    // more configuration options goes here
  }
  // filter entities here
  entities User, Driver, CarDetails
}

entity User {
    firstName String required
    lastName String
    email String required
    gender String
    address1 String
    city String
    state String
    zipcode String
    country String
    type String required
    mobile String required
}

entity Driver {
    id String
    idProof String
    status String
}

entity CarDetails {
    id String required
    number String required
    model String
    manufacturer String
    type String required
    driverId String
    status String
    currentTripId String
}

relationship OneToOne {
    Driver{user} to User
    Driver{carDetails} to CarDetails
}

microservice all with driverService

service all with serviceImpl 

clientRootFolder all with driverService

.yo-rc.json file:

{
  "generator-jhipster": {
    "applicationType": "microservice",
    "gitCompany": "",
    "baseName": "driverService",
    "packageName": "com.ecab.driver",
    "packageFolder": "com/ecab/driver",
    "serverPort": "3020",
    "serviceDiscoveryType": "eureka",
    "authenticationType": "jwt",
    "uaaBaseName": "../uaa",
    "cacheProvider": "no",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "enableSwaggerCodegen": false,
    "messageBroker": false,
    "buildTool": "maven",
    "useSass": true,
    "clientPackageManager": "npm",
    "testFrameworks": [],
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en",
      "fr"
    ],
    "clientFramework": "angularX",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "6.8.0",
    "jwtSecretKey": "SECRET",
    "embeddableLaunchScript": false,
    "creationTimestamp": 1589648160634,
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "blueprints": [],
    "skipClient": true,
    "skipUserManagement": true
  },
  "git-provider": "GitHub",
  "git-company": "mmarimuthu",
  "repository-name": "driver-service",
  "entities": [
    "User",
    "Driver",
    "CarDetails"
  ]
}
MathieuAA commented 4 years ago

It will be fixed in JHipster v6.9.0

mmarimuthu commented 4 years ago

@MathieuAA what is the temporary solution

MathieuAA commented 4 years ago

As a workaround, you can use clientRootFolder Driver, CarDetails explicitely. Or completely omit the option! this is automatically setup if you have the microservice option

mmarimuthu commented 4 years ago

@MathieuAA thanks I will check and get back

mmarimuthu commented 4 years ago

@MathieuAA Still the error persists. Could you help.

MathieuAA commented 4 years ago

Alright, I need the modified JDL. Have you removed the redundant JDL app?

MathieuAA commented 4 years ago

Keeping the microserviceName option is good though

mmarimuthu commented 4 years ago

@MathieuAA as per your comments i removed the existing jdl app and tried. It worked. Thanks for the the help..!!

MathieuAA commented 4 years ago

Glad I could help, thanks for reporting the issue. If you need explanations on why this works, I'd be happy to detail everything.

mmarimuthu commented 4 years ago

@MathieuAA yes, Please provide a link if there is one. Also, my suggestion is that it will be helpful for the developers when we have a detailed 'Hello world' app steps. May be in https://www.jhipster.tech/ And description about the JDL file supported properties.

MathieuAA commented 4 years ago

I should improve the docs on that part... Your example could have been improved because:

Here, the issue was about something fairly stupid on my part, and thanks to you it's fixed (and released BTW).