1
votes

I am using jhipster version v6.5.0
When I am creating microservice gateway it asks for a database with the following error.

ERROR! Error: The entity cannot be generated as the application does not have a database configured!

Actually First I created a gateway with database and entities will work after my microservices are not running. That means it works as monolithic and I could see all JPA servicers in the gateway. Swagger API showing fine. But menu from Entities not using microservices.

.yo-rc.json

{
"generator-jhipster": {
    "promptValues": {
        "packageName": "com.xxx.gate",
        "nativeLanguage": "en"
    },
    "jhipsterVersion": "6.5.0",
    "applicationType": "gateway",
    "baseName": "myGate2",
    "packageName": "com.xxx.gate",
    "packageFolder": "com/xxx/gate",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "hazelcast",
    "enableHibernateCache": false,
    "websocket": "spring-websocket",
    "databaseType": "no",
    "devDatabaseType": "no",
    "prodDatabaseType": "no",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "XXXXXXXX",
    "embeddableLaunchScript": false,
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "angularX",
    "clientTheme": "lumen",
    "clientThemeVariant": "dark",
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
        "en"
    ],
    "blueprints": []
}

Please help

2
I have tried --skip-server option 'jhipster import-jdl ../../Downloads/jhipster-jdlX.jh --skip-server'. Then its working. But after I start gateway It does not show entities.ssp
Please consider editing your question rather than commenting it with what you have tried later.Gaël Marziou

2 Answers

0
votes

JHipster gateway does not persist entities, it's the responsibility of the microservices. This is why you are not able to generate entities in your gateway, the gateway will only import your microservices entities to generate frontend for them.

Rather than converting your monolith into a gateway, you should import your existing entities into a new service.

0
votes

I tried several possibilities. After changing my angular service class below it starts working as expected(calling microservice rather going directly to gateway).

Generated

public resourceUrl = SERVER_API_URL + 'api/countries';

Changed to

public resourceUrl = SERVER_API_URL + 'services/myservice/api/countries';

I am not sure that is the correct way that Jhipster expected. I have noticed that in gateway SORS filter too.

If you have any git project build with Angular Entities it would be great to understand better.

Thank you for your attention and help.