Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jhipster jdl reactive-mf.jdl no longer works with jhipster v8.1 #24600

Closed
vishalgvk opened this issue Dec 18, 2023 · 6 comments · Fixed by #24632
Closed

jhipster jdl reactive-mf.jdl no longer works with jhipster v8.1 #24600

vishalgvk opened this issue Dec 18, 2023 · 6 comments · Fixed by #24632

Comments

@vishalgvk
Copy link

Overview of the issue

Downloaded the updated reactive-mf.jdl file. Changed client to angular and db to mariadb.
Executed jhipster jdl reactive-mf.jdl --monorepository --workspaces
jhipster is generating source code for gateway and store but not for blog app.

Motivation for or Use Case
Reproduce the error

Step 1: Download reactive-mf.jdl
Step 2: Changed following values:

  • clientFramework: angular
  • databaseType: sql
  • devDatabaseType: mariadb
  • prodDatabaseType: mariadb

Sample:

application {
  config {
    baseName gateway
    reactive true
    packageName com.myapp.gateway
    applicationType gateway
    authenticationType jwt
    buildTool maven
    clientFramework angular
    databaseType sql
    devDatabaseType mariadb
    prodDatabaseType mariadb
    serverPort 8080
    serviceDiscoveryType consul
    testFrameworks [cypress]
    microfrontends [blog, store]
  }
}

application {
  config {
    baseName blog
    reactive true
    packageName com.myapp.blog
    applicationType microservice
    authenticationType jwt
    buildTool maven
    clientFramework angular
    databaseType sql
    devDatabaseType mariadb
    prodDatabaseType mariadb
    enableHibernateCache false
    serverPort 8081
    serviceDiscoveryType consul
    testFrameworks [cypress]
  }
  entities Blog, Post, Tag
}

application {
  config {
    baseName store
    reactive true
    packageName com.myapp.store
    applicationType microservice
    authenticationType jwt
    buildTool maven
    clientFramework angular
    databaseType sql
    devDatabaseType mariadb
    prodDatabaseType mariadb
    enableHibernateCache false
    serverPort 8082
    serviceDiscoveryType consul
    testFrameworks [cypress]
  }
  entities Product
}

Step 3: Execute jhipster jdl reactive-mf.jdl --monorepository --workspaces

Results in:

ERROR! An error occured while running jhipster:bootstrap-application-base#loadingEntities
ERROR! An error occured while running jhipster:workspaces#generateApplications
ERROR! ERROR! Error at entity Blog: could not find the entity user
Error: Error at entity Blog: could not find the entity user
    at loadEntitiesOtherSide (file:///C:/Users/VidyaYug/AppData/Roaming/npm/node_modules/generator-jhipster/dist/generators/base-application/support/relationship.mjs:60:23)
    at BootstrapApplicationBase.loadingEntities (file:///C:/Users/VidyaYug/AppData/Roaming/npm/node_modules/generator-jhipster/dist/generators/bootstrap-application-base/generator.mjs:204:37)
    at BootstrapApplicationBase.executeTask (file:///C:/Users/VidyaYug/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:244:26)
    at env.queueTask.once (file:///C:/Users/VidyaYug/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:218:56)
    at runLoop.add.once (file:///C:/Users/VidyaYug/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/yeoman-environment/dist/environment-base.js:384:23)
    at Immediate.<anonymous> (C:\Users\VidyaYug\AppData\Roaming\npm\node_modules\generator-jhipster\node_modules\grouped-queue\lib\subqueue.js:48:34)
    at process.processImmediate (node:internal/timers:476:21)
     info Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 99,999 days
     info       for: CN=Java Hipster, OU=Development, O=com.myapp.store, L=, ST=, C=
     info KeyStore 'C:\Users\VidyaYug\jhipster_workspace\test\store\src\main\resources\config\tls\keystore.p12' generated successfully.
     info Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 99,999 days
     info       for: CN=Java Hipster, OU=Development, O=com.myapp.gateway, L=, ST=, C=
     info KeyStore 'C:\Users\VidyaYug\jhipster_workspace\test\gateway\src\main\resources\config\tls\keystore.p12' generated successfully.
JHipster Version(s)

jhipster version: 8.1.0
node version: 18.19.0

Copy link
Contributor

github-actions bot commented Dec 18, 2023

JHipster has completed the sample check
.yo-rc.json:
Entities JDL:
Application: successfully generated
Frontend check: skipped
Backend check: skipped
E2E check: skipped

This check uses jhipster info output from the issue description to generate the sample.
Bug report that does not contain this information will be marked as invalid.

@mshima
Copy link
Member

mshima commented Dec 18, 2023

Samples for main branch are compatible with jhipster v7.
You should use the default branch which is the v8 branch for jhipster v8.

@vishalgvk
Copy link
Author

Samples for main branch are compatible with jhipster v7. You should use the default branch which is the v8 branch for jhipster v8.

Hi @mshima
As you mentioned, I tried with reactive-mf.jdl from v8 branch instead of main. Still the same issue persists for me.
Blog code isn't being generated as User entity couldn't be found (in spite of having builtInEntity in the .jdl file)

@mshima
Copy link
Member

mshima commented Dec 19, 2023

I've just tried and it worked:

% npx generator-jhipster@8.1.0 jdl reactive-ms --skip-install --monorepository --workspaces

        ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
        ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
        ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝
  ██╗   ██║ ██╔═══██║    ██║    ██╔════╝   ╚═══██╗    ██║    ██╔═══╝   ██╔══██║
  ╚██████╔╝ ██║   ██║ ████████╗ ██║       ██████╔╝    ██║    ████████╗ ██║  ╚██╗
   ╚═════╝  ╚═╝   ╚═╝ ╚═══════╝ ╚═╝       ╚═════╝     ╚═╝    ╚═══════╝ ╚═╝   ╚═╝
                            https://www.jhipster.tech
Welcome to JHipster v8.1.0

INFO! Generating jdls reactive-ms
WARNING! File not found: reactive-ms.jdl. Attempting download from jdl-samples repositoryINFO! Downloading file: https://raw.githubusercontent.com/jhipster/jdl-samples/v8.1.0/reactive-ms.jdl

INFO! Error downloading https://raw.githubusercontent.com/jhipster/jdl-samples/v8.1.0/reactive-ms.jdl: 404 - Not Found
INFO! Downloading file: https://raw.githubusercontent.com/jhipster/jdl-samples/v8/reactive-ms.jdl
.
.
.
Congratulations, JHipster execution is complete!
If you find JHipster useful consider sponsoring the project https://www.jhipster.tech/sponsors/

Thanks for using JHipster!

Note: jdl command downloads from sample if there is no local file.

@vishalgvk
Copy link
Author

Hi @mshima
Thanks for your reply
I tried the command shared by you: npx generator-jhipster@8.1.0 jdl reactive-ms --skip-install --monorepository --workspaces

I found that using authenticationType as oauth2 instead of jwt (in my case) resolved the issue.
So currently, jhipster isn't supporting builtInEntity when we use jwt.

@mshima
Copy link
Member

mshima commented Dec 20, 2023

Relationship with User in microservice applications is only supported by oauth2.
I don’t think we should support this with jwt and oauth2 implementation should be reimplemented using another technology #18755 (comment).

@deepu105 deepu105 added this to the 8.2.0 milestone Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants