0

I am trying to generate my monolith application using jhipster, but I haven't been successful. After troubleshooting I realized the issue is caused whenever I have a relationship to the user entity. To demonstrate the issue I have created a sample jhipster applications with a simple jdl which I copied from this link https://developer.okta.com/blog/2021/01/20/reactive-java-microservices, but instead of a microservice am generating a monolith application using spring webflux. I have jhipster version 7.8.0 installed. Here is my yo.rc

{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "blog",
    "blueprints": [],
    "buildTool": "gradle",
    "cacheProvider": "no",
    "clientFramework": "angularX",
    "clientPackageManager": "npm",
    "clientTheme": "flatly",
    "clientThemeVariant": "primary",
    "creationTimestamp": 1649012211769,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "devServerPort": 4200,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": false,
    "entitySuffix": "",
    "jhiPrefix": "blg",
    "jhipsterVersion": "7.8.0",
    "jwtSecretKey": "NjZlYjBlMTEzMjJiNmZiODFhYzc5NDk3OWM2YzY4NjM3ZjNkN2YwZDAxMDE1NzQ1OTc5MGQxM2ViNDMxMTYxYmEzZmI5NjEzOTI4Mzc4MjU0NjQyMWZmNDBiYTFjNzNmNzY2MTM0Y2JkNTJjMTI0MzU4NjUzMThlZjQyZTU4ZGM=",
    "languages": ["en", "fr"],
    "messageBroker": false,
    "nativeLanguage": "en",
    "otherModules": [],
    "packageName": "com.blog",
    "pages": [],
    "prodDatabaseType": "postgresql",
    "reactive": true,
    "searchEngine": false,
    "serverPort": "8080",
    "serverSideOptions": [],
    "serviceDiscoveryType": "eureka",
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "skipUserManagement": false,
    "testFrameworks": [],
    "websocket": false,
    "withAdminUi": true
  }
}

Also here is my app-jdl.jdl

entity Blog {
  name String required minlength(3)
  handle String required minlength(2)
}

entity Post {
  title String required
  content TextBlob required
  date Instant required
}

entity Tag {
  name String required minlength(2)
}

entity Product {
  title String required
  price BigDecimal required min(0)
  image ImageBlob
}

relationship ManyToOne {
  Blog{user(login)} to User
  Post{blog(name)} to Blog
}

relationship ManyToMany {
  Post{tag(name)} to Tag{post}
}

paginate Post, Tag with infinite-scroll
paginate Product with pagination

when I run jhipster import-jdl app-jdl.jdl I get the following error

Error running generator entities: Error: Error parsing file src/main/java/com/blog/repository/BlogRepositoryInternalImpl.java: undefined

enter image description here enter image description here

If you have any solution on how to go around this, please share. Many thanks

1 Answer 1

1

JHipster's JWT Auth doesn't support relationships with User in microservices. That feature is only available with OAuth 2.0.

https://www.jhipster.tech/creating-microservices/

Sign up to request clarification or add additional context in comments.

6 Comments

but I was not generating a microservice, I was generating a monolith. Hence it should work
It might be because you're using reactive, which uses R2DBC. If you use non-reactive, it'll use JPA and should work.
Is there a way to get it working for reactive with R2DBC for monolith in jhipster? since in my requirements I have to use the reactive stack with postgress hence its practically impossible to avoid them. if I wanted to build a monolith with the reactive stack with R2DBC using jhipster, how would you advice I go about it?
I tried creating an app from scratch using jhipster and answering the questions appropriately. I did this and then ran jhipster jdl blog.jdl using the JDL above. I'm able to reproduce the error. It could be a bug or possibly just an unsupported feature.
Thanks for taking the time, really appreciate
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.