jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.53k stars 4.02k forks source link

Not able to generate gateway microservice & entities associated with it. Jhipster 7.4.1 #17408

Closed grajuu closed 2 years ago

grajuu commented 2 years ago

Not able to generate gateway microservice & entities associated with it. Jhipster 7.4.1

INFO! Using JHipster version installed globally 7.4.1 node --version v16.13.1 java --version java 11.0.4 2019-07-16 LTS npm --version 8.1.2

JDL i tried

application {
  config {
    baseName gateway,
    reactive true,
    packageName com.sample.gateway,
    applicationType gateway,
    authenticationType oauth2,
    prodDatabaseType postgresql,
    serviceDiscoveryType eureka, 
    clientThemeVariant black,
    testFrameworks [cypress],
    buildTool gradle,
    clientFramework vue 
    nativeLanguage en,
    /* messageBroker kafka, */
    languages [en, es] 
  }
  entities *
  }

application {
  config {
    baseName hqheadquarters,
    packageName com.sample.hq,
    applicationType microservice,
    authenticationType oauth2,
    databaseType mongodb
    devDatabaseType mongodb
    prodDatabaseType mongodb
    buildTool gradle,
    searchEngine elasticsearch,
    serverPort 8081,
    enableHibernateCache false
    /* messageBroker kafka, */
    serviceDiscoveryType eureka
  }
  entities SuperMarket, DistributionCenters, Suppliers, HeadQ
}

entity Members {
    firstName String required,
    lastName String required,
    email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)
    age BigDecimal
}

// Customer for the SuperMarket
entity SuperMarket {
    marketID BigDecimal required,
    address String required,
    capacity Integer required,
    email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)

}

// Customer for the DC
entity DistributionCenters {
    dcID BigDecimal required,
    address String required,
    email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)

}

// Customer for the suppliers 
entity Suppliers {
    suppliersID BigDecimal required,
    address String required,
    email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)

}

// Customer for the HQ
entity HeadQ {
    hqID BigDecimal required,
    suppliersID BigDecimal,
    name String required,
    dcID BigDecimal,
    marketID BigDecimal,
    address String required,
    email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)

}

// ordersManagement flow 
application {
  config {
    baseName ordersManagement,
    packageName com.sample.orders,
    applicationType microservice,
    authenticationType oauth2,
    databaseType mongodb,
    devDatabaseType mongodb,
    prodDatabaseType mongodb,
    searchEngine elasticsearch,
    buildTool gradle,
    enableHibernateCache false,
    serverPort 8082,
    /* messageBroker kafka, */
    serviceDiscoveryType eureka
  }
 entities Product, ProductCategory, ProductOrder, OrderItem
}

// Purchase management suppliers   
entity Suppliers
{
    orderID BigDecimal required ,
    invertyID BigDecimal required,
    suppliersID String required,
    address String required,
    email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)

}

application {
  config {
    baseName invenrty,
    applicationType microservice,
    packageName com.sample.invoice,
    authenticationType oauth2,
    databaseType mongodb,
    devDatabaseType mongodb,
    prodDatabaseType mongodb,
    enableHibernateCache false
    buildTool gradle,
    serverPort 8083,
    /* messageBroker kafka, */
    serviceDiscoveryType eureka
  }
  entities Invoice, Shipment,Notification,Ordersinv,DistributionInv
}

// Purchase management suppliers   
entity DistributionInv
{
 // Much more field can added like product discription ,etc 
    rfid BigDecimal required,
    orderID BigDecimal required ,
    suppliersID String required,
    placedDate Instant required,
    status Boolean required
    email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)

}

// Order management DC 
entity Ordersinv
{
    orderID BigDecimal required ,
    reqDate Instant required,
    smID BigDecimal required,
    inventryID String required,
    address String required,
    rfid BigDecimal,
    confirmetionStatus Boolean,
    statsDesc String required,
    email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)

}

/**
 * Entities for store microservice
 */

// Product sold by the Online store 
entity Product {
    name String required
    description String
    price BigDecimal required min(0)
    size Size required
    image ImageBlob
}

enum Size {
    S, M, L, XL, XXL
}

entity ProductCategory {
    name String required
    description String
}

entity ProductOrder {
    placedDate Instant required
    status OrderStatus required
    code String required
    invoiceId Long
    customer String required
}

enum OrderStatus {
    COMPLETED, PENDING, CANCELLED
}
entity OrderItem {
    quantity Integer required min(0)
    totalPrice BigDecimal required min(0)
    status OrderItemStatus required
}
enum OrderItemStatus {
    AVAILABLE, OUT_OF_STOCK, BACK_ORDER
}

relationship ManyToOne {
    OrderItem{product(name) required} to Product
}
relationship OneToMany {
// SuperMarket, DistributionCenters, Suppliers, HeadQ
   ProductOrder{orderItem} to OrderItem{order(code) required} ,
   ProductCategory{product} to Product{productCategory(name)}
   HeadQ{marketID} to SuperMarket{headQ(name)}
   HeadQ{dcID} to DistributionCenters {headQ(name)}
   HeadQ{suppliersID} to Suppliers{headQ(name)}

}

/* Entities for Invoice microservice */
entity Invoice {
    code String required
    date Instant required
    details String
    status InvoiceStatus required
    paymentMethod PaymentMethod required
    paymentDate Instant required
    paymentAmount BigDecimal required
}

enum InvoiceStatus {
    PAID, ISSUED, CANCELLED
}

entity Shipment {
    trackingCode String
    date Instant required
    details String
}

enum PaymentMethod {
    CREDIT_CARD, CASH_ON_DELIVERY, PAYPAL
}

relationship OneToMany {
    Invoice{shipment} to Shipment{invoice(code) required}
}

/* Entities for notification microservice */

entity Notification {
    date Instant required
    details String
    sentDate Instant required
    format NotificationType required
    userId Long required
    productId Long required
}

enum NotificationType {
    EMAIL, SMS, PARCEL
}

/*relationship ManyToOne { */
 /* Address{members(email)} to Members */
/*}*/
relationship OneToOne {
    Members{user(login) required} to User
}

service Invoice, Shipment with serviceClass
paginate Invoice, Shipment, Product, Members, ProductOrder, OrderItem with pagination
service Product, ProductCategory, ProductOrder, Invoice with serviceClass
microservice Product, ProductCategory, ProductOrder, OrderItem with ordersManagement
microservice Invoice, Shipment,Notification,Ordersinv,DistributionInv with invenrty
microservice SuperMarket, DistributionCenters, Suppliers, HeadQ with hqheadquarters

// will be created under 'docker-compose' folder
deployment {
  deploymentType docker-compose
  appsFolders [gateway, hqheadquarters, ordersManagement,invenrty]
  dockerRepositoryName "govindraju9999"

}

Entities are not generating with following error.


ERROR! Cannot read properties of undefined (reading 'clientFramework')
TypeError: Cannot read properties of undefined (reading 'clientFramework')
    at EntityGenerator.setupMicroServiceEntity (/usr/local/lib/node_modules/generator-jhipster/generators/entity/index.js:237:30)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:1024:25)
    at /usr/local/lib/node_modules/generator-jhipster/node_modules/run-async/index.js:49:25
    at new Promise (<anonymous>)
    at /usr/local/lib/node_modules/generator-jhipster/node_modules/run-async/index.js:26:19
    at runLoop.add.once.once (/usr/local/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:1025:11)
    at Immediate.<anonymous> (/usr/local/lib/node_modules/generator-jhipster/node_modules/grouped-queue/lib/subqueue.js:48:34)
    at processImmediate (node:internal/timers:464:21)
INFO! Generator app child process exited with code 1
ERROR! Error executing app --reproducible --no-force --with-entities --no-dry-run --no-whitespace --no-bail --no-install-path --no-skip-regenerate --no-skip-yo-resolve --from-jdl --no-skip-cache --no-skip-install --no-force-install --no-ask-answered --no-defaults --no-skip-git
Error: Error executing app --reproducible --no-force --with-entities --no-dry-run --no-whitespace --no-bail --no-install-path --no-skip-regenerate --no-skip-yo-resolve --from-jdl --no-skip-cache --no-skip-install --no-force-install --no-ask-answered --no-defaults --no-skip-git
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/generator-jhipster/cli/import-jdl.js:195:16)
    at ChildProcess.emit (node:events:390:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)

**INFO! Generator app child process exited with code 0**

Thanks in advance

mshima commented 2 years ago

Looks duplicate of https://github.com/jhipster/generator-jhipster/issues/17324