Generator-jhipster: How to create entity from UAA server to gateway

Created on 12 Sep 2019  路  3Comments  路  Source: jhipster/generator-jhipster

Overview of the issue

Hi,
I am trying to create the entity generated from UAA server to gateway. But I am getting the following error.
Error: Microservice name for the entity is not found. Entity cannot be generated!

Reproduce the error
  1. Create a UAA server.
  2. Create an entity in UAA server.
  3. Create Gateway server.
  4. Create an entity in gateway and import from UAA server path.
JHipster Version(s)

Jhipster version is 6.2.0

JHipster configuration

Gateway server config is:-

details>

.yo-rc.json file

{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.star.gateway",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "6.2.0",
    "applicationType": "gateway",
    "baseName": "StarGateway",
    "packageName": "com.star.gateway",
    "packageFolder": "com/star/gateway",
    "serverPort": "8080",
    "authenticationType": "uaa",
    "uaaBaseName": "StarAuthentication",
    "cacheProvider": "hazelcast",
    "enableHibernateCache": false,
    "websocket": "spring-websocket",
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "prodDatabaseType": "mysql",
    "searchEngine": "elasticsearch",
    "messageBroker": false,
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSwaggerCodegen": true,
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "react",
    "clientTheme": "flatly",
    "clientThemeVariant": "primary",
    "testFrameworks": ["gatling", "cucumber", "protractor"],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": ["en", "hi", "ta", "te"],
    "blueprints": []
  }
}

UAA server config is:-


.yo-rc.json file

{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.star.auth",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "6.2.0",
    "applicationType": "uaa",
    "baseName": "StarAuthentication",
    "packageName": "com.star.auth",
    "packageFolder": "com/star/auth",
    "serverPort": "9999",
    "authenticationType": "uaa",
    "cacheProvider": "hazelcast",
    "enableHibernateCache": false,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "prodDatabaseType": "mysql",
    "searchEngine": "elasticsearch",
    "messageBroker": false,
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSwaggerCodegen": true,
    "jwtSecretKey": "bXktc2VjcmV0LXRva2VuLXRvLWNoYW5nZS1pbi1wcm9kdWN0aW9uLWFuZC10by1rZWVwLWluLWEtc2VjdXJlLXBsYWNl",
    "testFrameworks": [
      "gatling",
      "cucumber"
    ],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": true,
    "clientPackageManager": "npm",
    "nativeLanguage": "en",
    "languages": [
      "en",
      "hi",
      "ta",
      "te"
    ],
    "blueprints": [],
    "skipClient": true
  }
}

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

JDL entity definitions

entity Institute {
  name String required,
  code String required unique,
  addressLine1 String required,
  addressLine2 String,
  city String required,
  state String required,
  country String required,
  pincode String required,
  latitute Double required min(-90) max(90),
  longitude Double required min(-180) max(180),
  status Status required
}
enum Status {
  ACTIVE,
  INACTIVE
}

dto Institute with mapstruct
paginate Institute with pagination
service Institute with serviceImpl
search Institute with elasticsearch
filter Institute

area pr done uaa

Most helpful comment

@pascalgrimaud Thanks. This worked. Can you please update me once after you update the jhipster codebase to handle this automatically.
thanks.

All 3 comments

@dronavallisaikrishna :

  • can you show me your .jhipster/Institute.json file plz ?
  • I think the property microserviceName is missing ; if you put something like "microserviceName": "StarAuthentication", I think it should work

I got the fix, I will do a PR soon

@pascalgrimaud Thanks. This worked. Can you please update me once after you update the jhipster codebase to handle this automatically.
thanks.

@dronavallisaikrishna : master branch contains the fix. So it will be in the next release

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SudharakaP picture SudharakaP  路  3Comments

pascalgrimaud picture pascalgrimaud  路  4Comments

trajakovic picture trajakovic  路  4Comments

sdoxsee picture sdoxsee  路  4Comments

tomj0101 picture tomj0101  路  3Comments